Spec
BlastTabularFileOutFormattedFileOut abstraction for BlastTabular
Extends | FormattedFileOut |
---|---|
All Extended | FormattedFile, FormattedFileOut |
Defined in | <seqan/blast.h> |
Signature |
template <typename TBlastIOContext>
using BlastTabularFileOut = FormattedFile<BlastTabular, Output, TBlastIOContext>;
|
Member Function Overview
Member Functions Inherited From FormattedFile
Interface Function Overview
-
void writeFooter(blastTabularOut);
Write the footer of a BlastTabular file. -
void writeHeader(blastTabularOut);
Write the header (top-most section) of a BlastTabular file (this is a NOOP). -
void writeRecord(blastTabularOut, blastRecord);
Write a BlastRecord including it's BlastMatches and possible comment lines to a file.
Interface Functions Inherited From FormattedFile
Interface Functions Inherited From FormattedFileOut
Interface Metafunction Overview
Interface Metafunctions Inherited From FormattedFile
Detailed Description
This is a FormattedFile specialization for writing BlastTabular formats. For details on how to influence the writing of files and how to differentiate between the tabular format with and without comment lines, see BlastIOContext. Please note that you have to specify the type of the context as a template parameter to BlastTabularFileOut, see the example below.
Overview
- open BlastTabularFileOut,
- configure the BlastIOContext
- writeHeader
- writeRecord repeated up to n times
- writeFooter
The following members of the context have to be defined before writing:
- blastProgram (unless fixed at compile-time)
- scoringScheme
- dbName
- dbTotalLength
- dbNumberOfSeqs
For a detailed example have a look at the Blast IO tutorial.
Strictly speaking the writeHeader() call is not required for BlastTabular, but for consistency with other (blast) formats and the read interface it is recommended.
See Also
Interface Functions Detail
void writeFooter(blastTabularOut);
Parameters
blastTabularOut
|
A BlastTabularFileOut formattedFile. |
---|
Thrown Exceptions
IOError |
On low-level I/O errors. |
---|
Data Races
See Also
void writeHeader(blastTabularOut);
Parameters
blastTabularOut
|
A BlastTabularFileOut formattedFile. |
---|
Thrown Exceptions
IOError |
On low-level I/O errors. |
---|
Data Races
See Also
void writeRecord(blastTabularOut, blastRecord);
Parameters
blastTabularOut
|
A BlastTabularFileOut formattedFile. |
---|---|
blastRecord
|
The BlastRecord you wish to print. |
Remarks
This function first writes the comment lines of the record and then writes match lines for every match in it. If the context's tabularSpec is set to BlastTabularSpec::NO_COMMENTS, no comment lines will be written and this function immediately prints the match lines.
Comment lines
The contents of the comment lines is largely defined by the members of the context.
If the context's versionString is set, this will be written, otherwise a stanadard version string is generated.
The context's dbName is printed as the database name / path.
If either the context's fields or fieldsAsStrings member are specified these will be printed as column labels. If both are specified than fieldsAsStrings is given preference. Please note that it is recommended to use fields and not fieldsAsStrings to stay "standards"-compliant. Also only fields has an influence on the values printed in the match lines.
Matches
Please note that BLAST is 1-indexed and considers the last position to be the back, not the end, i.e. last one included in a match/sequence/..., not the one behind it (as SeqAn does); this functions corrects for both of these bahaviours, so you don't have to. Additionally, based on the context's blastProgram, positions are transformed back to DNA space, if translation has taken place. Please note also that query and subject IDs are truncated at the first space character in NCBI BLAST, this is also done by default here.
By setting the context's fields meber you can specify which columns you wish to print (if you don't want defaults); the same conversions mentioned above will me made. See BlastMatchField::Enum for a list of fields available. If the context's legacy-flag is set (legacyFormat) the fields variable is ignored.
Many guides recommend always printing the default 12 columns and using only additional columns with additional (custom) data.
Thrown Exceptions
IOError |
On low-level I/O errors. |
---|