Package org.snpeff.interval
Class Marker
- java.lang.Object
-
- org.snpeff.interval.Interval
-
- org.snpeff.interval.Marker
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<Interval>,TxtSerializable
- Direct Known Subclasses:
Cds,Chromosome,Custom,Downstream,GenericMarker,Genome,Intergenic,IntergenicConserved,IntervalAndSubIntervals,Intron,IntronConserved,MarkerParentId,MarkerSeq,MicroRnaBindingSite,Motif,NextProt,ProteinInteractionLocus,RareAminoAcid,Regulation,SpliceSite,Upstream,Utr,Variant,VcfEntry
public class Marker extends Interval implements TxtSerializable
An interval intended as a mark- Author:
- pcingola
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected EffectTypetype-
Fields inherited from class org.snpeff.interval.Interval
chromosomeNameOri, end, id, parent, start, strandMinus
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadjust(Marker child)Adjust [start,end] to include childMarkerapply(Variant variant)Apply a variant to a marker.protected MarkerapplyDel(Variant variant)Apply a Variant to a marker.protected MarkerapplyDup(Variant variant)Apply a Variant to a marker.protected MarkerapplyIns(Variant variant)Apply a Variant to a marker.protected MarkerapplyMixed(Variant variant)Apply a mixed variant Note: MIXED variant is interpreted as "MNP + InDel"Markerclone()MarkercloneShallow()Perform a shallow cloneCodonTablecodonTable()Get a suitable codon tableintcompareTo(Interval i2)Compare by start and endintcompareToPos(Interval i2)Compare genomic coordinatesintdistance(Marker interval)How far apart are these intervals?intdistanceBases(java.util.List<? extends Marker> markers, boolean fromEnd)Distance from the beginning/end of a list of intervals, until this SNP It count the number of bases in 'markers'MarkergetParent()EffectTypegetType()java.lang.StringidChain()java.lang.StringidChain(java.lang.String separatorBetween, java.lang.String separatorWithin, boolean useGeneId)java.lang.StringidChain(java.lang.String separatorBetween, java.lang.String separatorWithin, boolean useGeneId, VariantEffect varEff)A list of all IDs and parent IDs until chromosomebooleanincludes(Marker marker)Is 'interval' completely included in 'this'?Markerintersect(Marker marker)Intersect of two markersprotected booleanisAdjustIfParentDoesNotInclude(Marker parent)Adjust parent if it does not include child?booleanisDeferredAnalysis()Deferred analysis markers must be analyzed after 'standard' ones because their impact depends on other results For instance, a NextProt marker's impact would be different if the variant is synonymous or non-synonymousprotected booleanisShowWarningIfParentDoesNotInclude()Show an error if parent does not include child?Markersminus(Marker interval)Return the difference between two markersMarkersquery(Marker marker)Query all genomic regions that intersect 'marker' (this makes sense in Gene, Transcript, Exon, etc.)Markersquery(IntervalForest intervalForest)Return a collection of intervals that intersect this markervoidreadTxt(java.lang.String line, int lineNum, Genome genome, int positionBase)Parse a line (form a file) Format: "chromosome \t start \t end \t id \n"voidserializeParse(MarkerSerializer markerSerializer)Parse a line from a serialized filejava.lang.StringserializeSave(MarkerSerializer markerSerializer)Create a string to serialize to a filebooleanshouldApply(Variant variant)True if the variant should be applied to the markerjava.lang.StringtoString()Markerunion(Marker m)Union of two markersbooleanvariantEffect(Variant variant, VariantEffects variantEffects)Calculate the effect of this variantbooleanvariantEffectNonRef(Variant variant, VariantEffects variantEffects)Calculate the effect of this variant-
Methods inherited from class org.snpeff.interval.Interval
equals, findParent, getChromosome, getChromosomeName, getChromosomeNameOri, getChromosomeNum, getEnd, getGenome, getGenomeName, getId, getStart, getStrand, hashCode, intersects, intersects, intersects, intersects, intersectSize, isCircular, isSameChromo, isStrandMinus, isStrandPlus, isValid, setChromosomeNameOri, setEnd, setId, setParent, setStart, setStrandMinus, shiftCoordinates, size, toStr, toStringAsciiArt, toStrPos
-
-
-
-
Field Detail
-
type
protected EffectType type
-
-
Method Detail
-
adjust
protected void adjust(Marker child)
Adjust [start,end] to include child
-
apply
public Marker apply(Variant variant)
Apply a variant to a marker.Calculate a the result of a marker, such that newMarker = marker.apply( variant ) variant = Diff( newMarker , marker ) // Differences in sequence
Note: This method may return: - The same marker (this) when genetic coordinates remain unchanged - 'null' if the whole marker is removed by the variant (e.g. a deletion spanning the whole marker)
For these reasons, the method should never be invoked directly. This is why the method is 'private' and 'final'
- Returns:
- The marker result after applying variant
-
applyDel
protected Marker applyDel(Variant variant)
Apply a Variant to a marker. Variant is a deletion
-
applyDup
protected Marker applyDup(Variant variant)
Apply a Variant to a marker. Variant is a duplication
-
applyIns
protected Marker applyIns(Variant variant)
Apply a Variant to a marker. Variant is an insertion
-
applyMixed
protected Marker applyMixed(Variant variant)
Apply a mixed variant Note: MIXED variant is interpreted as "MNP + InDel"
-
cloneShallow
public Marker cloneShallow()
Perform a shallow clone
-
codonTable
public CodonTable codonTable()
Get a suitable codon table
-
compareTo
public int compareTo(Interval i2)
Compare by start and end
-
compareToPos
public int compareToPos(Interval i2)
Compare genomic coordinates
-
distance
public int distance(Marker interval)
How far apart are these intervals?- Returns:
- Distance or -1 if they are not comparable (i.e. different chromosomes)
-
distanceBases
public int distanceBases(java.util.List<? extends Marker> markers, boolean fromEnd)
Distance from the beginning/end of a list of intervals, until this SNP It count the number of bases in 'markers'
-
getType
public EffectType getType()
-
idChain
public java.lang.String idChain()
-
idChain
public java.lang.String idChain(java.lang.String separatorBetween, java.lang.String separatorWithin, boolean useGeneId)
-
idChain
public java.lang.String idChain(java.lang.String separatorBetween, java.lang.String separatorWithin, boolean useGeneId, VariantEffect varEff)A list of all IDs and parent IDs until chromosome
-
includes
public boolean includes(Marker marker)
Is 'interval' completely included in 'this'?- Returns:
- return true if 'this' includes 'interval'
-
intersect
public Marker intersect(Marker marker)
Intersect of two markers- Returns:
- A new marker which is the intersect of the two
-
isAdjustIfParentDoesNotInclude
protected boolean isAdjustIfParentDoesNotInclude(Marker parent)
Adjust parent if it does not include child?
-
isDeferredAnalysis
public boolean isDeferredAnalysis()
Deferred analysis markers must be analyzed after 'standard' ones because their impact depends on other results For instance, a NextProt marker's impact would be different if the variant is synonymous or non-synonymous
-
isShowWarningIfParentDoesNotInclude
protected boolean isShowWarningIfParentDoesNotInclude()
Show an error if parent does not include child?
-
minus
public Markers minus(Marker interval)
Return the difference between two markers- Parameters:
interval-- Returns:
- A set of 'markers'. Note that the result can have zero, one or two markers
-
query
public Markers query(IntervalForest intervalForest)
Return a collection of intervals that intersect this marker
-
query
public Markers query(Marker marker)
Query all genomic regions that intersect 'marker' (this makes sense in Gene, Transcript, Exon, etc.)
-
readTxt
public void readTxt(java.lang.String line, int lineNum, Genome genome, int positionBase)Parse a line (form a file) Format: "chromosome \t start \t end \t id \n"
-
serializeParse
public void serializeParse(MarkerSerializer markerSerializer)
Parse a line from a serialized file- Specified by:
serializeParsein interfaceTxtSerializable
-
serializeSave
public java.lang.String serializeSave(MarkerSerializer markerSerializer)
Create a string to serialize to a file- Specified by:
serializeSavein interfaceTxtSerializable
-
shouldApply
public boolean shouldApply(Variant variant)
True if the variant should be applied to the marker
-
union
public Marker union(Marker m)
Union of two markers- Returns:
- A new marker which is the union of the two
-
variantEffect
public boolean variantEffect(Variant variant, VariantEffects variantEffects)
Calculate the effect of this variant
-
variantEffectNonRef
public boolean variantEffectNonRef(Variant variant, VariantEffects variantEffects)
Calculate the effect of this variant- Parameters:
variantEndPoint- : Before analyzing results, we have to change markers using variantrRef to create a new reference 'on the fly'
-
-