Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • wangzkai
    Member
    • Feb 2010
    • 11

    Sorted bam

    I have a bam file which were already sorted (by coordinates) using "samtools sort". However, when I tried to remove duplicate reads using picard's "MarkDuplicates" function, it failed saying that the input bam was not sorted according to the headers. So my questions are the following:

    1. Why a bam file sorted by samtools considered not sorted by picard?
    2. How can picard tell whether a bam file is sorted or not from the headers?

    Thanks for any help on this!
  • nilshomer
    Nils Homer
    • Nov 2008
    • 1283

    #2
    Originally posted by wangzkai View Post
    I have a bam file which were already sorted (by coordinates) using "samtools sort". However, when I tried to remove duplicate reads using picard's "MarkDuplicates" function, it failed saying that the input bam was not sorted according to the headers. So my questions are the following:

    1. Why a bam file sorted by samtools considered not sorted by picard?
    2. How can picard tell whether a bam file is sorted or not from the headers?

    Thanks for any help on this!
    Samtools does not modify the header correctly. You can use Picard to sort in the future. Use the "AS=true" option when running "MarkDuplicates" to override the header check.

    Comment

    • maubp
      Peter (Biopython etc)
      • Jul 2009
      • 1544

      #3
      Have you reported this possible bug in samtools?

      (I'm interested since I have some BAM files sorted with samtools which are causing problems in a Picard based viewer)

      Comment

      • nilshomer
        Nils Homer
        • Nov 2008
        • 1283

        #4
        Originally posted by maubp View Post
        Have you reported this possible bug in samtools?

        (I'm interested since I have some BAM files sorted with samtools which are causing problems in a Picard based viewer)
        The samtools developers are aware, but recommend using Picard as this probably wont be fixed anytime soon. I am sure if you give some of your grant money they would be happy to help .

        Comment

        Latest Articles

        Collapse

        ad_right_rmr

        Collapse

        News

        Collapse

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