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 java.lang.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 java.lang.String
ALT_NAME
protected int
altIdx
protected int
chromosomeIdx
static java.lang.String
COLUMN_CHR_NAME
static java.lang.String
COLUMN_POS_NAME_v2
static java.lang.String
COLUMN_POS_NAME_v3
static java.lang.String
COLUMN_SEPARATOR
static java.lang.String
DATA_TYPES_CACHE_EXT
static int
DATA_TYPES_MAX_LINES
static int
DATA_TYPES_MIN_LINES
protected boolean
debug
protected java.lang.String[]
fieldNames
protected java.lang.String
fileName
protected org.snpeff.interval.Genome
genome
static java.lang.String
HEADER_PREFIX
protected java.util.List<DbNsfpEntry>
latestResults
protected org.snpeff.interval.Marker
latestResultsInterval
protected int
maxChrPosRefAltIdx
protected boolean[]
multipleValues
protected java.util.HashMap<java.lang.String,java.lang.Integer>
names2index
static java.lang.String
REF_NAME
protected int
refIdx
protected int
startIdx
static java.lang.String
SUBFIELD_SEPARATOR
static java.lang.String
SUBFIELD_SEPARATOR_2
static char
SUBFIELD_SEPARATOR_CHAR
static 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(java.lang.String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close database, free resourcesprotected boolean
dataTypes()
Guess field types: Read many lines and guess the data type for each columnvoid
forceMissingTypesAsString()
Force missing types as stringint
getAltIdx()
org.snpeff.interval.Chromosome
getChromosome(java.lang.String chromoName)
Find chromosome 'chromoName'.int
getChromosomeIdx()
int
getChrPosRefAltIdx()
int
getFieldCount()
java.lang.String
getFieldName(int idx)
java.util.Set<java.lang.String>
getFieldNames()
java.lang.String[]
getFieldNamesSorted()
int
getIndex(java.lang.String name)
java.util.HashMap<java.lang.String,java.lang.Integer>
getNames2index()
int
getRefIdx()
int
getStartIdx()
org.snpeff.vcf.VcfInfoType[]
getTypes()
protected org.snpeff.vcf.VcfInfoType
guessDataType(java.lang.String value)
Guess value typeprotected boolean
guessDataTypes()
Guess data types from fileboolean
hasField(java.lang.String filedName)
Do we have a column 'colName'?protected boolean
initTabix(java.lang.String fileName)
Initialize tabix readerprotected 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)java.util.Collection<DbNsfpEntry>
query(org.snpeff.interval.Variant variant)
Query tabix file to get dbNsfp entries (or cached entries from latest results)protected void
saveDataTypesCache(java.lang.String cacheFileName)
Save data types to cache filevoid
setDebug(boolean debug)
void
setVerbose(boolean verbose)
-
-
-
Field Detail
-
DATA_TYPES_CACHE_EXT
public static final java.lang.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 java.lang.String HEADER_PREFIX
- See Also:
- Constant Field Values
-
COLUMN_SEPARATOR
public static final java.lang.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 java.lang.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 java.lang.String SUBFIELD_SEPARATOR_2
- See Also:
- Constant Field Values
-
COLUMN_CHR_NAME
public static final java.lang.String COLUMN_CHR_NAME
- See Also:
- Constant Field Values
-
COLUMN_POS_NAME_v2
public static final java.lang.String COLUMN_POS_NAME_v2
- See Also:
- Constant Field Values
-
COLUMN_POS_NAME_v3
public static final java.lang.String COLUMN_POS_NAME_v3
- See Also:
- Constant Field Values
-
ALT_NAME
public static final java.lang.String ALT_NAME
- See Also:
- Constant Field Values
-
REF_NAME
public static final java.lang.String REF_NAME
- See Also:
- Constant Field Values
-
fileName
protected java.lang.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 java.lang.String[] fieldNames
-
types
protected org.snpeff.vcf.VcfInfoType[] types
-
genome
protected org.snpeff.interval.Genome genome
-
names2index
protected java.util.HashMap<java.lang.String,java.lang.Integer> names2index
-
tabixReader
protected htsjdk.tribble.readers.TabixReader tabixReader
-
latestResults
protected java.util.List<DbNsfpEntry> latestResults
-
latestResultsInterval
protected org.snpeff.interval.Marker latestResultsInterval
-
-
Method Detail
-
close
public void close()
Description copied from interface:DbMarker
Close database, free resources- Specified by:
close
in interfaceDbMarker<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(java.lang.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 java.lang.String getFieldName(int idx)
-
getFieldNames
public java.util.Set<java.lang.String> getFieldNames()
-
getFieldNamesSorted
public java.lang.String[] getFieldNamesSorted()
-
getIndex
public int getIndex(java.lang.String name)
-
getNames2index
public java.util.HashMap<java.lang.String,java.lang.Integer> getNames2index()
-
getRefIdx
public int getRefIdx()
-
getStartIdx
public int getStartIdx()
-
getTypes
public org.snpeff.vcf.VcfInfoType[] getTypes()
-
guessDataType
protected org.snpeff.vcf.VcfInfoType guessDataType(java.lang.String value)
Guess value type
-
guessDataTypes
protected boolean guessDataTypes()
Guess data types from file
-
hasField
public boolean hasField(java.lang.String filedName)
Do we have a column 'colName'?
-
initTabix
protected boolean initTabix(java.lang.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 interfaceDbMarker<org.snpeff.interval.Variant,DbNsfpEntry>
-
query
public java.util.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 interfaceDbMarker<org.snpeff.interval.Variant,DbNsfpEntry>
- Parameters:
variant
- : Variant to query in DnNSFP- Returns:
- A list of result
-
saveDataTypesCache
protected void saveDataTypesCache(java.lang.String cacheFileName)
Save data types to cache file
-
setDebug
public void setDebug(boolean debug)
- Specified by:
setDebug
in interfaceDbMarker<org.snpeff.interval.Variant,DbNsfpEntry>
-
setVerbose
public void setVerbose(boolean verbose)
- Specified by:
setVerbose
in interfaceDbMarker<org.snpeff.interval.Variant,DbNsfpEntry>
-
-