Package org.snpeff.interval

# Class Marker

java.lang.Object
org.snpeff.interval.Interval
org.snpeff.interval.Marker

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `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 (i.e. "genomic annotation") It is essentially an interval with an 'EffectType'

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`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`Marker()`
``
`Marker(Marker parent, int start, int end)`
``
`Marker(Marker parent, int start, int end, boolean strandMinus, String id)`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`adjust(Marker child)`
Adjust [start,end] to include child
`Marker`
`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 clone
`CodonTable`
`codonTable()`
Get a suitable codon table
`int`
`compareTo(Interval i2)`
Compare by start and end
`int`
`compareToPos(Interval i2)`
Compare genomic coordinates
`int`
`distance(Marker interval)`
How far apart are these intervals?
`int`
`distanceBases(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()`
`String`
`idChain()`
`String`
`idChain(String separatorBetween, String separatorWithin, boolean useGeneId)`
`String`
`idChain(String separatorBetween, String separatorWithin, boolean useGeneId, VariantEffect varEff)`
A list of all IDs and parent IDs until chromosome
`boolean`
`includes(Marker marker)`
Is 'interval' completely included in 'this'?
`Marker`
`intersect(Marker marker)`
Intersect of two markers
`protected boolean`
`isAdjustIfParentDoesNotInclude(Marker parent)`
Adjust parent if it does not include child?
`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
`protected boolean`
`isShowWarningIfParentDoesNotInclude()`
Show an error if parent does not include child?
`Markers`
`minus(Marker interval)`
Return the difference between two markers
`Markers`
`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 marker
`void`
`readTxt(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 file
`String`
`serializeSave(MarkerSerializer markerSerializer)`
Create a string to serialize to a file
`boolean`
`shouldApply(Variant variant)`
True if the variant should be applied to the marker
`String`
`toString()`
`Marker`
`union(Marker m)`
Union of two markers
`boolean`
`variantEffect(Variant variant, VariantEffects variantEffects)`
Calculate the effect of this variant
`boolean`
`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, toStrPos`

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

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

## Field Details

### type

protected EffectType type

## Constructor Details

### Marker

protected Marker()

### Marker

public Marker(Marker parent, int start, int end)

### Marker

public Marker(Marker parent, int start, int end, boolean strandMinus, String id)

## Method Details

### 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"

### clone

public Marker clone()

Overrides:
  `clone` in class `Interval`

### 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

Specified by:
  `compareTo` in interface `Comparable<Interval>`
Overrides:
  `compareTo` in class `Interval`

### 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(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'

### getParent

public Marker getParent()

Overrides:
  `getParent` in class `Interval`

### getType

public EffectType getType()

### idChain

public String idChain()

### idChain

public String idChain(String separatorBetween, String separatorWithin, boolean useGeneId)

### idChain

public String idChain(String separatorBetween, 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(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 interface `TxtSerializable`

### serializeSave

public String serializeSave(MarkerSerializer markerSerializer)
Create a string to serialize to a file

Specified by:
  `serializeSave` in interface `TxtSerializable`

### shouldApply

public boolean shouldApply(Variant variant)
True if the variant should be applied to the marker

### toString

public String toString()

Overrides:
  `toString` in class `Interval`

### 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'