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 EffectType
type
-
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 void
adjust(Marker child)
Adjust [start,end] to include childMarker
apply(Variant variant)
Apply a variant to a marker.protected Marker
applyDel(Variant variant)
Apply a Variant to a marker.protected Marker
applyDup(Variant variant)
Apply a Variant to a marker.protected Marker
applyIns(Variant variant)
Apply a Variant to a marker.protected Marker
applyMixed(Variant variant)
Apply a mixed variant Note: MIXED variant is interpreted as "MNP + InDel"Marker
clone()
Marker
cloneShallow()
Perform a shallow cloneCodonTable
codonTable()
Get a suitable codon tableint
compareTo(Interval i2)
Compare by start and endint
compareToPos(Interval i2)
Compare genomic coordinatesint
distance(Marker interval)
How far apart are these intervals?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'Marker
getParent()
EffectType
getType()
java.lang.String
idChain()
java.lang.String
idChain(java.lang.String separatorBetween, java.lang.String separatorWithin, boolean useGeneId)
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 chromosomeboolean
includes(Marker marker)
Is 'interval' completely included in 'this'?Marker
intersect(Marker marker)
Intersect of two markersprotected boolean
isAdjustIfParentDoesNotInclude(Marker parent)
Adjust parent if it does not include child?protected boolean
isShowWarningIfParentDoesNotInclude()
Show an error if parent does not include child?Markers
minus(Marker interval)
Return the difference between two markersMarkers
query(Marker marker)
Query all genomic regions that intersect 'marker' (this makes sense in Gene, Transcript, Exon, etc.)Markers
query(IntervalForest intervalForest)
Return a collection of intervals that intersect this markervoid
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"void
serializeParse(MarkerSerializer markerSerializer)
Parse a line from a serialized filejava.lang.String
serializeSave(MarkerSerializer markerSerializer)
Create a string to serialize to a fileboolean
shouldApply(Variant variant)
True if the variant should be applied to the markerjava.lang.String
toString()
Marker
union(Marker m)
Union of two markersboolean
variantEffect(Variant variant, VariantEffects variantEffects)
Calculate the effect of this variantboolean
variantEffectNonRef(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
-
-
-
-
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?
-
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:
serializeParse
in interfaceTxtSerializable
-
serializeSave
public java.lang.String serializeSave(MarkerSerializer markerSerializer)
Create a string to serialize to a file- Specified by:
serializeSave
in 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'
-
-