Package picard.sam

Class ReorderSam


  • @DocumentedFeature
    public class ReorderSam
    extends CommandLineProgram
    Reorders a SAM/BAM input file according to the order of contigs in a second reference file.

    Summary

    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. Reads mapped to contigs absent in the new reference are dropped. Runs substantially faster if the input is an indexed BAM file.

    Example

         java -jar picard.jar ReorderSam \
              INPUT=sample.bam \
              OUTPUT=reordered.bam \
              REFERENCE=reference_with_different_order.fasta
     
    • Field Detail

      • INPUT

        @Argument(shortName="I",
                  doc="Input file (SAM or BAM) to extract reads from.")
        public File INPUT
      • OUTPUT

        @Argument(shortName="O",
                  doc="Output file (SAM or BAM) to write extracted reads to.")
        public File OUTPUT
      • ALLOW_INCOMPLETE_DICT_CONCORDANCE

        @Argument(shortName="S",
                  doc="If true, then allows only a partial overlap of the original contigs with the new reference sequence contigs.  By default, this tool requires a corresponding contig in the new reference for each read contig")
        public boolean ALLOW_INCOMPLETE_DICT_CONCORDANCE
      • ALLOW_CONTIG_LENGTH_DISCORDANCE

        @Argument(shortName="U",
                  doc="If true, then permits mapping from a read contig to a new reference contig with the same name but a different length.  Highly dangerous, only use if you know what you are doing.")
        public boolean ALLOW_CONTIG_LENGTH_DISCORDANCE
    • Constructor Detail

      • ReorderSam

        public ReorderSam()