Split FASTA formatted text content or files
Fields inherited from class | Fields |
---|---|
class AbstractTextSplitter |
charset, collectName, collectPath, fileMode |
class AbstractSplitter |
autoClose, closure, count, decompress, elem, fOptionsMap, into, limit, operatorName, recordFields, recordMode, sourceFile |
Type Params | Return Type | Name and description |
---|---|---|
|
protected java.lang.Object |
fetchRecord(java.io.BufferedReader reader) |
|
static java.lang.Object |
parseFastaRecord(java.lang.CharSequence fasta, java.util.Map record) Parse a CharSequence as a FASTA formatted text, retuning a Map object
containing the fields as specified by the @{code record} parameter. |
|
protected java.lang.Object |
process(java.io.Reader targetObject) |
|
protected java.util.Map<java.lang.String, java.lang.Object> |
validOptions() |
Methods inherited from class | Name |
---|---|
class AbstractTextSplitter |
createCollector, fetchRecord, getCacheableOptions, getCharset, isCollectorEnabled, newReader, normalizeSource, options, process, processChunk, validOptions, wrapReader |
class AbstractSplitter |
append, apply, channel, count, createCollector, each, getCollector, getCount, getInto, getOperatorName, getRecordFields, getRecordMode, getTargetObj, isTrueOrMap, list, newInputStream, normalizeSource, options, process, resumeFromCache, setRecordFields, split, target, validOptions |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Parse a CharSequence
as a FASTA formatted text, retuning a Map
object
containing the fields as specified by the @{code record} parameter.
For example:
def fasta = ''' >5524211 cytochrome b [Elephas maximus maximus] LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV IENY/ '''.stripIndent() def record = fasta.parseFastaRecord( [ id: true, seq: true ] assert record.id == '5524211' assert record.sequence = 'LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLVIENY'
fasta
- The fasta formatted text to be parsedrecord
- The map object that is used to specify which fields are required to be returned in the result map.
The following field can be used:
id
The fasta ID
seq
The sequence string
desc
The description in the fasta header
header
The fasta header (first line including the '>' character)
text
The complete fasta text block
width
The width of the fasta formatted block.
string
The sequence is returned as single line string (w/o newline char)
hash
The hashCode of the entered FASTA sequence
uuid
A random UUID
id for this sequence