uk.ac.sanger.npg.picard
Class BamIndexDecoder

java.lang.Object
  extended by net.sf.picard.cmdline.CommandLineProgram
      extended by uk.ac.sanger.npg.picard.PicardCommandLine
          extended by uk.ac.sanger.npg.picard.BamIndexDecoder

public class BamIndexDecoder
extends PicardCommandLine

This class is used decode the multiplexed bam file. Each read in BAM file will be marked in its read name and read group, There is an option to output bam file by tag. The bar code list can be passed in through command line or by a file with extra information barcode name, library name, sample name and description, which are separated by tab this file must have a header: barcode_sequence barcode_name library_name sample_name description The read group will be changed and re-added in.


Field Summary
 java.util.List<java.lang.String> BARCODE
           
 java.io.File BARCODE_FILE
           
 java.lang.String BARCODE_QUALITY_TAG_NAME
           
 java.lang.String BARCODE_TAG_NAME
           
 boolean CONVERT_LOW_QUALITY_TO_NO_CALL
           
 java.io.File INPUT
           
 int MAX_MISMATCHES
           
 int MAX_NO_CALLS
           
 java.io.File METRICS_FILE
           
 int MIN_MISMATCH_DELTA
           
 java.io.File OUTPUT
           
 java.io.File OUTPUT_DIR
           
 java.lang.String OUTPUT_FORMAT
           
 java.lang.String OUTPUT_PREFIX
           
 java.lang.String USAGE
           
 
Fields inherited from class uk.ac.sanger.npg.picard.PicardCommandLine
version
 
Fields inherited from class net.sf.picard.cmdline.CommandLineProgram
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, MAX_RECORDS_IN_RAM, QUIET, TMP_DIR, VALIDATION_STRINGENCY, VERBOSITY
 
Constructor Summary
BamIndexDecoder()
           
 
Method Summary
 java.lang.String checkBarcodeQuality(java.lang.String barcodeRead, java.lang.String barcodeQual)
           
 void closeOutputList()
          close output files
protected  java.lang.String[] customCommandLineValidation()
           
protected  int doWork()
           
 void generateOutputFile(net.sf.samtools.SAMFileHeader header)
           
static void main(java.lang.String[] argv)
           
 
Methods inherited from class uk.ac.sanger.npg.picard.PicardCommandLine
addProgramRecordToHead, getThisProgramRecord, makeUniqueProgramId
 
Methods inherited from class net.sf.picard.cmdline.CommandLineProgram
getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getProgramVersion, getStandardUsagePreamble, instanceMain, instanceMainWithExit, parseArgs, setDefaultHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USAGE

@Usage(programVersion="1.00")
public final java.lang.String USAGE

INPUT

@Option(shortName="I",
        doc="The input SAM or BAM file to decode.")
public java.io.File INPUT

OUTPUT

@Option(shortName="O",
        doc="The output file after decoding.",
        mutex="OUTPUT_DIR")
public java.io.File OUTPUT

OUTPUT_DIR

@Option(doc="The output directory for bam files for each barcode if you want to split the output",
        mutex="OUTPUT")
public java.io.File OUTPUT_DIR

OUTPUT_PREFIX

@Option(doc="The prefix for bam or sam file when you want to split output by barcodes",
        mutex="OUTPUT")
public java.lang.String OUTPUT_PREFIX

OUTPUT_FORMAT

@Option(doc="The extension name for split file when you want to split output by barcodes: bam or sam",
        mutex="OUTPUT")
public java.lang.String OUTPUT_FORMAT

BARCODE_TAG_NAME

@Option(shortName="BC_SEQ",
        doc="The tag name used to store barcode read in bam records")
public java.lang.String BARCODE_TAG_NAME

BARCODE_QUALITY_TAG_NAME

@Option(shortName="BC_QUAL",
        doc="Tag name for barcode quality.")
public java.lang.String BARCODE_QUALITY_TAG_NAME

BARCODE

@Option(doc="Barcode sequence.  These must be unique, and all the same length.",
        mutex="BARCODE_FILE")
public java.util.List<java.lang.String> BARCODE

BARCODE_FILE

@Option(doc="Tab-delimited file of barcode sequences, and optionally barcode name and library name.  Barcodes must be unique, and all the same length.  Column headers must be \'barcode_sequence\', \'barcode_name\', and \'library_name\'.",
        mutex="BARCODE")
public java.io.File BARCODE_FILE

METRICS_FILE

@Option(doc="Per-barcode and per-lane metrics written to this file.",
        shortName="M")
public java.io.File METRICS_FILE

MAX_MISMATCHES

@Option(doc="Maximum mismatches for a barcode to be considered a match.")
public int MAX_MISMATCHES

MIN_MISMATCH_DELTA

@Option(doc="Minimum difference between number of mismatches in the best and second best barcodes for a barcode to be considered a match.")
public int MIN_MISMATCH_DELTA

MAX_NO_CALLS

@Option(doc="Maximum allowable number of no-calls in a barcode read before it is considered unmatchable.")
public int MAX_NO_CALLS

CONVERT_LOW_QUALITY_TO_NO_CALL

@Option(doc="Convert low quality bases in barcode read to Ns .")
public boolean CONVERT_LOW_QUALITY_TO_NO_CALL
Constructor Detail

BamIndexDecoder

public BamIndexDecoder()
Method Detail

doWork

protected int doWork()
Specified by:
doWork in class net.sf.picard.cmdline.CommandLineProgram

generateOutputFile

public void generateOutputFile(net.sf.samtools.SAMFileHeader header)
Parameters:
header -

closeOutputList

public void closeOutputList()
close output files


customCommandLineValidation

protected java.lang.String[] customCommandLineValidation()
Overrides:
customCommandLineValidation in class net.sf.picard.cmdline.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.

checkBarcodeQuality

public java.lang.String checkBarcodeQuality(java.lang.String barcodeRead,
                                            java.lang.String barcodeQual)
Parameters:
barcodeRead -
barcodeQual -
Returns:
new bar code read string with low quality bases converted to N

main

public static void main(java.lang.String[] argv)
Parameters:
argv -