@DocumentedFeature public class FilterSamReads extends CommandLineProgram
java -jar picard.jar FilterSamReads \
I=input.bam \
O=output.bam \
READ_LIST_FILE=read_names.txt \
FILTER=includeReadList
java -jar picard.jar FilterSamReads \
I=input.bam \
O=output.bam \
INTERVAL_LIST=regions.interval_list \
FILTER=includePairedIntervals
cat <script.js // reads having a soft clip larger than 2 bases in start of read function accept(rec) { if (rec.getReadUnmappedFlag()) return false; var cigar = rec.getCigar(); if (cigar == null) return false; var ce = cigar.getCigarElement(0); return ce.getOperator().name() == "S" && ce.length() > 2; } accept(record); EOF java -jar picard.jar FilterSamReads \ I=input.bam \ O=output.bam \ JAVASCRIPT_FILE=script.js \ FILTER=includeJavascript
| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
FilterSamReads.Filter |
| Modifier and Type | Field | Description |
|---|---|---|
FilterSamReads.Filter |
FILTER |
|
File |
INPUT |
|
File |
INTERVAL_LIST |
|
File |
JAVASCRIPT_FILE |
|
File |
OUTPUT |
|
File |
READ_LIST_FILE |
|
htsjdk.samtools.SAMFileHeader.SortOrder |
SORT_ORDER |
|
String |
TAG |
|
List<String> |
TAG_VALUE |
|
boolean |
WRITE_READS_FILES |
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY| Constructor | Description |
|---|---|
FilterSamReads() |
| Modifier and Type | Method | Description |
|---|---|---|
protected String[] |
customCommandLineValidation() |
Put any custom command-line validation in an override of this method.
|
protected int |
doWork() |
Do the work after command line has been parsed.
|
getCommandLine, getCommandLineParser, getDefaultHeaders, getFaqLink, getMetricsFile, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser@Argument(doc="The SAM or BAM file that will be filtered.",
shortName="I")
public File INPUT
@Argument(doc="Which filter to use.") public FilterSamReads.Filter FILTER
@Argument(doc="File containing reads that will be included in or excluded from the OUTPUT SAM or BAM file, when using FILTER=includeReadList or FILTER=includeReadList.",
optional=true,
shortName="RLF")
public File READ_LIST_FILE
@Argument(doc="Interval List File containing intervals that will be included in the OUTPUT when using FILTER=includePairedIntervals",
optional=true,
shortName="IL")
public File INTERVAL_LIST
@Argument(doc="The tag to select from input SAM/BAM",
optional=true,
shortName="T")
public String TAG
@Argument(doc="The tag value(s) to filter by",
optional=true,
shortName="TV")
public List<String> TAG_VALUE
@Argument(doc="SortOrder of the OUTPUT file, otherwise use the SortOrder of the INPUT file.",
optional=true,
shortName="SO")
public htsjdk.samtools.SAMFileHeader.SortOrder SORT_ORDER
@Argument(doc="SAM or BAM file for resulting reads.",
shortName="O")
public File OUTPUT
@Argument(shortName="JS",
doc="Filters the INPUT with a javascript expression using the java javascript-engine, when using FILTER=includeJavascript. The script puts the following variables in the script context: \n \'record\' a SamRecord ( https://samtools.github.io/htsjdk/javadoc/htsjdk/htsjdk/samtools/SAMRecord.html ) and \n \'header\' a SAMFileHeader ( https://samtools.github.io/htsjdk/javadoc/htsjdk/htsjdk/samtools/SAMFileHeader.html ).\n all the public members of SamRecord and SAMFileHeader are accessible. A record is accepted if the last value of the script evaluates to true.",
optional=true)
public File JAVASCRIPT_FILE
@Argument(doc="Create <OUTPUT>.reads file containing names of reads from INPUT and OUTPUT (for debugging purposes.)",
optional=true)
public boolean WRITE_READS_FILES
protected int doWork()
CommandLineProgramdoWork in class CommandLineProgramprotected String[] customCommandLineValidation()
CommandLineProgramcustomCommandLineValidation in class CommandLineProgram