Package htsjdk.variant.vcf

# Class VCF3Codec

java.lang.Object
htsjdk.tribble.AbstractFeatureCodec<VariantContext,LineIterator>
htsjdk.tribble.AsciiFeatureCodec<VariantContext>
htsjdk.variant.vcf.AbstractVCFCodec
htsjdk.variant.vcf.VCF3Codec

All Implemented Interfaces:
  `FeatureCodec<VariantContext,LineIterator>`, `NameAwareCodec`

public class VCF3Codec extends AbstractVCFCodec
A feature codec for the VCF3 specification, to read older VCF files. VCF3 has been depreciated in favor of VCF4 (See VCF codec for the latest information)

Reads historical VCF3 encoded files (1000 Genomes Pilot results, for example)

See also: @see VCF specification
See also: @see VCF spec. publication

Since:
  2010

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`VCF3_MAGIC_HEADER`

### Fields inherited from class htsjdk.variant.vcf.AbstractVCFCodec

`alleleMap, doOnTheFlyModifications, filterHash, genotypeParts, header, lineNo, locParts, MAX_ALLELE_SIZE_BEFORE_WARNING, name, NUM_STANDARD_FIELDS, parts, remappedSampleName, stringCache, validate, version, warnedAboutNoEqualsForNonFlag`

## Constructor Summary

Constructors
Constructor
Description
`VCF3Codec()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canDecode(String potentialInput)`
This function returns true iff the File potentialInput can be parsed by this codec.
`protected List<String>`
`parseFilters(String filterString)`
parse the filter string, first checking to see if we already have parsed it in a previous attempt
`Object`
`readActualHeader(LineIterator reader)`
Read and return the header, or null if there is no header.

### Methods inherited from class htsjdk.variant.vcf.AbstractVCFCodec

`canDecodeFile, createGenotypeMap, decode, decodeLoc, disableOnTheFlyModifications, generateException, generateException, getAltHeaderLine, getCachedString, getHeader, getMetaHeaderLine, getName, getPedigreeHeaderLine, getSampleHeaderLine, getTabixFormat, getVersion, oneAllele, parseAlleles, parseGenotypeAlleles, parseHeaderFromLines, parseQual, setName, setRemappedSampleName, setVCFHeader`

### Methods inherited from class htsjdk.tribble.AsciiFeatureCodec

`close, decode, isDone, makeIndexableSourceFromStream, makeSourceFromStream, readHeader`

### Methods inherited from class htsjdk.tribble.AbstractFeatureCodec

`decodeLoc, getFeatureType`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface htsjdk.tribble.FeatureCodec

`getPathToDataFile`

## Field Details

### VCF3_MAGIC_HEADER

public static final String VCF3_MAGIC_HEADER

See Also:
  - Constant Field Values

## Constructor Details

### VCF3Codec

public VCF3Codec()

## Method Details

### readActualHeader

public Object readActualHeader(LineIterator reader)
Description copied from class: `AsciiFeatureCodec`
Read and return the header, or null if there is no header.

Specified by:
  `readActualHeader` in class `AsciiFeatureCodec<VariantContext>`
Parameters:
  `reader` - the line reader to take header lines from
Returns:
  the number of header lines

### parseFilters

protected List<String> parseFilters(String filterString)
parse the filter string, first checking to see if we already have parsed it in a previous attempt

Specified by:
  `parseFilters` in class `AbstractVCFCodec`
Parameters:
  `filterString` - the string to parse
Returns:
  a set of the filters applied

### canDecode

public boolean canDecode(String potentialInput)
Description copied from interface: `FeatureCodec`

This function returns true iff the File potentialInput can be parsed by this codec. Note that checking the file's extension is a perfectly acceptable implementation of this method and file contents only rarely need to be checked.

There is an assumption that there's never a situation where two different Codecs return true for the same file. If this occurs, the recommendation would be to error out.

Note this function must never throw an error. All errors should be trapped and false returned.

Parameters:
  `potentialInput` - the file to test for parsability with this codec
Returns:
  true if potentialInput can be parsed, false otherwise