Package org.snpsift.annotate.mem.variantTypeCounter

# Class VariantTypeCounter

java.lang.Object
org.snpsift.annotate.mem.variantTypeCounter.VariantTypeCounter

All Implemented Interfaces:
  `Serializable`

public class VariantTypeCounter extends Object implements Serializable
Count different types of variants These statistics are used to create data sets

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ALT`
`protected int[]`
`countByCategory`
`protected long`
`countVariants`
`protected long`
`countVcfEntries`
`protected Fields`
`fields`
`protected String[]`
`fieldsString`
`static final String`
`REF`
`protected Map<String,int[]>`
`sizesByField`

## Constructor Summary

Constructors
Constructor
Description
`VariantTypeCounter(Fields fields)`

## Method Summary

Modifier and Type
Method
Description
`void`
`count(org.snpeff.vcf.VcfEntry vcfEntry)`
Count the number of variants in a VCF file
`static VariantTypeCounter`
`countVariants(String vcfLines)`
Count variants in a string of VCF lines (i.e.
`int`
`getCount(VariantCategory variantCategory)`
`int[]`
`getCountByCategory()`
`Fields`
`getFields()`
`int`
`getSize(VariantCategory variantCategory, String field)`
Get total size (in bytes) of a field (only string fields)
`Map<String,int[]>`
`getSizesByField()`
`String`
`toString()`
`protected void`
`updateSizes(VariantCategory variantCategory, String field, String value)`
Update sizes for a field

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

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

## Field Details

### REF

public static final String REF

See Also:
  - Constant Field Values

### ALT

public static final String ALT

See Also:
  - Constant Field Values

### fields

protected Fields fields

### fieldsString

protected String[] fieldsString

### countByCategory

protected int[] countByCategory

### countVcfEntries

protected long countVcfEntries

### countVariants

protected long countVariants

### sizesByField

protected Map<String,int[]> sizesByField

## Constructor Details

### VariantTypeCounter

public VariantTypeCounter(Fields fields)

## Method Details

### countVariants

public static VariantTypeCounter countVariants(String vcfLines)
Count variants in a string of VCF lines (i.e. a VCF file contents in a string) This is used for testing

### count

public void count(org.snpeff.vcf.VcfEntry vcfEntry)
Count the number of variants in a VCF file

### getCount

public int getCount(VariantCategory variantCategory)

### getCountByCategory

public int[] getCountByCategory()

### getFields

public Fields getFields()

### getSize

public int getSize(VariantCategory variantCategory, String field)
Get total size (in bytes) of a field (only string fields)

Returns:
  Total size (in bytes) or -1 if the field is not found

### getSizesByField

public Map<String,int[]> getSizesByField()

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### updateSizes

protected void updateSizes(VariantCategory variantCategory, String field, String value)
Update sizes for a field