apollo.datamodel
Class CurationSet

java.lang.Object
  extended by apollo.datamodel.Range
      extended by apollo.datamodel.GenomicRange
          extended by apollo.datamodel.CurationSet
All Implemented Interfaces:
ApolloDataI, RangeI, java.io.Serializable, java.lang.Cloneable

public class CurationSet
extends GenomicRange
implements java.io.Serializable, ApolloDataI

I am the central holder of renderable data - results, annotations etc. I am a composite - I can contain instances of myself. In this case, these "child" curation sets can be retrieved by name. This is the way that the species-specific (and compara-) curation sets are passed around for the Synteny case.

In the case that I have no children, my get... methods will act on the (only) Results, Annotations etc that I have. If I _do_ have children, then the get... methods will blow up when invoked.

My feeling is that CurationSet should not be composite, but just be for one species. There should be a new object for the multi-species scene: MultiSpeciesDataHolder or something like that. It would hold CurationSets and LinkSets. This would mean changing DataLoader to be able to return more than just CurationSets.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable sequence_hash
           
protected  java.util.Vector sequence_vect
           
 
Fields inherited from class apollo.datamodel.GenomicRange
chromosome
 
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
CurationSet()
           
CurationSet(StrandedFeatureSetI results, StrandedFeatureSetI annots, java.lang.String region)
           
 
Method Summary
 void accept(Visitor visitor)
          General implementation of Visitor pattern.
 void addCurationSet(java.lang.Object key, CurationSet curationSet)
           
 SequenceI addSequence(SequenceI seq)
           
 boolean contains(RangeI sf)
          Overrides Range.contains.
 FeatureList getAnalysisFeatureList(java.lang.String analysisName)
          Returns a FeatureList for both strands of an analysis, the first item in list is forward strand, 2nd is rev strand.
 StrandedFeatureSetI getAnnots()
          A CurationSet has a dangling reference that needs to be cleaned up when a new curation set is loaded to replace this one, otherwise it will persist as a memory leak.
 java.lang.String getAssemblyType()
           
 java.util.HashMap getChildCurationSets()
           
 java.util.Vector getChildSetOrderedNames()
           
 CompositeDataHolder getCompositeDataHolder()
           
 CurationSet getCurationSet()
          if isCurationSet returns true than a real curation set would be returned here.
 CurationSet getCurationSet(java.lang.Object key)
           
 java.lang.String getInputFilename()
           
 StrandedFeatureSetI getResults()
           
 SequenceI getSequence(java.lang.String id)
           
 java.util.Vector getSequences()
           
 TransactionManager getTransactionManager()
           
 boolean hasTransactionManager()
           
 boolean hasTransactions()
           
 boolean isChromosomeArmUsed()
          A rather strange implemenation.
 boolean isCompositeDataHolder()
           
 boolean isCurationSet()
          ApolloDataI
 boolean isMultiSpecies()
          Temporary method until all synteny stuff uses CompositeDataHolder rename isComposite?
 boolean overlaps(RangeI sf)
          Overrides Range.overlaps.
 void removeSequence(SequenceI seq)
           
 void setAnnots(StrandedFeatureSetI annots)
           
 void setAssemblyType(java.lang.String type)
           
 void setChildSetOrderedNames(java.util.Vector setNames)
           
 void setInputFilename(java.lang.String file)
           
 void setRefSequence(SequenceI seq)
          Set the SequenceI that this feature annotates.
 void setResults(StrandedFeatureSetI results)
           
 void setTransactionManager(TransactionManager tranManager)
           
 java.lang.String toString()
           In the single-curation set case, this toString method is good for GAME fly data, but * for Ensembl data, the range already has all the info, so the title ends up something like "2 from Chr 2 200000 4000000:20000-4000000"
 
Methods inherited from class apollo.datamodel.GenomicRange
getChromosome, getOrganism, setChromosome, setOrganism
 
Methods inherited from class apollo.datamodel.Range
canHaveChildren, contains, convertFromBaseOrientedToInterbase, convertFromInterbaseToBaseOriented, getEnd, getEndAsString, getFeatureType, getHigh, getLeftOverlap, getLow, getName, getRangeClone, getRefSequence, getResidues, getRightOverlap, getStart, getStartAsString, getStrand, hasFeatureType, hasName, hasRefSequence, isContainedByRefSeq, isExactOverlap, isForwardStrand, isIdentical, isSequenceAvailable, length, rangeIsUnassigned, sameRange, setEnd, setFeatureType, setHigh, setLow, setName, setStart, setStrand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface apollo.datamodel.ApolloDataI
getName
 

Field Detail

sequence_vect

protected java.util.Vector sequence_vect

sequence_hash

protected java.util.Hashtable sequence_hash
Constructor Detail

CurationSet

public CurationSet()

CurationSet

public CurationSet(StrandedFeatureSetI results,
                   StrandedFeatureSetI annots,
                   java.lang.String region)
Method Detail

getChildCurationSets

public java.util.HashMap getChildCurationSets()

setChildSetOrderedNames

public void setChildSetOrderedNames(java.util.Vector setNames)

getChildSetOrderedNames

public java.util.Vector getChildSetOrderedNames()

addCurationSet

public void addCurationSet(java.lang.Object key,
                           CurationSet curationSet)

getCurationSet

public CurationSet getCurationSet(java.lang.Object key)

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

getAnnots

public StrandedFeatureSetI getAnnots()
A CurationSet has a dangling reference that needs to be cleaned up when a new curation set is loaded to replace this one, otherwise it will persist as a memory leak. The dangling reference is that if its ref seq is an AbstractLazySequence, ALS's LazyLoadControlledObject is a listener to the Controller. ALS.LLCO has to get a signal to remove itself as a listener when a new curation set is loaded and this is pase, thus this method.


getResults

public StrandedFeatureSetI getResults()

setResults

public void setResults(StrandedFeatureSetI results)

getAssemblyType

public java.lang.String getAssemblyType()

setAssemblyType

public void setAssemblyType(java.lang.String type)

getInputFilename

public java.lang.String getInputFilename()

setInputFilename

public void setInputFilename(java.lang.String file)

setAnnots

public void setAnnots(StrandedFeatureSetI annots)

addSequence

public SequenceI addSequence(SequenceI seq)

getSequences

public java.util.Vector getSequences()

getSequence

public SequenceI getSequence(java.lang.String id)

removeSequence

public void removeSequence(SequenceI seq)

toString

public java.lang.String toString()

In the single-curation set case, this toString method is good for GAME fly data, but * for Ensembl data, the range already has all the info, so the title ends up something like "2 from Chr 2 200000 4000000:20000-4000000"

For a composite case, the toString is the concatentation of all toString's on the children nodes.

Overrides:
toString in class Range

accept

public void accept(Visitor visitor)
General implementation of Visitor pattern. (see apollo.util.Visitor).


contains

public boolean contains(RangeI sf)
Overrides Range.contains. The only difference is that CurationSet does not consider strand in its contains method, where Range does. CurationSets are usually forward stranded (since there start is less than their start - see Range constructor), but they hold reverse as well as forwards stranded features. Without this override all of the reverse stranded features fail the contains test with their CurationSet.

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

overlaps

public boolean overlaps(RangeI sf)
Overrides Range.overlaps. Took out strand comparison.

Specified by:
overlaps in interface RangeI
Overrides:
overlaps in class Range
See Also:
contains

isCurationSet

public boolean isCurationSet()
ApolloDataI

Specified by:
isCurationSet in interface ApolloDataI

getCurationSet

public CurationSet getCurationSet()
Description copied from interface: ApolloDataI
if isCurationSet returns true than a real curation set would be returned here. This method should be used after testing isCurationSet()==true

Specified by:
getCurationSet in interface ApolloDataI

isCompositeDataHolder

public boolean isCompositeDataHolder()
Specified by:
isCompositeDataHolder in interface ApolloDataI

getCompositeDataHolder

public CompositeDataHolder getCompositeDataHolder()
Specified by:
getCompositeDataHolder in interface ApolloDataI

isMultiSpecies

public boolean isMultiSpecies()
Temporary method until all synteny stuff uses CompositeDataHolder rename isComposite?

Specified by:
isMultiSpecies in interface ApolloDataI

getAnalysisFeatureList

public FeatureList getAnalysisFeatureList(java.lang.String analysisName)
Returns a FeatureList for both strands of an analysis, the first item in list is forward strand, 2nd is rev strand. analysisName is what is called resulttype in the tiers file - its the name for the analysis in the data itself - not the name of the tier that it maps to in the gui (via the tiers file)


hasTransactions

public boolean hasTransactions()

hasTransactionManager

public boolean hasTransactionManager()

getTransactionManager

public TransactionManager getTransactionManager()
Returns:
Returns the tranManager.

setTransactionManager

public void setTransactionManager(TransactionManager tranManager)
Parameters:
tranManager - The tranManager to set.

isChromosomeArmUsed

public boolean isChromosomeArmUsed()
A rather strange implemenation. This method is based on GAMESave.writeGenomePosition(CurationSet).