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.StringALT_NAMEprotected intaltIdxprotected intchromosomeIdxstatic java.lang.StringCOLUMN_CHR_NAMEstatic java.lang.StringCOLUMN_POS_NAME_v2static java.lang.StringCOLUMN_POS_NAME_v3static java.lang.StringCOLUMN_SEPARATORstatic java.lang.StringDATA_TYPES_CACHE_EXTstatic intDATA_TYPES_MAX_LINESstatic intDATA_TYPES_MIN_LINESprotected booleandebugprotected java.lang.String[]fieldNamesprotected java.lang.StringfileNameprotected org.snpeff.interval.Genomegenomestatic java.lang.StringHEADER_PREFIXprotected java.util.List<DbNsfpEntry>latestResultsprotected org.snpeff.interval.MarkerlatestResultsIntervalprotected intmaxChrPosRefAltIdxprotected boolean[]multipleValuesprotected java.util.HashMap<java.lang.String,java.lang.Integer>names2indexstatic java.lang.StringREF_NAMEprotected intrefIdxprotected intstartIdxstatic java.lang.StringSUBFIELD_SEPARATORstatic java.lang.StringSUBFIELD_SEPARATOR_2static charSUBFIELD_SEPARATOR_CHARstatic charSUBFIELD_SEPARATOR_CHAR_2protected htsjdk.tribble.readers.TabixReadertabixReaderprotected org.snpeff.vcf.VcfInfoType[]typesprotected booleanverbose
-
Constructor Summary
Constructors Constructor Description DbNsfp(java.lang.String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close database, free resourcesprotected booleandataTypes()Guess field types: Read many lines and guess the data type for each columnvoidforceMissingTypesAsString()Force missing types as stringintgetAltIdx()org.snpeff.interval.ChromosomegetChromosome(java.lang.String chromoName)Find chromosome 'chromoName'.intgetChromosomeIdx()intgetChrPosRefAltIdx()intgetFieldCount()java.lang.StringgetFieldName(int idx)java.util.Set<java.lang.String>getFieldNames()java.lang.String[]getFieldNamesSorted()intgetIndex(java.lang.String name)java.util.HashMap<java.lang.String,java.lang.Integer>getNames2index()intgetRefIdx()intgetStartIdx()org.snpeff.vcf.VcfInfoType[]getTypes()protected org.snpeff.vcf.VcfInfoTypeguessDataType(java.lang.String value)Guess value typeprotected booleanguessDataTypes()Guess data types from filebooleanhasField(java.lang.String filedName)Do we have a column 'colName'?protected booleaninitTabix(java.lang.String fileName)Initialize tabix readerprotected booleanmatch(org.snpeff.interval.Variant var, DbNsfpEntry dbEntry)Does database entry 'DbNsfpEntry' match 'variant'?voidopen()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 voidsaveDataTypesCache(java.lang.String cacheFileName)Save data types to cache filevoidsetDebug(boolean debug)voidsetVerbose(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:DbMarkerClose database, free resources- Specified by:
closein 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:DbMarkerOpen database (load index in memory if required)- Specified by:
openin 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:
queryin 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:
setDebugin interfaceDbMarker<org.snpeff.interval.Variant,DbNsfpEntry>
-
setVerbose
public void setVerbose(boolean verbose)
- Specified by:
setVerbosein interfaceDbMarker<org.snpeff.interval.Variant,DbNsfpEntry>
-
-