SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting unmapped reads from BAM using Samtools? Lspoor Bioinformatics 17 08-25-2013 12:22 AM
Extracting reads from BAM files alpesh Bioinformatics 1 10-12-2011 02:59 PM
Extracting Reference Sequence from a bam File andy11 Bioinformatics 6 12-13-2010 02:06 PM
Extracting base coverage and quality values from BAM files unagaswamy Bioinformatics 9 11-11-2010 06:55 AM
Extracting unique reads from a .ma or .bam file? JohnK SOLiD 14 06-04-2010 12:32 AM

Reply
 
Thread Tools
Old 12-12-2011, 04:29 PM   #1
ashkot
Member
 
Location: Cupertino, CA

Join Date: Nov 2011
Posts: 59
Default Extracting (Slicing) a BAM file

Hi there, i was wondering if someone could help with this. As there are several larger .bam files i wanted to slice out only data that belongs to say chromosome.

I found the following command on 1kGenomes site but it does not work.

samtools view -h ftp://ftp.1000genomes.ebi.ac.uk/vol1...e.20101123.bam 17:7512445-7513455

Can someone please help me the correct command syntax, i want to download .bam or .vcf files for full chromosomes such as 1,2 or 12 etc without specifying the genomic coordinates.

Thanks in advance.

Ashwin
ashkot is offline   Reply With Quote
Old 12-12-2011, 06:43 PM   #2
mhayes
Member
 
Location: Cleveland, OH

Join Date: Aug 2011
Posts: 11
Default

The syntax looks okay. How were the chromosomes labeled in the reference fasta file? Is it "chr17" or just "17"?

Also, is samtools capable of reading a BAM file remotely? Should you download it first?

What errors are being returned by the program when you try to execute it?
mhayes is offline   Reply With Quote
Old 12-12-2011, 11:14 PM   #3
ashkot
Member
 
Location: Cupertino, CA

Join Date: Nov 2011
Posts: 59
Default

I was trying to follow as show on this site.

http://www.1000genomes.org/faq/how-d...ction-vcf-file

The program does not generate any errors as such, just the output file shows junk.

Any ideas?
ashkot is offline   Reply With Quote
Old 12-13-2011, 10:14 AM   #4
hanshart
Member
 
Location: Germany

Join Date: Nov 2011
Posts: 27
Default

hi,

I just wanted to try it out but it seems that most of the HG... files were changed today. So I looked for another folder containing any BAM-files. Executing

samtools view ftp://ftp.1000genomes.ebi.ac.uk/vol1...d.20100311.bam 1:470260-471000 > test.sam

everything worked correctly (also "view -h"). So your command should be ok but the data seems to be corrupt (?)

cheers
hanshart is offline   Reply With Quote
Old 12-13-2011, 11:02 AM   #5
ashkot
Member
 
Location: Cupertino, CA

Join Date: Nov 2011
Posts: 59
Default

when i was looking at the screen, at the output, it showed a lot of error verbiage. so i wasnt sure altogether what was going on. I will give your suggested command a try and update this forum as well.
ashkot is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 10:32 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO