Package picard.sam

Class SamToFastqWithTags


  • public class SamToFastqWithTags
    extends SamToFastq

    Extracts read sequences and qualities from the input SAM/BAM file and SAM/BAM tags and writes them into output files in Sanger FASTQ format. See MAQ FASTQ specification for details.

    Usage example:

     java -jar picard.jar SamToFastqWithTags
         I=input.bam
         FASTQ=output.fastq
         SEQUENCE_TAG_GROUP="CR"
         QUALITY_TAG_GROUP="CY"
         SEQUENCE_TAG_GROUP="CB,UR"
         QUALITY_TAG_GROUP="CY,UY"
     

    • Field Detail

      • SEQUENCE_TAG_GROUP

        @Argument(shortName="STG",
                  doc="List of comma separated tag values to extract from Input SAM/BAM to be used as read sequence",
                  minElements=1)
        public List<String> SEQUENCE_TAG_GROUP
      • QUALITY_TAG_GROUP

        @Argument(shortName="QTG",
                  doc="List of comma separated tag values to extract from Input SAM/BAM to be used as read qualities",
                  optional=true)
        public List<String> QUALITY_TAG_GROUP
      • TAG_GROUP_SEPERATOR

        @Argument(shortName="SEP",
                  doc="List of any sequences (e.g. \'AACCTG`) to put in between each comma separated list of sequence tags in each SEQUENCE_TAG_GROUP (STG)",
                  optional=true)
        public List<String> TAG_GROUP_SEPERATOR
      • COMPRESS_OUTPUTS_PER_TAG_GROUP

        @Argument(shortName="GZOPTG",
                  doc="Compress output FASTQ files per Tag grouping using gzip and append a .gz extension to the file names.")
        public Boolean COMPRESS_OUTPUTS_PER_TAG_GROUP
    • Constructor Detail

      • SamToFastqWithTags

        public SamToFastqWithTags()
    • Method Detail

      • handleAdditionalRecords

        protected void handleAdditionalRecords​(htsjdk.samtools.SAMRecord currentRecord,
                                               Map<htsjdk.samtools.SAMReadGroupRecord,​List<htsjdk.samtools.fastq.FastqWriter>> tagWriters,
                                               htsjdk.samtools.SAMRecord read1,
                                               htsjdk.samtools.SAMRecord read2)
        Overrides:
        handleAdditionalRecords in class SamToFastq
      • generateAdditionalWriters

        protected Map<htsjdk.samtools.SAMReadGroupRecord,​List<htsjdk.samtools.fastq.FastqWriter>> generateAdditionalWriters​(List<htsjdk.samtools.SAMReadGroupRecord> readGroups,
                                                                                                                                  htsjdk.samtools.fastq.FastqWriterFactory factory)
        Overrides:
        generateAdditionalWriters in class SamToFastq
      • customCommandLineValidation

        protected String[] customCommandLineValidation()
        Description copied from class: SamToFastq
        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.
        Overrides:
        customCommandLineValidation in class SamToFastq
        Returns:
        null if command line is valid. If command line is invalid, returns an array of error messages to be written to the appropriate place.