uk.ac.sanger.npg.picard
Class BamReadTrimmer

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.BamReadTrimmer

public class BamReadTrimmer
extends PicardCommandLine

The class to strip part of a read (fixed position) - typically a prefix of the forward read, and optionally place this and its quality in BAM tags.


Field Summary
 java.lang.Integer FIRST_POSITION_TO_TRIM
           
 java.io.File INPUT
           
 java.lang.Boolean ONLY_FORWARD_READ
           
 java.io.File OUTPUT
           
 java.lang.Boolean SAVE_TRIM
           
 java.util.List<java.lang.String> TAG_TO_KEEP
           
 java.lang.String TRIM_BASE_TAG
           
 java.lang.Integer TRIM_LENGTH
           
 java.lang.String TRIM_QUALITY_TAG
           
 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
BamReadTrimmer()
           
 
Method Summary
protected  int doWork()
           
static void main(java.lang.String[] args)
          example: INPUT=testdata/bam/6210_8.sam OUTPUT=testdata/6210_8_trimmed.bam FIRST_POSITION_TO_TRIM=1 TRIM_LENGTH=3 CREATE_MD5_FILE=true ONLY_FORWARD_READ=true SAVE_TRIM=true TRIM_BASE_TAG=rs TRIM_QUALITY_TAG=qs VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=SILENT INPUT=testdata/bam/6210_8.sam OUTPUT=testdata/6210_8_trimmed.bam FIRST_POSITION_TO_TRIM=1 TRIM_LENGTH=3 TMP_DIR=testdata CREATE_MD5_FILE=true ONLY_FORWARD_READ=true SAVE_TRIM=true TRIM_BASE_TAG=rs TRIM_QUALITY_TAG=qs VALIDATION_STRINGENCY=SILENT
 net.sf.samtools.SAMRecord removeAlignment(net.sf.samtools.SAMRecord record, net.sf.samtools.SAMFileHeader header)
           
 net.sf.samtools.SAMRecord trimSAMRecord(net.sf.samtools.SAMRecord record, int firstPos, int trimLength, boolean saveTrim)
           
 
Methods inherited from class uk.ac.sanger.npg.picard.PicardCommandLine
addProgramRecordToHead, getThisProgramRecord, makeUniqueProgramId
 
Methods inherited from class net.sf.picard.cmdline.CommandLineProgram
customCommandLineValidation, 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 trim.")
public java.io.File INPUT

OUTPUT

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

ONLY_FORWARD_READ

@Option(shortName="FORWARD",
        doc="Just trim the forward read if true.")
public java.lang.Boolean ONLY_FORWARD_READ

FIRST_POSITION_TO_TRIM

@Option(shortName="POS",
        doc="First position to be trimmed.")
public java.lang.Integer FIRST_POSITION_TO_TRIM

TRIM_LENGTH

@Option(shortName="LEN",
        doc="The lenght to be trimmed.")
public java.lang.Integer TRIM_LENGTH

SAVE_TRIM

@Option(shortName="SAVE",
        doc="Timmed bases to be saved?",
        optional=true)
public java.lang.Boolean SAVE_TRIM

TRIM_BASE_TAG

@Option(shortName="RS",
        doc="Tag name to be used for timmed bases.",
        optional=true)
public java.lang.String TRIM_BASE_TAG

TRIM_QUALITY_TAG

@Option(shortName="QS",
        doc="Tag name to be used for timmed qualities.",
        optional=true)
public java.lang.String TRIM_QUALITY_TAG

TAG_TO_KEEP

@Option(shortName="TAG",
        doc="A list of tags to keep.")
public final java.util.List<java.lang.String> TAG_TO_KEEP
Constructor Detail

BamReadTrimmer

public BamReadTrimmer()
Method Detail

doWork

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

removeAlignment

public net.sf.samtools.SAMRecord removeAlignment(net.sf.samtools.SAMRecord record,
                                                 net.sf.samtools.SAMFileHeader header)
Parameters:
record -
header -
Returns:

trimSAMRecord

public net.sf.samtools.SAMRecord trimSAMRecord(net.sf.samtools.SAMRecord record,
                                               int firstPos,
                                               int trimLength,
                                               boolean saveTrim)
Parameters:
record -
firstPos -
trimLength -
saveTrim -
Returns:

main

public static void main(java.lang.String[] args)
example: INPUT=testdata/bam/6210_8.sam OUTPUT=testdata/6210_8_trimmed.bam FIRST_POSITION_TO_TRIM=1 TRIM_LENGTH=3 CREATE_MD5_FILE=true ONLY_FORWARD_READ=true SAVE_TRIM=true TRIM_BASE_TAG=rs TRIM_QUALITY_TAG=qs VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=SILENT INPUT=testdata/bam/6210_8.sam OUTPUT=testdata/6210_8_trimmed.bam FIRST_POSITION_TO_TRIM=1 TRIM_LENGTH=3 TMP_DIR=testdata CREATE_MD5_FILE=true ONLY_FORWARD_READ=true SAVE_TRIM=true TRIM_BASE_TAG=rs TRIM_QUALITY_TAG=qs VALIDATION_STRINGENCY=SILENT

Parameters:
args -