Package picard.sam

Class CreateSequenceDictionary

java.lang.Object
picard.cmdline.CommandLineProgram
picard.sam.CreateSequenceDictionary

@DocumentedFeature public class CreateSequenceDictionary extends CommandLineProgram
Create a SAM/BAM file from a fasta containing reference sequence. The output SAM file contains a header but no SAMRecords, and the header contains only sequence records.
  • Field Details

    • OUTPUT

      @Argument(doc="Output SAM file containing only the sequence dictionary. By default it will use the base name of the input reference with the .dict extension", shortName="O", optional=true) public PicardHtsPath OUTPUT
    • GENOME_ASSEMBLY

      @Argument(shortName="AS", doc="Put into AS field of sequence dictionary entry if supplied", optional=true) public String GENOME_ASSEMBLY
    • URI

      @Argument(shortName="UR", doc="Put into UR field of sequence dictionary entry. If not supplied, input reference file is used", optional=true) public String URI
    • SPECIES

      @Argument(shortName="SP", doc="Put into SP field of sequence dictionary entry", optional=true) public String SPECIES
    • TRUNCATE_NAMES_AT_WHITESPACE

      @Argument(doc="Make sequence name the first word from the > line in the fasta file. By default the entire contents of the > line is used, excluding leading and trailing whitespace.") public boolean TRUNCATE_NAMES_AT_WHITESPACE
    • NUM_SEQUENCES

      @Argument(doc="Stop after writing this many sequences. For testing.") public int NUM_SEQUENCES
    • ALT_NAMES

      @Argument(shortName="AN", doc="Optional file containing the alternative names for the contigs. Tools may use this information to consider different contig notations as identical (e.g: \'chr1\' and \'1\'). The alternative names will be put into the appropriate @AN annotation for each contig. No header. First column is the original name, the second column is an alternative name. One contig may have more than one alternative name.", optional=true) public File ALT_NAMES
  • Constructor Details

    • CreateSequenceDictionary

      public CreateSequenceDictionary()
  • Method Details

    • makeSequenceDictionary

      public htsjdk.samtools.SAMSequenceDictionary makeSequenceDictionary(File referenceFile)
      Read all the sequences from the given reference file, and convert into SAMSequenceRecords
      Parameters:
      referenceFile - fasta or fasta.gz
      Returns:
      SAMSequenceRecords containing info from the fasta, plus from cmd-line arguments.
    • customCommandLineValidation

      protected String[] customCommandLineValidation()
      Use reference filename to create URI to go into header if URI was not passed on cmd line.
      Overrides:
      customCommandLineValidation in class CommandLineProgram
      Returns:
      null if command line is valid. If command line is invalid, returns an array of error message to be written to the appropriate place.
    • makeReferenceArgumentCollection

      protected ReferenceArgumentCollection makeReferenceArgumentCollection()
      Overrides:
      makeReferenceArgumentCollection in class CommandLineProgram
    • doWork

      protected int doWork()
      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.