# Spec BlastReportFileOut
FormattedFileOut abstraction for BlastReport

Extends | FormattedFileOut
All Extended | FormattedFile, FormattedFileOut
Defined in | <seqan/blast.h>
Signature | `template <typename TBlastIOContext = BlastIOContext<>> using BlastReportFileOut = FormattedFile<BlastReport, Output, TBlastIOContext>;`

## Member Function Overview

### Member Functions Inherited From FormattedFile

- `getFileExtensions`
- `operatorTDependentContext`

## Interface Function Overview

- `void writeFooter(blastReportOut);`
  Write the footer of a BlastReport.
- `void writeHeader(blastReportOut);`
  Write the header (top-most section) of a BlastReport file.
- `void writeRecord(blastReportOut, blastRecord);`
  write a BlastRecord including it's BlastMatches and possibly comment lines to a file.

### Interface Functions Inherited From FormattedFile

- `atEnd`
- `close`
- `context`
- `format`
- `FormattedFile`
- `getFileExtensions`
- `guessFormat`
- `open`
- `setFormat`

### Interface Functions Inherited From FormattedFileOut

- `writeHeader`
- `writeRecord`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From FormattedFile

- `FileFormat`
- `FormattedFileContext`

## Detailed Description

This is a FormattedFile specialization for writing BlastReport formats. For details on how to influence the writing of files, see BlastIOContext. Please note that you have to specify the type of the context as a template parameter to BlastReportFileOut.

### Overview

- open BlastReportFileOut,
- 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.

## See Also

- BlastRecord

## Interface Functions Detail

### `void writeFooter(blastReportOut);`

Write the footer of a BlastReport.

#### Parameters

`blastReportOut` | A BlastReportFileOut formattedFile.

#### Thrown Exceptions

`IOError` | On low-level I/O errors.

#### Data Races

Thread safety unknown!

#### See Also

- BlastIOContext
- BlastRecord

### `void writeHeader(blastReportOut);`

Write the header (top-most section) of a BlastReport file.

#### Parameters

`blastReportOut` | A BlastReportFileOut formattedFile.

#### Thrown Exceptions

`IOError` | On low-level I/O errors.

#### Data Races

Thread safety unknown!

#### See Also

- BlastIOContext
- BlastRecord

### `void writeRecord(blastReportOut, blastRecord);`

write a BlastRecord including it's BlastMatches and possibly comment lines to a file.

#### Parameters

`blastReportOut` | A BlastReportFileOut formattedFile.
`blastRecord` | The BlastRecord you wish to print.

#### Remarks

Modifiy the formattedFile's BlastIOContext to set some properties of the output, like the versionString or dbName.

#### Thrown Exceptions

`IOError` | On low-level I/O errors.

#### Data Races

Thread safety unknown!

#### See Also

- BlastIOContext
- BlastRecord

#### Dox Sources

    /*!
     * @class BlastReportFileOut
     *
     * @extends FormattedFileOut
     *
     * @headerfile <seqan/blast.h>
     *
     * @brief FormattedFileOut abstraction for @link BlastReport @endlink
     *
     * @signature template <typename TBlastIOContext = BlastIOContext<>> using
     *            BlastReportFileOut = FormattedFile<BlastReport, Output,
     *            TBlastIOContext>;
     *
     * This is a @link FormattedFile @endlink specialization for writing @link
     * BlastReport @endlink formats. For details on how to influence the writing of
     * files, see @link BlastIOContext @endlink. Please note that you have to
     * specify the type of the context as a template parameter to
     * BlastReportFileOut.
     *
     * @section Overview
     *
     * <ul> <li> open @link BlastReportFileOut @endlink,</li> <li> configure the
     * @link BlastIOContext @endlink </li> <li> @link BlastReportFileOut#writeHeader
     * @endlink </li> <li> @link BlastReportFileOut#writeRecord @endlink repeated up
     * to n times</li> <li> @link BlastReportFileOut#writeFooter @endlink </li>
     * </ul>
     *
     * The following members of the context have to be defined before writing: <ul>
     * <li> @link BlastIOContext::blastProgram @endlink (unless fixed at compile-
     * time)</li> <li> @link BlastIOContext::scoringScheme @endlink</li> <li> @link
     * BlastIOContext::dbName @endlink</li> <li> @link BlastIOContext::dbTotalLength
     * @endlink</li> <li> @link BlastIOContext::dbNumberOfSeqs @endlink</li> </ul>
     *
     * For a detailed example have a look at the <a
     * href="http://seqan.readthedocs.io/en/develop/Tutorial/BlastIO.html">Blast IO
     * tutorial</a>.
     *
     * @see BlastRecord
     *
     * @fn BlastReportFileOut#writeRecord
     *
     * @headerfile seqan/blast.h
     *
     * @brief write a @link BlastRecord @endlink including it's @link BlastMatch
     *        @endlinkes and possibly comment lines to a file.
     *
     * @signature void writeRecord(blastReportOut, blastRecord);
     *
     * @param[in,out] blastReportOut A @link BlastReportFileOut @endlink
     *                               formattedFile.
     * @param[in] blastRecord The @link BlastRecord @endlink you wish to print.
     *
     * @throw IOError On low-level I/O errors.
     *
     * @section Remarks
     *
     * Modifiy the formattedFile's @link BlastIOContext @endlink to set some
     * properties of the output, like the @link BlastIOContext::versionString
     * @endlink or @link BlastIOContext::dbName @endlink.
     *
     * @see BlastRecord
     * @see BlastIOContext
     *
     * @fn BlastReportFileOut#writeHeader
     *
     * @headerfile seqan/blast.h
     *
     * @brief Write the header (top-most section) of a BlastReport file.
     *
     * @signature void writeHeader(blastReportOut);
     *
     * @param[in,out] blastReportOut A @link BlastReportFileOut @endlink
     *                               formattedFile.
     *
     * @throw IOError On low-level I/O errors.
     *
     * @see BlastRecord
     * @see BlastIOContext
     *
     * @fn BlastReportFileOut#writeFooter
     *
     * @headerfile seqan/blast.h
     *
     * @brief Write the footer of a BlastReport.
     *
     * @signature void writeFooter(blastReportOut);
     *
     * @param[in,out] blastReportOut A @link BlastReportFileOut @endlink
     *                               formattedFile.
     *
     * @throw IOError On low-level I/O errors.
     *
     * @see BlastRecord
     * @see BlastIOContext
     */