Package htsjdk.samtools.filter
Class AbstractJavascriptFilter<HEADER,TYPE>
java.lang.Object
htsjdk.samtools.filter.AbstractJavascriptFilter<HEADER,TYPE>
- Direct Known Subclasses:
JavascriptSamRecordFilter
,JavascriptVariantFilter
Javascript filter with HEADER type containing TYPE records. contains two
static method to get a SAM Read filter or a VariantFilter.
warning: tools, like galaxy, using this class are not safe because a script
can access the filesystem.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractJavascriptFilter
(File scriptFile, HEADER header) constructor using a java.io.File script, compiles the script, puts 'header' in the bindingsprotected
AbstractJavascriptFilter
(Reader scriptReader, HEADER header) Constructor, compiles script, put header in the bindingsprotected
AbstractJavascriptFilter
(String scriptExpression, HEADER header) constructor using a java.lang.String script, compiles the script, puts 'header' in the bindings -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Evaluates this predicate on the given argumentreturns key used for header bindingabstract String
returns key used for record binding
-
Field Details
-
DEFAULT_HEADER_KEY
- See Also:
-
bindings
javascript bindings
-
-
Constructor Details
-
AbstractJavascriptFilter
constructor using a java.io.File script, compiles the script, puts 'header' in the bindings- Throws:
IOException
-
AbstractJavascriptFilter
constructor using a java.lang.String script, compiles the script, puts 'header' in the bindings -
AbstractJavascriptFilter
Constructor, compiles script, put header in the bindings- Parameters:
scriptReader
- reader containing the script. will be closed.header
- the header to be injected in the javascript context
-
-
Method Details
-
getHeaderKey
returns key used for header binding -
getRecordKey
returns key used for record binding -
accept
Evaluates this predicate on the given argument- Parameters:
record
- the record to test. It will be inject in the javascript context using getRecordKey()- Returns:
- true (keep) if the user script returned 1 or true, else false (reject).
-