Package org.snpeff.snpEffect

# Class SnpEffectPredictor

java.lang.Object
org.snpeff.snpEffect.SnpEffectPredictor

All Implemented Interfaces:
  `Serializable`

public class SnpEffectPredictor extends Object implements Serializable
Predicts effects of SNPs

Note: Actually tries to predict any kind of SeqChange, not only SNPs . It is called SnpEffectPredictor for 'historical reasons'.

Author:
  pcingola
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`DEFAULT_UP_DOWN_LENGTH`
`static final int`
`SMALL_VARIANT_SIZE_THRESHOLD`

## Constructor Summary

Constructors
Constructor
Description
`SnpEffectPredictor(Genome genome)`

## Method Summary

Modifier and Type
Method
Description
`void`
`add(Gene gene)`
Add a gene interval
`void`
`add(Marker marker)`
Add a marker
`void`
`addAll(Markers markersToAdd)`
Add a set of markers
`void`
`buildForest()`
Create interval trees (forest)
`int`
`countTranscripts()`
Count number of transcripts
`Markers`
`createGenomicRegions()`
Create (and add) up-down stream, splice sites, intergenic, etc
`void`
`filterTags(Set<String> tags, Set<String> tagsNo)`
Filter transcripts by tags
`void`
`filterTranscriptSupportLevel(TranscriptSupportLevel maxTsl)`
Filter transcripts by TSL
`Gene`
`getGene(String geneId)`
Obtain a gene by geneId
`Genome`
`getGenome()`
`IntervalForest`
`getIntervalForest()`
`Markers`
`getMarkers()`
`int`
`getSpliceRegionExonSize()`
`int`
`getSpliceRegionIntronMax()`
`int`
`getSpliceRegionIntronMin()`
`Transcript`
`getTranscript(String trId)`
`int`
`getUpDownStreamLength()`
`int`
`keepTranscriptsProteinCoding()`
Remove all transcripts that are NOT in the list
`static SnpEffectPredictor`
`load(Config config)`
Load predictor from a binary file
`void`
`print()`
Dump to sdtout
`Markers`
`query(Marker marker)`
Return a collection of intervals that intersect 'marker'
`Gene`
`queryClosestGene(Marker inputInterval)`
Find closest gene to this marker
`Markers`
`queryDeep(Marker marker)`
Return a collection of intervals that intersect 'marker' Query resulting genes, transcripts and exons to get ALL types of intervals possible
`Set<String>`
`regions(Marker marker, boolean showGeneDetails, boolean compareTemplate)`
Name of the regions hit by a marker
`Set<String>`
`regions(Marker marker, boolean showGeneDetails, boolean compareTemplate, String id)`
Name of the regions hit by a marker
`void`
`removeNonCanonical(String canonFile)`
Remove all non-canonical transcripts If a file is provided, read "Gene => canonical_transcript" mapping from file
`boolean`
`removeUnverified()`
Remove all unverified transcripts
`int`
`retainAllTranscripts(Set<String> trIds)`
Remove all transcripts that are NOT in the list
`void`
`save(String fileName)`
Save predictor to a binary file
`void`
`save(Config config)`
Save predictor to a binary file (specified by the configuration)
`void`
`setDebug(boolean debug)`
`void`
`setSpliceRegionExonSize(int spliceRegionExonSize)`
`void`
`setSpliceRegionIntronMax(int spliceRegionIntronMax)`
`void`
`setSpliceRegionIntronMin(int spliceRegionIntronMin)`
`void`
`setSpliceSiteSize(int spliceSiteSize)`
`void`
`setUpDownStreamLength(int upDownStreamLength)`
`void`
`setUseChromosomes(boolean useChromosomes)`
`int`
`size()`
`String`
`toString()`
`VariantEffects`
`variantEffect(Variant variant)`
Predict the effect of a variant
`protected void`
`variantEffect(Variant variant, VariantEffects variantEffects, Markers intersects)`
Calculate variant effect for each marker in 'intersect'

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

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

## Field Details

### DEFAULT_UP_DOWN_LENGTH

public static final int DEFAULT_UP_DOWN_LENGTH

See Also:
  - Constant Field Values

### SMALL_VARIANT_SIZE_THRESHOLD

public static final int SMALL_VARIANT_SIZE_THRESHOLD

See Also:
  - Constant Field Values

## Constructor Details

### SnpEffectPredictor

public SnpEffectPredictor(Genome genome)

## Method Details

### load

public static SnpEffectPredictor load(Config config)
Load predictor from a binary file

### add

public void add(Gene gene)
Add a gene interval

### add

public void add(Marker marker)
Add a marker

Note: Markers have to be added BEFORE building the interval trees. Interval trees are built the first time you call snpEffect(snp) method.

### addAll

public void addAll(Markers markersToAdd)
Add a set of markers

### buildForest

public void buildForest()
Create interval trees (forest)

### countTranscripts

public int countTranscripts()
Count number of transcripts

### createGenomicRegions

public Markers createGenomicRegions()
Create (and add) up-down stream, splice sites, intergenic, etc

### filterTags

public void filterTags(Set<String> tags, Set<String> tagsNo)
Filter transcripts by tags

### filterTranscriptSupportLevel

public void filterTranscriptSupportLevel(TranscriptSupportLevel maxTsl)
Filter transcripts by TSL

### getGene

public Gene getGene(String geneId)
Obtain a gene by geneId

### getGenome

public Genome getGenome()

### getIntervalForest

public IntervalForest getIntervalForest()

### getMarkers

public Markers getMarkers()

### getSpliceRegionExonSize

public int getSpliceRegionExonSize()

### setSpliceRegionExonSize

public void setSpliceRegionExonSize(int spliceRegionExonSize)

### getSpliceRegionIntronMax

public int getSpliceRegionIntronMax()

### setSpliceRegionIntronMax

public void setSpliceRegionIntronMax(int spliceRegionIntronMax)

### getSpliceRegionIntronMin

public int getSpliceRegionIntronMin()

### setSpliceRegionIntronMin

public void setSpliceRegionIntronMin(int spliceRegionIntronMin)

### getTranscript

public Transcript getTranscript(String trId)

### getUpDownStreamLength

public int getUpDownStreamLength()

### setUpDownStreamLength

public void setUpDownStreamLength(int upDownStreamLength)

### keepTranscriptsProteinCoding

public int keepTranscriptsProteinCoding()
Remove all transcripts that are NOT in the list

Returns:
  : Number of transcripts removed

### print

public void print()
Dump to sdtout

### query

public Markers query(Marker marker)
Return a collection of intervals that intersect 'marker'

### queryClosestGene

public Gene queryClosestGene(Marker inputInterval)
Find closest gene to this marker

In case more than one 'closest' gene is found (e.g. two or more genes at the same distance). The following rules apply:

i) If many genes have the same 'closest distance', coding genes are preferred.

ii) If more than one coding gene has the same 'closet distance', a random gene is returned.

### queryDeep

public Markers queryDeep(Marker marker)
Return a collection of intervals that intersect 'marker' Query resulting genes, transcripts and exons to get ALL types of intervals possible

### regions

public Set<String> regions(Marker marker, boolean showGeneDetails, boolean compareTemplate)
Name of the regions hit by a marker

Returns:
  A set of region names

### regions

public Set<String> regions(Marker marker, boolean showGeneDetails, boolean compareTemplate, String id)
Name of the regions hit by a marker

Parameters:
  `id` - : Only use genes or transcripts matching this ID (null for any)

### removeNonCanonical

public void removeNonCanonical(String canonFile)
Remove all non-canonical transcripts If a file is provided, read "Gene => canonical_transcript" mapping from file

### removeUnverified

public boolean removeUnverified()
Remove all unverified transcripts

Returns:
  true if ALL genes had ALL transcripts removed (i.e. something went wrong, like in cases where no transcript was checked during the building process)

### retainAllTranscripts

public int retainAllTranscripts(Set<String> trIds)
Remove all transcripts that are NOT in the list

Returns:
  : Number of transcripts removed

### save

public void save(Config config)
Save predictor to a binary file (specified by the configuration)

### save

public void save(String fileName)
Save predictor to a binary file

### setDebug

public void setDebug(boolean debug)

### setSpliceSiteSize

public void setSpliceSiteSize(int spliceSiteSize)

### setUseChromosomes

public void setUseChromosomes(boolean useChromosomes)

### size

public int size()

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### variantEffect

public VariantEffects variantEffect(Variant variant)
Predict the effect of a variant

### variantEffect

protected void variantEffect(Variant variant, VariantEffects variantEffects, Markers intersects)
Calculate variant effect for each marker in 'intersect'