public class SamToFastq
- extends CommandLineProgram
Extracts read sequences and qualities from the input SAM/BAM file and writes them into
the output file in Sanger fastq format.
See MAQ FastQ specification for details.
In the RC mode (default is True), if the read is aligned and the alignment is to the reverse strand on the genome,
the read's sequence from input sam file will be reverse-complemented prior to writing it to fastq in order restore correctly
the original read sequence as it was generated by the sequencer.
|Methods inherited from class net.sf.picard.cmdline.CommandLineProgram
getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getNestedOptions, getNestedOptionsForHelp, getProgramVersion, getStandardUsagePreamble, getVersion, instanceMain, instanceMainWithExit, parseArgs, setDefaultHeaders
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public String USAGE
@Option(doc="Input SAM/BAM file to extract reads from",
public File INPUT
doc="Output fastq file (single-end fastq or, if paired, first end of the pair fastq).",
public File FASTQ
doc="Output fastq file (if paired, second end of the pair fastq).",
public File SECOND_END_FASTQ
doc="Output a fastq file per read group (two fastq files per read group if the group is paired).",
public boolean OUTPUT_PER_RG
doc="Directory in which to output the fastq file(s). Used only when OUTPUT_PER_RG is true.",
public File OUTPUT_DIR
doc="Re-reverse bases and qualities of reads with negative strand flag set before writing them to fastq",
public boolean RE_REVERSE
doc="Will generate an interleaved fastq if paired, each line will have /1 or /2 to describe which end it came from")
public boolean INTERLEAVE
doc="Include non-PF reads from the SAM file into the output FASTQ files.")
public boolean INCLUDE_NON_PF_READS
doc="The attribute that stores the position at which the SAM record should be clipped",
public String CLIPPING_ATTRIBUTE
doc="The action that should be taken with clipped reads: \'X\' means the reads and qualities should be trimmed at the clipped position; \'N\' means the bases should be changed to Ns in the clipped region; and any integer means that the base qualities should be set to that value in the clipped region.",
public String CLIPPING_ACTION
doc="The number of bases to trim from the beginning of read 1.")
public int READ1_TRIM
doc="The maximum number of bases to write from read 1 after trimming. If there are fewer than this many bases left after trimming, all will be written. If this value is null then all bases left after trimming will be written.",
public Integer READ1_MAX_BASES_TO_WRITE
doc="The number of bases to trim from the beginning of read 2.")
public int READ2_TRIM
doc="The maximum number of bases to write from read 2 after trimming. If there are fewer than this many bases left after trimming, all will be written. If this value is null then all bases left after trimming will be written.",
public Integer READ2_MAX_BASES_TO_WRITE
@Option(doc="If true, include non-primary alignments in the output. Support of non-primary alignments in SamToFastq is not comprehensive, so there may be exceptions if this is set to true and there are paired reads with non-primary alignments.")
public boolean INCLUDE_NON_PRIMARY_ALIGNMENTS
public static void main(String argv)
protected int doWork()
- Description copied from class:
- 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
- program exit status.
protected String customCommandLineValidation()
- Put any custom command-line validation in an override of this method.
clp is initialized at this point and can be used to print usage and access argv.
Any options set by command-line parser can be validated.
customCommandLineValidation in class
- null if command line is valid. If command line is invalid, returns an array of error
messages to be written to the appropriate place.