picard.sam

## Class CreateSequenceDictionary

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

-     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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `String` | `GENOME_ASSEMBLY`
    `int` | `NUM_SEQUENCES`
    `File` | `OUTPUT`
    `File` | `REFERENCE`
    `String` | `SPECIES`
    `boolean` | `TRUNCATE_NAMES_AT_WHITESPACE`
    `String` | `URI`

    - ### Fields inherited from class picard.cmdline.CommandLineProgram

      `COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, TMP_DIR, VALIDATION_STRINGENCY, VERBOSITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CreateSequenceDictionary()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String[]` | `customCommandLineValidation()` Use reference filename to create URI to go into header if URI was not passed on cmd line.
    `protected int` | `doWork()` Do the work after command line has been parsed.
    `static void` | `main(String[] argv)`
    `htsjdk.samtools.SAMSequenceDictionary` | `makeSequenceDictionary(File referenceFile)` Deprecated.

    - ### Methods inherited from class picard.cmdline.CommandLineProgram

      `getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getNestedOptions, getNestedOptionsForHelp, getStandardUsagePreamble, getVersion, instanceMain, instanceMainWithExit, parseArgs, setDefaultHeaders`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### REFERENCE

          @Option(doc="Input reference fasta or fasta.gz",
                  shortName="R")
          public File REFERENCE

    - #### OUTPUT

          @Option(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 File OUTPUT

    - #### GENOME_ASSEMBLY

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

    - #### URI

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

    - #### SPECIES

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

    - #### TRUNCATE_NAMES_AT_WHITESPACE

          @Option(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

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

  - ### Constructor Detail

    - #### CreateSequenceDictionary

          public CreateSequenceDictionary()

  - ### Method Detail

    - #### main

          public static void main(String[] argv)

    - #### makeSequenceDictionary

          @Deprecated
          public htsjdk.samtools.SAMSequenceDictionary makeSequenceDictionary(File referenceFile)

      Deprecated.
      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.

    - #### 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.