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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `CreateSequenceDictionary.CreateSeqDictReferenceArgumentCollection` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `File` | `ALT_NAMES` |
    `String` | `GENOME_ASSEMBLY` |
    `int` | `NUM_SEQUENCES` |
    `File` | `OUTPUT` |
    `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, referenceSequence, specialArgumentsCollection, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CreateSequenceDictionary()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | 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)` |
    `protected ReferenceArgumentCollection` | `makeReferenceArgumentCollection()` |
    `htsjdk.samtools.SAMSequenceDictionary` | `makeSequenceDictionary​(File referenceFile)` | Deprecated.

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

      `getCommandLine, getCommandLineParser, getDefaultHeaders, getFaqLink, getMetricsFile, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser`

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

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

- - ### Field Detail

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

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