Package picard.fastq

Class BamToBfq


  • @DocumentedFeature
    public class BamToBfq
    extends CommandLineProgram
    Converts a BAM file into a BFQ (binary fastq formatted) file.

    The BFQ format is the input format to some tools like Maq aligner.

    Input

    A single BAM file to convert

    .

    Output

    One or two FASTQ files depending on whether the BAM file contains single- or paired-end sequencing data. You must indicate the output directory that will contain these files (ANALYSIS_DIR) and the output file name prefix (OUTPUT_FILE_PREFIX).

    Usage example:

         java -jar picard.jar BamToBfq \
                 I=input.bam \
                 ANALYSIS_DIR=output_dir \
                 OUTPUT_FILE_PREFIX=output_name \
                 PAIRED_RUN=false
     
    • Field Detail

      • INPUT

        @Argument(doc="The BAM file to parse.",
                  shortName="I")
        public File INPUT
      • ANALYSIS_DIR

        @Argument(doc="The analysis directory for the binary output file. ")
        public File ANALYSIS_DIR
      • FLOWCELL_BARCODE

        @Argument(doc="Flowcell barcode (e.g. 30PYMAAXX).  ",
                  shortName="F",
                  mutex="OUTPUT_FILE_PREFIX")
        public String FLOWCELL_BARCODE
      • LANE

        @Argument(doc="Lane number. ",
                  shortName="L",
                  optional=true,
                  mutex="OUTPUT_FILE_PREFIX")
        public Integer LANE
      • OUTPUT_FILE_PREFIX

        @Argument(doc="Prefix for all output files",
                  mutex={"FLOWCELL_BARCODE","LANE"})
        public String OUTPUT_FILE_PREFIX
      • READS_TO_ALIGN

        @Argument(doc="Number of reads to align (null = all).",
                  shortName="NUM",
                  optional=true)
        public Integer READS_TO_ALIGN
      • READ_CHUNK_SIZE

        @Argument(doc="Number of reads to break into individual groups for alignment",
                  shortName="CHUNK")
        public Integer READ_CHUNK_SIZE
      • PAIRED_RUN

        @Argument(doc="Whether this is a paired-end run. ",
                  shortName="PE")
        public Boolean PAIRED_RUN
      • RUN_BARCODE

        @Argument(doc="Deprecated option; use READ_NAME_PREFIX instead",
                  mutex="READ_NAME_PREFIX",
                  shortName="RB",
                  optional=true)
        public String RUN_BARCODE
      • READ_NAME_PREFIX

        @Argument(doc="Prefix to be stripped off the beginning of all read names  (to make them short enough to run in Maq)",
                  optional=true)
        public String READ_NAME_PREFIX
      • INCLUDE_NON_PF_READS

        @Argument(doc="Whether to include non-PF reads",
                  shortName="NONPF",
                  optional=true)
        public Boolean INCLUDE_NON_PF_READS
      • CLIP_ADAPTERS

        @Argument(doc="Whether to clip adapters from the reads")
        public boolean CLIP_ADAPTERS
      • BASES_TO_WRITE

        @Argument(doc="The number of bases from each read to write to the bfq file.  If this is non-null, then only the first BASES_TO_WRITE bases from each read will be written.",
                  optional=true)
        public Integer BASES_TO_WRITE
    • Constructor Detail

      • BamToBfq

        public BamToBfq()
    • Method Detail

      • doWork

        protected int doWork()
        Description copied from class: CommandLineProgram
        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.
      • main

        public static void main​(String[] argv)
      • customCommandLineValidation

        protected String[] customCommandLineValidation()
        Description copied from class: CommandLineProgram
        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 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.