Package org.snpsift.fileIterator

# Class DbNsfp

java.lang.Object
org.snpsift.fileIterator.DbNsfp

All Implemented Interfaces:
  `DbMarker<org.snpeff.interval.Variant,DbNsfpEntry>`

public class DbNsfp extends Object implements DbMarker<org.snpeff.interval.Variant,DbNsfpEntry>
DbNSFP database: Reference https://sites.google.com/site/jpopgen/dbNSFP

Author:
  pcingola, lletourn (original author)

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ALT_NAME`
`protected int`
`altIdx`
`protected int`
`chromosomeIdx`
`static final String`
`COLUMN_CHR_NAME`
`static final String`
`COLUMN_POS_NAME_v2`
`static final String`
`COLUMN_POS_NAME_v3`
`static final String`
`COLUMN_SEPARATOR`
`static final String`
`DATA_TYPES_CACHE_EXT`
`static final int`
`DATA_TYPES_MAX_LINES`
`static final int`
`DATA_TYPES_MIN_LINES`
`protected boolean`
`debug`
`protected String[]`
`fieldNames`
`protected String`
`fileName`
`protected org.snpeff.interval.Genome`
`genome`
`static final String`
`HEADER_PREFIX`
`protected List<DbNsfpEntry>`
`latestResults`
`protected org.snpeff.interval.Marker`
`latestResultsInterval`
`protected int`
`maxChrPosRefAltIdx`
`protected boolean[]`
`multipleValues`
`protected HashMap<String,Integer>`
`names2index`
`static final String`
`REF_NAME`
`protected int`
`refIdx`
`protected int`
`startIdx`
`static final String`
`SUBFIELD_SEPARATOR`
`static final String`
`SUBFIELD_SEPARATOR_2`
`static final char`
`SUBFIELD_SEPARATOR_CHAR`
`static final char`
`SUBFIELD_SEPARATOR_CHAR_2`
`protected htsjdk.tribble.readers.TabixReader`
`tabixReader`
`protected org.snpeff.vcf.VcfInfoType[]`
`types`
`protected boolean`
`verbose`

## Constructor Summary

Constructors
Constructor
Description
`DbNsfp(String fileName)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Close database, free resources
`protected boolean`
`dataTypes()`
Guess field types: Read many lines and guess the data type for each column
`void`
`forceMissingTypesAsString()`
Force missing types as string
`int`
`getAltIdx()`
`org.snpeff.interval.Chromosome`
`getChromosome(String chromoName)`
Find chromosome 'chromoName'.
`int`
`getChromosomeIdx()`
`int`
`getChrPosRefAltIdx()`
`int`
`getFieldCount()`
`String`
`getFieldName(int idx)`
`Set<String>`
`getFieldNames()`
`String[]`
`getFieldNamesSorted()`
`int`
`getIndex(String name)`
`HashMap<String,Integer>`
`getNames2index()`
`int`
`getRefIdx()`
`int`
`getStartIdx()`
`org.snpeff.vcf.VcfInfoType[]`
`getTypes()`
`protected org.snpeff.vcf.VcfInfoType`
`guessDataType(String value)`
Guess value type
`protected boolean`
`guessDataTypes()`
Guess data types from file
`boolean`
`hasField(String filedName)`
Do we have a column 'colName'?
`protected boolean`
`initTabix(String fileName)`
Initialize tabix reader
`protected boolean`
`match(org.snpeff.interval.Variant var, DbNsfpEntry dbEntry)`
Does database entry 'DbNsfpEntry' match 'variant'?
`void`
`open()`
Open database (load index in memory if required)
`Collection<DbNsfpEntry>`
`query(org.snpeff.interval.Variant variant)`
Query tabix file to get dbNsfp entries (or cached entries from latest results)
`protected void`
`saveDataTypesCache(String cacheFileName)`
Save data types to cache file
`void`
`setDebug(boolean debug)`
`void`
`setVerbose(boolean verbose)`

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

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

## Field Details

### DATA_TYPES_CACHE_EXT

public static final String DATA_TYPES_CACHE_EXT

See Also:
  - Constant Field Values

### DATA_TYPES_MIN_LINES

public static final int DATA_TYPES_MIN_LINES

See Also:
  - Constant Field Values

### DATA_TYPES_MAX_LINES

public static final int DATA_TYPES_MAX_LINES

See Also:
  - Constant Field Values

### HEADER_PREFIX

public static final String HEADER_PREFIX

See Also:
  - Constant Field Values

### COLUMN_SEPARATOR

public static final String COLUMN_SEPARATOR

See Also:
  - Constant Field Values

### SUBFIELD_SEPARATOR_CHAR

public static final char SUBFIELD_SEPARATOR_CHAR

See Also:
  - Constant Field Values

### SUBFIELD_SEPARATOR

public static final String SUBFIELD_SEPARATOR

See Also:
  - Constant Field Values

### SUBFIELD_SEPARATOR_CHAR_2

public static final char SUBFIELD_SEPARATOR_CHAR_2

See Also:
  - Constant Field Values

### SUBFIELD_SEPARATOR_2

public static final String SUBFIELD_SEPARATOR_2

See Also:
  - Constant Field Values

### COLUMN_CHR_NAME

public static final String COLUMN_CHR_NAME

See Also:
  - Constant Field Values

### COLUMN_POS_NAME_v2

public static final String COLUMN_POS_NAME_v2

See Also:
  - Constant Field Values

### COLUMN_POS_NAME_v3

public static final String COLUMN_POS_NAME_v3

See Also:
  - Constant Field Values

### ALT_NAME

public static final String ALT_NAME

See Also:
  - Constant Field Values

### REF_NAME

public static final String REF_NAME

See Also:
  - Constant Field Values

### fileName

protected String fileName

### debug

protected boolean debug

### multipleValues

protected boolean[] multipleValues

### verbose

protected boolean verbose

### chromosomeIdx

protected int chromosomeIdx

### startIdx

protected int startIdx

### altIdx

protected int altIdx

### refIdx

protected int refIdx

### maxChrPosRefAltIdx

protected int maxChrPosRefAltIdx

### fieldNames

protected String[] fieldNames

### types

protected org.snpeff.vcf.VcfInfoType[] types

### genome

protected org.snpeff.interval.Genome genome

### names2index

protected HashMap<String,Integer> names2index

### tabixReader

protected htsjdk.tribble.readers.TabixReader tabixReader

### latestResults

protected List<DbNsfpEntry> latestResults

### latestResultsInterval

protected org.snpeff.interval.Marker latestResultsInterval

## Constructor Details

### DbNsfp

public DbNsfp(String fileName)

## Method Details

### close

public void close()
Description copied from interface: `DbMarker`
Close database, free resources

Specified by:
  `close` in interface `DbMarker<org.snpeff.interval.Variant,DbNsfpEntry>`

### dataTypes

protected boolean dataTypes()
Guess field types: Read many lines and guess the data type for each column

### forceMissingTypesAsString

public void forceMissingTypesAsString()
Force missing types as string

### getAltIdx

public int getAltIdx()

### getChrPosRefAltIdx

public int getChrPosRefAltIdx()

### getChromosome

public org.snpeff.interval.Chromosome getChromosome(String chromoName)
Find chromosome 'chromoName'. If it does not exists and 'createChromos' is true, the chromosome is created

### getChromosomeIdx

public int getChromosomeIdx()

### getFieldCount

public int getFieldCount()

### getFieldName

public String getFieldName(int idx)

### getFieldNames

public Set<String> getFieldNames()

### getFieldNamesSorted

public String[] getFieldNamesSorted()

### getIndex

public int getIndex(String name)

### getNames2index

public HashMap<String,Integer> getNames2index()

### getRefIdx

public int getRefIdx()

### getStartIdx

public int getStartIdx()

### getTypes

public org.snpeff.vcf.VcfInfoType[] getTypes()

### guessDataType

protected org.snpeff.vcf.VcfInfoType guessDataType(String value)
Guess value type

### guessDataTypes

protected boolean guessDataTypes()
Guess data types from file

### hasField

public boolean hasField(String filedName)
Do we have a column 'colName'?

### initTabix

protected boolean initTabix(String fileName)
Initialize tabix reader

### match

protected boolean match(org.snpeff.interval.Variant var, DbNsfpEntry dbEntry)
Does database entry 'DbNsfpEntry' match 'variant'?

### open

public void open()
Description copied from interface: `DbMarker`
Open database (load index in memory if required)

Specified by:
  `open` in interface `DbMarker<org.snpeff.interval.Variant,DbNsfpEntry>`

### query

public Collection<DbNsfpEntry> query(org.snpeff.interval.Variant variant)
Query tabix file to get dbNsfp entries (or cached entries from latest results)

Specified by:
  `query` in interface `DbMarker<org.snpeff.interval.Variant,DbNsfpEntry>`
Parameters:
  `variant` - : Variant to query in DnNSFP
Returns:
  A list of result

### saveDataTypesCache

protected void saveDataTypesCache(String cacheFileName)
Save data types to cache file

### setDebug

public void setDebug(boolean debug)

Specified by:
  `setDebug` in interface `DbMarker<org.snpeff.interval.Variant,DbNsfpEntry>`

### setVerbose

public void setVerbose(boolean verbose)

Specified by:
  `setVerbose` in interface `DbMarker<org.snpeff.interval.Variant,DbNsfpEntry>`