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 classCreateSequenceDictionary.CreateSeqDictReferenceArgumentCollection
-
Field Summary
Fields Modifier and Type Field Description FileALT_NAMESStringGENOME_ASSEMBLYintNUM_SEQUENCESFileOUTPUTStringSPECIESbooleanTRUNCATE_NAMES_AT_WHITESPACEStringURI-
Fields inherited from class picard.cmdline.CommandLineProgram
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH, 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 Instance Methods Concrete 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 intdoWork()Do the work after command line has been parsed.protected ReferenceArgumentCollectionmakeReferenceArgumentCollection()htsjdk.samtools.SAMSequenceDictionarymakeSequenceDictionary(File referenceFile)Read all the sequences from the given reference file, and convert into SAMSequenceRecords-
Methods inherited from class picard.cmdline.CommandLineProgram
checkRInstallation, getCommandLine, getCommandLineParser, getCommandLineParserForArgs, getDefaultHeaders, getFaqLink, getMetricsFile, getPGRecord, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser
-
-
-
-
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
-
-
Method Detail
-
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:
customCommandLineValidationin classCommandLineProgram- 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:
makeReferenceArgumentCollectionin classCommandLineProgram
-
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:
doWorkin classCommandLineProgram- Returns:
- program exit status.
-
-