What is the difference between the Picard tools ReorderSam and SortSam?

jwhitejwhite MEEIMember

I used ReorderSam to reorder the reads in a BAM file to a reordered hg19 reference. Does the BAM file need to be sorted as well? If so, why? How is ReorderSam different from SortSam?

Joe White


  • pdexheimerpdexheimer Member ✭✭✭✭

    A better question for the Picard group than the GATK group, but easily answered. From http://picard.sourceforge.net/command-line-overview.shtml#ReorderSam:

    Not to be confused with SortSam which sorts a SAM or BAM file with a valid sequence dictionary, ReorderSam reorders reads in a SAM/BAM file to match the contig ordering in a provided reference file, as determined by exact name matching of contigs

    So Reorder changes the order of contigs in the reference, Sort sorts against that reference

  • jwhitejwhite MEEIMember

    This is from the command help text. It doesn't quite answer my question. What is the difference between these 2 utilities? How is reordering different from sorting?

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    @pdexheimer said:
    So Reorder changes the order of contigs in the reference, Sort sorts against that reference

    I'm not sure I can put it any more clearly than Phil did there, except to say that Sort sorts reads within contigs (i.e. puts them in order of position or whichever option you choose) while Reorder moves around chunks of the file that correspond to contigs.

    If you want more detail than that, please ask the Picard team, since it's their tool.

  • jwhitejwhite MEEIMember

    Is there a Broad forum for Picard tools (other than their email list)?

  • KurtKurt Member ✭✭✭

    Picard support is actually hosted on the samtools forum

    `Send Samtools-help mailing list submissions to
    [email protected]

    To subscribe or unsubscribe via the World Wide Web, visit
    or, via email, send a message with subject or body 'help' to
    [email protected]

    You can reach the person managing the list at
    [email protected]

    When replying, please edit your Subject line so it is more specific
    than "Re: Contents of Samtools-help digest..."

    Today's Topics:

    1. Re: Issue with Picard SAM Validation (Tim Fennell)
    2. Re: Issue with Picard SAM Validation (Mauricio Carneiro)`
Sign In or Register to comment.