### SamToFastq

Extracts read sequences and qualities from the input SAM/BAM file and writes them into the output file in Sanger fastq format. 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.

Option | Description
--- | ---
INPUT=File | Input SAM/BAM file to extract reads from Required.
FASTQ=File | Output fastq file (single-end fastq or, if paired, first end of the pair fastq). Required. Cannot be used in conjuction with option(s) OUTPUT_PER_RG (OPRG)
SECOND_END_FASTQ=File | Output fastq file (if paired, second end of the pair fastq). Default value: null. Cannot be used in conjuction with option(s) OUTPUT_PER_RG (OPRG)
OUTPUT_PER_RG=Boolean | Output a fastq file per read group (two fastq files per read group if the group is paired). Default value: false. This option can be set to 'null' to clear the default value. Possible values: {true, false} Cannot be used in conjuction with option(s) SECOND_END_FASTQ (F2) FASTQ (F)
OUTPUT_DIR=File | Directory in which to output the fastq file(s). Used only when OUTPUT_PER_RG is true. Default value: null.
RE_REVERSE=Boolean | Re-reverse bases and qualities of reads with negative strand flag set before writing them to fastq Default value: true. This option can be set to 'null' to clear the default value. Possible values: {true, false}
INCLUDE_NON_PF_READS=Boolean | Include non-PF reads from the SAM file into the output FASTQ files. Default value: false. This option can be set to 'null' to clear the default value. Possible values: {true, false}
CLIPPING_ATTRIBUTE=String | The attribute that stores the position at which the SAM record should be clipped Default value: null.
CLIPPING_ACTION=String | 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. Default value: null.
READ1_TRIM=Integer | The number of bases to trim from the beginning of read 1. Default value: 0. This option can be set to 'null' to clear the default value.
READ1_MAX_BASES_TO_WRITE=Integer | 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. Default value: null.
READ2_TRIM=Integer | The number of bases to trim from the beginning of read 2. Default value: 0. This option can be set to 'null' to clear the default value.
READ2_MAX_BASES_TO_WRITE=Integer | 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. Default value: null.
INCLUDE_NON_PRIMARY_ALIGNMENTS=Boolean | 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. Default value: false. This option can be set to 'null' to clear the default value. Possible values: {true, false}