SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samtools view -f issue marco12345 Bioinformatics 2 03-22-2013 05:43 AM
samtools view cmccabe Bioinformatics 0 07-21-2012 09:07 AM
samtools view seq_lover Bioinformatics 2 04-27-2012 11:22 AM
samtools view without header Gen2007 Bioinformatics 4 11-16-2011 09:58 AM
Samtools view michalkovac Bioinformatics 2 07-19-2011 05:25 AM

Reply
 
Thread Tools
Old 03-29-2013, 12:20 AM   #1
Brace
Junior Member
 
Location: Beijing, china

Join Date: May 2008
Posts: 7
Default About Samtools view -L

Can this function be more efficient when dealing with whole genome alignment, for example 15G bam?

I had thought that it would use a bam index file, but it didn't.
Is it useful to build a bam index to the huge bam to accelerate the process?

Any other suggestion?

Last edited by Brace; 03-29-2013 at 01:04 AM.
Brace is offline   Reply With Quote
Old 03-29-2013, 06:16 AM   #2
MBekritsky
Member
 
Location: CSHL

Join Date: Nov 2009
Posts: 15
Default samtools -L

Looking at the code for samtools view, it does not appear that the -L flag uses the index to jump to regions specified in a BED file. The -L flag goes through the BAM file line by line and print out lines that overlap with a region in the BED file. Have you tried using the -L flag with a BED file? Does it run slower than you'd like?

I'm trying to think of a better explanation, but the code looks like it's written to balance lots of random access (via the index) vs retrieving lots of regions--if there are few desired regions relative to the genome size, it's faster to look for the specific region rather than to scan the whole BAM file. If you're looking for lots of regions relative to the genome size, then it's faster to scan through the file line by line and print the lines that overlap your regions of interest.

I would suggest that depending on how many regions you're looking to retrieve, it may be worth specifying them on the command line if there aren't too many. If you have lots of regions you're looking to retrieve from (I've gone up to a few million before), then the -L flag may be a better choice.
MBekritsky is offline   Reply With Quote
Old 03-29-2013, 08:33 PM   #3
Brace
Junior Member
 
Location: Beijing, china

Join Date: May 2008
Posts: 7
Default

Thanks MBekritsky, I've got it.
Brace 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 01:32 AM.


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