VcfRecord - SeqAn API Documentation

# Class VcfRecord
Information for one VCF record.

Implements | FormattedFileRecordConcept
All Impl'd | AssignableConcept, CopyConstructibleConcept, DefaultConstructibleConcept, FormattedFileRecordConcept
Defined in | <seqan/vcf_io.h>
Signature | `class VcfRecord;`

## Member Function Overview

- `float VcfRecord::MISSING_QUAL();`
  Return IEEE `NaN` float value.
- `VcfRecord::VcfRecord();`
  Default constructor.

### Member Functions Inherited From AssignableConcept

- `operator=`

## Interface Function Overview

- `void clear(record);`
  Clear a VcfRecord.

### Interface Functions Inherited From AssignableConcept

- `assign`
- `set`
- `move`

## Member Variable Overview

- `VariableType VcfRecord::alt`
  Alternative bases in the variants, comma-separated if multiple (CharString).
- `VariableType VcfRecord::beginPos`
  Position of the VCF record (`int32_t`).
- `VariableType VcfRecord::filter`
  Value of FILTER field, empty if "." in VCF file (CharString).
- `VariableType VcfRecord::format`
  Value of the VCF FORMAT field, empty if "." in VCF file (CharString).
- `VariableType VcfRecord::genotypeInfos`
  Genotype information, as in VCF file (StringSet<CharString>).
- `VariableType VcfRecord::id`
  Textual identifier of the variant (CharString).
- `VariableType VcfRecord::info`
  Value of the INFO field, empty if "." in VCF file (CharString).
- `VariableType VcfRecord::INVALID_POS`
  Static member as marker for invalid position (`int32_t`)
- `VariableType VcfRecord::INVALID_REFID`
  Static member as marker for invalid reference (`int32_t`)
- `VariableType VcfRecord::qual`
  Quality, `NaN` if invalid (`float`).
- `VariableType VcfRecord::ref`
  Bases in the reference (CharString).
- `VariableType VcfRecord::rID`
  Static member as marker for invalid reference (`int32_t`)

## Detailed Description

We store most information as strings and without structure since the VCF format's definition is quite loose. We plan to provide classes for structured access to these strings later.

### Remarks

Although all positions in the VCF text format are 1-based, they are stored 0-based in the VcfRecord. Positions in string members are stored verbatim in the VcfRecord's members, e.g. 1-based.

Invalid qualities are stored as a float `NaN` (not a number). To test a float quality `q` for being `NaN`, test for `q != q`. Only `NaN` has the property that `NaN != NaN`.

## Member Functions Detail

### `float VcfRecord::MISSING_QUAL();`

Return IEEE `NaN` float value.

#### Remarks

This cannot be implemented portably as a constant in a header-only library. In C++11, there is a function `std::nanf()` that could be used instead. For C++98, this is the best we can do.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `VcfRecord::VcfRecord();`

Default constructor.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## Interface Functions Detail

### `void clear(record);`

Clear a VcfRecord.

#### Parameters

`record` | The VcfRecord to clear.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## Member Variables Detail

### `VariableType VcfRecord::alt`

Alternative bases in the variants, comma-separated if multiple (CharString).

### `VariableType VcfRecord::beginPos`

Position of the VCF record (`int32_t`).

### `VariableType VcfRecord::filter`

Value of FILTER field, empty if "." in VCF file (CharString).

### `VariableType VcfRecord::format`

Value of the VCF FORMAT field, empty if "." in VCF file (CharString).

### `VariableType VcfRecord::genotypeInfos`

Genotype information, as in VCF file (StringSet<CharString>).

### `VariableType VcfRecord::id`

Textual identifier of the variant (CharString).

### `VariableType VcfRecord::info`

Value of the INFO field, empty if "." in VCF file (CharString).

### `VariableType VcfRecord::INVALID_POS`

Static member as marker for invalid position (`int32_t`)

### `VariableType VcfRecord::INVALID_REFID`

Static member as marker for invalid reference (`int32_t`)

### `VariableType VcfRecord::qual`

Quality, `NaN` if invalid (`float`).

### `VariableType VcfRecord::ref`

Bases in the reference (CharString).

### `VariableType VcfRecord::rID`

Static member as marker for invalid reference (`int32_t`)

#### Dox Sources

    /*!
     * @class VcfRecord
     *
     * @implements FormattedFileRecordConcept
     *
     * @headerfile <seqan/vcf_io.h>
     *
     * @brief Information for one VCF record.
     *
     * @signature class VcfRecord;
     *
     * We store most information as strings and without structure since the VCF
     * format's definition is quite loose. We plan to provide classes for structured
     * access to these strings later.
     *
     * @section Remarks
     *
     * Although all positions in the VCF text format are 1-based, they are stored
     * 0-based in the @link VcfRecord @endlink. Positions in string members are
     * stored verbatim in the @link VcfRecord @endlink's members, e.g. 1-based.
     *
     * Invalid qualities are stored as a float <tt>NaN</tt> (not a number). To test
     * a float quality <tt>q</tt> for being <tt>NaN</tt>, test for <tt>q != q</tt>.
     * Only <tt>NaN</tt> has the property that <tt>NaN != NaN</tt>.
     *
     * @fn VcfRecord::MISSING_QUAL
     *
     * @brief Return IEEE <tt>NaN</tt> float value.
     *
     * @signature float VcfRecord::MISSING_QUAL();
     *
     * @section Remarks
     *
     * This cannot be implemented portably as a constant in a header-only library.
     * In C++11, there is a function <tt>std::nanf()</tt> that could be used
     * instead. For C++98, this is the best we can do.
     *
     * @fn VcfRecord::VcfRecord
     *
     * @brief Default constructor.
     *
     * @signature VcfRecord::VcfRecord();
     *
     * @fn VcfRecord#clear
     *
     * @brief Clear a VcfRecord.
     *
     * @signature void clear(record);
     *
     * @param[in,out] record The VcfRecord to clear.
     *
     * @var VariableType VcfRecord::ref;
     *
     * @brief Bases in the reference (@link CharString @endlink).
     *
     * @var VariableType VcfRecord::genotypeInfos;
     *
     * @brief Genotype information, as in VCF file (@link StringSet @endlink<@link
     *        CharString @endlink>).
     *
     * @var VariableType VcfRecord::info;
     *
     * @brief Value of the INFO field, empty if "." in VCF file (@link CharString
     *        @endlink).
     *
     * @var VariableType VcfRecord::INVALID_REFID;
     *
     * @brief Static member as marker for invalid reference (<tt>int32_t</tt>)
     *
     * @var VariableType VcfRecord::format;
     *
     * @brief Value of the VCF FORMAT field, empty if "." in VCF file (@link
     *        CharString @endlink).
     *
     * @var VariableType VcfRecord::alt;
     *
     * @brief Alternative bases in the variants, comma-separated if multiple (@link
     *        CharString @endlink).
     *
     * @var VariableType VcfRecord::qual;
     *
     * @brief Quality, <tt>NaN</tt> if invalid (<tt>float</tt>).
     *
     * @var VariableType VcfRecord::filter;
     *
     * @brief Value of FILTER field, empty if "." in VCF file (@link CharString
     *        @endlink).
     *
     * @var VariableType VcfRecord::rID;
     *
     * @brief Static member as marker for invalid reference (<tt>int32_t</tt>)
     *
     * @var VariableType VcfRecord::beginPos;
     *
     * @brief Position of the VCF record (<tt>int32_t</tt>).
     *
     * @var VariableType VcfRecord::INVALID_POS;
     *
     * @brief Static member as marker for invalid position (<tt>int32_t</tt>)
     *
     * @var VariableType VcfRecord::id;
     *
     * @brief Textual identifier of the variant (@link CharString @endlink).
     */