apollo.datamodel
Class FeaturePair

java.lang.Object
  extended by apollo.datamodel.Range
      extended by apollo.datamodel.SeqFeature
          extended by apollo.datamodel.FeaturePair
All Implemented Interfaces:
Comparable, FeaturePairI, RangeI, SeqFeatureI, java.io.Serializable, java.lang.Cloneable

public class FeaturePair
extends SeqFeature
implements FeaturePairI

See Also:
Serialized Form

Field Summary
 
Fields inherited from class apollo.datamodel.SeqFeature
biotype, edit_offset_adjust, id, logger, phase, properties, ref_features, refFeature, refId, score, scores
 
Fields inherited from class apollo.datamodel.Range
high, low, name, refSeq, strand, type
 
Fields inherited from interface apollo.datamodel.RangeI
NO_NAME, NO_TYPE
 
Constructor Summary
FeaturePair(SeqFeatureI f1, SeqFeatureI f2)
          f1 is query feature, f2 is hit feature
 
Method Summary
 void addProperty(java.lang.String name, java.lang.String value)
           
 void addScore(double score)
           
 void addScore(Score s)
           
 void addScore(java.lang.String name, double score)
           
 void addScore(java.lang.String name, java.lang.String score)
           
 java.lang.String getCigar()
          an explicit variable for cigar strings that are compact representations of alignments
 java.lang.String getDisplayId()
           
 int getEnd()
           
 java.lang.String getExplicitAlignment()
          Explicitly set alignment.
 java.lang.String getFeatureType()
          getType is not the "visual" type, ie the type one sees in the EvidencePanel.
 int getFrame()
           
 int getHend()
           
 int getHhigh()
           
 int getHigh()
           
 SeqFeatureI getHitFeature()
          shoulnt this return null? yea it should - why is it returning this??
 int getHitIndex(int genomicPosition)
          Gets the index into the hit strings explicitAlignment for a genomic position
 int getHitIndex(int genomicPosition, java.lang.String type)
           
 SequenceI getHitSequence()
          Returns hit.getFeatureSequence (which is start to end of hits ref seq),
 int getHlow()
           
 java.lang.String getHname()
          Set explicit hit alignment - string with gaps.
 int getHstart()
           
 int getHstrand()
           
 java.lang.String getId()
           
 Range getInsertionRange(int hitIndex, java.lang.String alignment)
           
 int getLow()
           
 java.lang.String getName()
          In the case where the range is chromosomal the name is the chromosome name
 java.lang.String getProgramName()
           
 java.util.Hashtable getProperties()
           
 java.lang.String getProperty(java.lang.String name)
           
 SeqFeatureI getQueryFeature()
           
 SeqFeatureI getRefFeature()
          Retrieve the parent SeqFeatureI for this SeqFeatureI, or null if it is a tree root.
 java.lang.String getRefId()
           
 SequenceI getRefSequence()
          Retrieve the SequenceI that this feature annotates.
 java.lang.String getResidues()
           
 double getScore()
           
 double getScore(java.lang.String name)
           
 java.util.Hashtable getScores()
           
 int getStart()
           
 int getStrand()
           
 java.lang.String getTopLevelType()
          If biotype is null, returns type
 boolean hasAlignable()
          Returns true if has a real alignment or if theres a "trivial" alignment from SeqFeature.getTrivialAlignable
protected  boolean hasCigar()
           
 boolean hasHitFeature()
          from SeqFeatureI
 int insertionsBefore(int hitIndex, java.lang.String alignment)
           
static void main(java.lang.String[] args)
           
 void parseCigar()
          Populates getHitFeature().getAlignment() and queryAlignment using cigar string and hit and query seqs
 void removeProperty(java.lang.String key)
           
 void setCigar(java.lang.String cigar)
           
 void setEnd(int end)
           
 void setExplicitAlignment(java.lang.String align)
           
 void setFeatureType(java.lang.String type)
           
 void setHend(int end)
           
 void setHhigh(int high)
           
 void setHigh(int high)
           
 void setHitFeature(SeqFeatureI feature)
           
 void setHitSequence(SequenceI hit_seq)
           
 void setHlow(int low)
           
 void setHname(java.lang.String name)
           
 void setHstart(int start)
           
 void setHstrand(int strand)
           
 void setId(java.lang.String id)
           
 void setLow(int low)
           
 void setName(java.lang.String name)
           
 void setProgramName(java.lang.String name)
           
 void setQueryFeature(SeqFeatureI feature)
          Query feats hold cigars.
 void setRefFeature(SeqFeatureI feature)
          Set the parent SeqFeatureI.
 void setRefSequence(SequenceI seq)
          Set the SequenceI that this feature annotates.
 void setScore(double score)
           
 void setStart(int start)
           
 void setStrand(int strand)
           
 
Methods inherited from class apollo.datamodel.SeqFeature
accept, addDbXref, addFeature, addFeature, addRefFeature, alignmentIsPeptide, amend_RNA, buildmRNAEditList, clearKids, clearProperties, clone, cloneFeature, compareTo, descendsFrom, flipFlop, get_cDNA, get_ORF, getAlignment, getAnalogousOppositeStrandFeature, getAnnotatedFeature, getCloneSource, getCodingDNA, getCodingProperties, getDatabase, getDbXref, getDbXrefs, getEndPhase, getFeatureAt, getFeatureContaining, getFeatureIndex, getFeaturePosition, getFeatures, getFeatureSequence, getGenomicErrors, getGenomicPosForPeptidePos, getGenomicPosition, getIdentifier, getLeafFeatsOver, getNumberOfChildren, getNumberOfDescendents, getParent, getPeptideSequence, getPhase, getPrimaryDbXref, getPropertiesMulti, getPropertyMulti, getProteinFeat, getRefFeature, getStrandedFeatSetAncestor, getSubSequence, getSyntenyLinkInfo, getTranslation, getUnpaddedAlignment, getUserObject, hasAnalogousOppositeStrandFeature, hasAnnotatedFeature, hasId, hasKids, hasPeptideSequence, hasSyntenyLinkInfo, hasTranslation, haveExplicitAlignment, haveRealAlignment, initWithSeqFeat, isAncestorOf, isAnnot, isAnnotTop, isClone, isCodon, isExon, isProtein, isProteinCodingGene, isSameFeat, isSequencingError, isTranscript, merge, na2aa, numberOfGenerations, replaceProperty, setAlignment, setAnalogousOppositeStrandFeature, setDatabase, setIdentifier, setPhase, setSyntenyLinkInfo, setTopLevelType, setUserObject, size, toString, translate
 
Methods inherited from class apollo.datamodel.Range
canHaveChildren, contains, contains, convertFromBaseOrientedToInterbase, convertFromInterbaseToBaseOriented, getEndAsString, getLeftOverlap, getRangeClone, getRightOverlap, getStartAsString, hasFeatureType, hasName, hasRefSequence, isContainedByRefSeq, isExactOverlap, isForwardStrand, isIdentical, isSequenceAvailable, length, overlaps, rangeIsUnassigned, sameRange
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface apollo.datamodel.SeqFeatureI
accept, addDbXref, addFeature, addFeature, alignmentIsPeptide, clearKids, clearProperties, clone, cloneFeature, compareTo, descendsFrom, flipFlop, get_cDNA, getAlignment, getAnalogousOppositeStrandFeature, getAnnotatedFeature, getCloneSource, getCodingDNA, getCodingProperties, getDatabase, getDbXref, getDbXrefs, getEndPhase, getFeatureAt, getFeatureContaining, getFeatureIndex, getFeaturePosition, getFeatures, getFeatureSequence, getGenomicErrors, getGenomicPosForPeptidePos, getGenomicPosition, getLeafFeatsOver, getNumberOfChildren, getNumberOfDescendents, getParent, getPeptideSequence, getPhase, getPropertiesMulti, getPropertyMulti, getProteinFeat, getStrandedFeatSetAncestor, getSyntenyLinkInfo, getTranslation, getUnpaddedAlignment, getUserObject, hasAnalogousOppositeStrandFeature, hasAnnotatedFeature, hasId, hasKids, hasPeptideSequence, hasSyntenyLinkInfo, hasTranslation, haveExplicitAlignment, haveRealAlignment, isAncestorOf, isAnnot, isAnnotTop, isClone, isCodon, isExon, isProtein, isProteinCodingGene, isSameFeat, isSequencingError, isTranscript, merge, numberOfGenerations, replaceProperty, setAlignment, setAnalogousOppositeStrandFeature, setDatabase, setPhase, setSyntenyLinkInfo, setTopLevelType, setUserObject, size, translate
 
Methods inherited from interface apollo.datamodel.RangeI
canHaveChildren, contains, contains, convertFromBaseOrientedToInterbase, convertFromInterbaseToBaseOriented, getLeftOverlap, getRangeClone, getRightOverlap, hasFeatureType, hasName, hasRefSequence, isContainedByRefSeq, isExactOverlap, isForwardStrand, isIdentical, isSequenceAvailable, length, overlaps, rangeIsUnassigned, sameRange
 

Constructor Detail

FeaturePair

public FeaturePair(SeqFeatureI f1,
                   SeqFeatureI f2)
f1 is query feature, f2 is hit feature

Method Detail

setQueryFeature

public void setQueryFeature(SeqFeatureI feature)
Description copied from class: SeqFeature
Query feats hold cigars. This gives hit feats access to query feat & its cigar

Specified by:
setQueryFeature in interface FeaturePairI
Specified by:
setQueryFeature in interface SeqFeatureI
Overrides:
setQueryFeature in class SeqFeature

getQueryFeature

public SeqFeatureI getQueryFeature()
Specified by:
getQueryFeature in interface FeaturePairI

setHitFeature

public void setHitFeature(SeqFeatureI feature)
Specified by:
setHitFeature in interface FeaturePairI

getHitFeature

public SeqFeatureI getHitFeature()
Description copied from class: SeqFeature
shoulnt this return null? yea it should - why is it returning this??

Specified by:
getHitFeature in interface SeqFeatureI
Overrides:
getHitFeature in class SeqFeature

hasHitFeature

public boolean hasHitFeature()
from SeqFeatureI

Specified by:
hasHitFeature in interface SeqFeatureI
Overrides:
hasHitFeature in class SeqFeature

setLow

public void setLow(int low)
Specified by:
setLow in interface RangeI
Overrides:
setLow in class Range

getLow

public int getLow()
Specified by:
getLow in interface RangeI
Overrides:
getLow in class Range

setHigh

public void setHigh(int high)
Specified by:
setHigh in interface RangeI
Overrides:
setHigh in class Range

getHigh

public int getHigh()
Specified by:
getHigh in interface RangeI
Overrides:
getHigh in class Range

setStart

public void setStart(int start)
Specified by:
setStart in interface RangeI
Overrides:
setStart in class Range

getStart

public int getStart()
Specified by:
getStart in interface RangeI
Overrides:
getStart in class Range

setEnd

public void setEnd(int end)
Specified by:
setEnd in interface RangeI
Overrides:
setEnd in class Range

getEnd

public int getEnd()
Specified by:
getEnd in interface RangeI
Overrides:
getEnd in class Range

setStrand

public void setStrand(int strand)
Specified by:
setStrand in interface RangeI
Overrides:
setStrand in class Range

getStrand

public int getStrand()
Specified by:
getStrand in interface RangeI
Overrides:
getStrand in class Range
Returns:
1 for forward strand, -1 for reverse strand, 0 for strandless

setName

public void setName(java.lang.String name)
Specified by:
setName in interface RangeI
Overrides:
setName in class Range

getName

public java.lang.String getName()
Description copied from interface: RangeI
In the case where the range is chromosomal the name is the chromosome name

Specified by:
getName in interface RangeI
Overrides:
getName in class Range

setId

public void setId(java.lang.String id)
Specified by:
setId in interface SeqFeatureI
Overrides:
setId in class SeqFeature

getId

public java.lang.String getId()
Specified by:
getId in interface SeqFeatureI
Overrides:
getId in class SeqFeature

getScore

public double getScore()
Specified by:
getScore in interface SeqFeatureI
Overrides:
getScore in class SeqFeature

getScore

public double getScore(java.lang.String name)
Specified by:
getScore in interface SeqFeatureI
Overrides:
getScore in class SeqFeature

getScores

public java.util.Hashtable getScores()
Specified by:
getScores in interface SeqFeatureI
Overrides:
getScores in class SeqFeature

setScore

public void setScore(double score)
Specified by:
setScore in interface SeqFeatureI
Overrides:
setScore in class SeqFeature

addScore

public void addScore(Score s)
Specified by:
addScore in interface SeqFeatureI
Overrides:
addScore in class SeqFeature

addScore

public void addScore(double score)
Specified by:
addScore in interface SeqFeatureI
Overrides:
addScore in class SeqFeature

addScore

public void addScore(java.lang.String name,
                     double score)
Specified by:
addScore in interface SeqFeatureI
Overrides:
addScore in class SeqFeature

addScore

public void addScore(java.lang.String name,
                     java.lang.String score)
Specified by:
addScore in interface SeqFeatureI
Overrides:
addScore in class SeqFeature

addProperty

public void addProperty(java.lang.String name,
                        java.lang.String value)
Specified by:
addProperty in interface SeqFeatureI
Overrides:
addProperty in class SeqFeature

removeProperty

public void removeProperty(java.lang.String key)
Specified by:
removeProperty in interface SeqFeatureI
Overrides:
removeProperty in class SeqFeature

getProperty

public java.lang.String getProperty(java.lang.String name)
Specified by:
getProperty in interface SeqFeatureI
Overrides:
getProperty in class SeqFeature

getProperties

public java.util.Hashtable getProperties()
Specified by:
getProperties in interface SeqFeatureI
Overrides:
getProperties in class SeqFeature

setFeatureType

public void setFeatureType(java.lang.String type)
Specified by:
setFeatureType in interface RangeI
Overrides:
setFeatureType in class Range

getTopLevelType

public java.lang.String getTopLevelType()
Description copied from class: SeqFeature
If biotype is null, returns type

Specified by:
getTopLevelType in interface SeqFeatureI
Overrides:
getTopLevelType in class SeqFeature

getFeatureType

public java.lang.String getFeatureType()
Description copied from class: Range
getType is not the "visual" type, ie the type one sees in the EvidencePanel. getType returns the "logical" type(the type from the data). These are the types in the squiggly brackets in the tiers file that map to the visual type listed before the squigglies. gui.scheme.FeatureProperty maps logical types to visual types (convenience function in DetailInfo.getPropertyType)

Specified by:
getFeatureType in interface RangeI
Overrides:
getFeatureType in class Range

setProgramName

public void setProgramName(java.lang.String name)
Specified by:
setProgramName in interface SeqFeatureI
Overrides:
setProgramName in class SeqFeature

getProgramName

public java.lang.String getProgramName()
Specified by:
getProgramName in interface SeqFeatureI
Overrides:
getProgramName in class SeqFeature

getResidues

public java.lang.String getResidues()
Specified by:
getResidues in interface RangeI
Overrides:
getResidues in class Range

setRefSequence

public void setRefSequence(SequenceI seq)
Description copied from interface: RangeI
Set the SequenceI that this feature annotates.

Specified by:
setRefSequence in interface RangeI
Overrides:
setRefSequence in class Range
Parameters:
seq - the new parent SequenceI

getRefSequence

public SequenceI getRefSequence()
Description copied from interface: RangeI
Retrieve the SequenceI that this feature annotates.

Specified by:
getRefSequence in interface RangeI
Overrides:
getRefSequence in class Range
Returns:
the current parent SequenceI

getRefId

public java.lang.String getRefId()
Specified by:
getRefId in interface SeqFeatureI
Overrides:
getRefId in class SeqFeature

getRefFeature

public SeqFeatureI getRefFeature()
Description copied from interface: SeqFeatureI
Retrieve the parent SeqFeatureI for this SeqFeatureI, or null if it is a tree root.

Specified by:
getRefFeature in interface SeqFeatureI
Overrides:
getRefFeature in class SeqFeature
Returns:
the parent SeqFeatureI Couldnt this return a FeatureSetI, doesnt a ref feature have to be a FeatureSetI?

setRefFeature

public void setRefFeature(SeqFeatureI feature)
Description copied from interface: SeqFeatureI
Set the parent SeqFeatureI.

When building a part-whole hieracy of features, you must both add a feature to its parent, and then call child.setRefFeature(parent). It is possible for a feature to be added to multiple feature sets, but there is only one legitimate parent.

Specified by:
setRefFeature in interface SeqFeatureI
Overrides:
setRefFeature in class SeqFeature
Parameters:
feature - the new parent SeqFeatureI

getFrame

public int getFrame()
Specified by:
getFrame in interface SeqFeatureI
Overrides:
getFrame in class SeqFeature
Returns:
1,2,3 for frame, or -1 if no frame

getHname

public java.lang.String getHname()
Description copied from class: SeqFeature
Set explicit hit alignment - string with gaps. The compact alternative to this is cigars(which should be migrated to this interface from FeaturePairI). For an alignment to work you must set both setHitAlignmnet and setRefAlignment. Previously this was set with hit.setProperty("alignment")

Specified by:
getHname in interface SeqFeatureI
Overrides:
getHname in class SeqFeature

setHname

public void setHname(java.lang.String name)

getHstart

public int getHstart()
Specified by:
getHstart in interface SeqFeatureI
Overrides:
getHstart in class SeqFeature

setHstart

public void setHstart(int start)
Specified by:
setHstart in interface FeaturePairI

getHend

public int getHend()
Specified by:
getHend in interface SeqFeatureI
Overrides:
getHend in class SeqFeature

setHend

public void setHend(int end)
Specified by:
setHend in interface FeaturePairI

setHlow

public void setHlow(int low)
Specified by:
setHlow in interface FeaturePairI

getHlow

public int getHlow()
Specified by:
getHlow in interface SeqFeatureI
Overrides:
getHlow in class SeqFeature

setHhigh

public void setHhigh(int high)
Specified by:
setHhigh in interface FeaturePairI

getHhigh

public int getHhigh()
Specified by:
getHhigh in interface SeqFeatureI
Overrides:
getHhigh in class SeqFeature

setHstrand

public void setHstrand(int strand)
Specified by:
setHstrand in interface FeaturePairI

getHstrand

public int getHstrand()
Specified by:
getHstrand in interface SeqFeatureI
Overrides:
getHstrand in class SeqFeature

getHitIndex

public int getHitIndex(int genomicPosition)
Gets the index into the hit strings explicitAlignment for a genomic position


getHitIndex

public int getHitIndex(int genomicPosition,
                       java.lang.String type)

insertionsBefore

public int insertionsBefore(int hitIndex,
                            java.lang.String alignment)

getInsertionRange

public Range getInsertionRange(int hitIndex,
                               java.lang.String alignment)

getHitSequence

public SequenceI getHitSequence()
Returns hit.getFeatureSequence (which is start to end of hits ref seq),

Specified by:
getHitSequence in interface FeaturePairI
Specified by:
getHitSequence in interface SeqFeatureI
Overrides:
getHitSequence in class SeqFeature

setHitSequence

public void setHitSequence(SequenceI hit_seq)
Specified by:
setHitSequence in interface FeaturePairI

main

public static void main(java.lang.String[] args)

getDisplayId

public java.lang.String getDisplayId()

setCigar

public void setCigar(java.lang.String cigar)
Specified by:
setCigar in interface SeqFeatureI
Overrides:
setCigar in class SeqFeature

getCigar

public java.lang.String getCigar()
Description copied from class: SeqFeature
an explicit variable for cigar strings that are compact representations of alignments

Specified by:
getCigar in interface SeqFeatureI
Overrides:
getCigar in class SeqFeature

hasCigar

protected boolean hasCigar()
Overrides:
hasCigar in class SeqFeature

getExplicitAlignment

public java.lang.String getExplicitAlignment()
Explicitly set alignment. no padding

Specified by:
getExplicitAlignment in interface SeqFeatureI
Overrides:
getExplicitAlignment in class SeqFeature

setExplicitAlignment

public void setExplicitAlignment(java.lang.String align)
Specified by:
setExplicitAlignment in interface SeqFeatureI
Overrides:
setExplicitAlignment in class SeqFeature

parseCigar

public void parseCigar()
Populates getHitFeature().getAlignment() and queryAlignment using cigar string and hit and query seqs

Specified by:
parseCigar in interface SeqFeatureI
Overrides:
parseCigar in class SeqFeature

hasAlignable

public boolean hasAlignable()
Returns true if has a real alignment or if theres a "trivial" alignment from SeqFeature.getTrivialAlignable

Specified by:
hasAlignable in interface SeqFeatureI
Overrides:
hasAlignable in class SeqFeature