Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Brace
    Junior Member
    • May 2008
    • 7

    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, 01:04 AM.
  • MBekritsky
    Member
    • Nov 2009
    • 15

    #2
    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.

    Comment

    • Brace
      Junior Member
      • May 2008
      • 7

      #3
      Thanks MBekritsky, I've got it.

      Comment

      Latest Articles

      Collapse

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 06-05-2026, 10:09 AM
      0 responses
      10 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-04-2026, 08:59 AM
      0 responses
      22 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-02-2026, 12:03 PM
      0 responses
      28 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-02-2026, 11:40 AM
      0 responses
      22 views
      0 reactions
      Last Post SEQadmin2  
      Working...