Package picard.sam

Class SamFormatConverter


@DocumentedFeature public class SamFormatConverter extends CommandLineProgram
Converts a BAM file to human-readable SAM output or vice versa
  • Field Details

    • INPUT

      @Argument(doc="The SAM/BAM/CRAM file to parse.", shortName="I") public File INPUT
    • OUTPUT

      @Argument(doc="The SAM/BAM/CRAM output file. ", shortName="O") public File OUTPUT
  • Constructor Details

    • SamFormatConverter

      public SamFormatConverter()
  • Method Details

    • doWork

      protected int doWork()
      Description copied from class: CommandLineProgram
      Do the work after command line has been parsed. RuntimeException may be thrown by this method, and are reported appropriately.
      Specified by:
      doWork in class CommandLineProgram
      Returns:
      program exit status.
    • convert

      public static void convert(File input, File output, File referenceSequence, Boolean createIndex)
      Convert a file from one of sam/bam/cram format to another based on the extension of output.
      Parameters:
      input - input file in one of sam/bam/cram format
      output - output to write converted file to, the conversion is based on the extension of this filename
      referenceSequence - the reference sequence to use, necessary when reading/writing cram
      createIndex - whether or not an index should be written alongside the output file