org.intermine.bio.postprocess
Class CreateReferences

java.lang.Object
  extended by org.intermine.bio.postprocess.CreateReferences

public class CreateReferences
extends java.lang.Object

Fill in additional references/collections in genomic model


Field Summary
protected  ObjectStoreWriter osw
           
 
Constructor Summary
CreateReferences(ObjectStoreWriter osw)
          Construct with an ObjectStoreWriter, read and write from same ObjectStore
 
Method Summary
 void createUtrRefs()
          Read the UTRs collection of MRNA then set the fivePrimeUTR and threePrimeUTR fields with the corresponding UTRs.
protected  void insertCollectionField(java.lang.Class<? extends InterMineObject> firstClass, java.lang.String firstClassFieldName, java.lang.Class<? extends InterMineObject> connectingClass, java.lang.String connectingClassFieldName, java.lang.Class<? extends InterMineObject> secondClass, java.lang.String createFieldName, boolean createInFirstClass)
          Add a collection of objects of type X to objects of type Y by using a connecting class.
protected  void insertReferenceField(java.lang.Class<? extends InterMineObject> sourceClass, java.lang.String sourceClassFieldName, java.lang.Class<? extends InterMineObject> connectingClass, java.lang.String connectingClassFieldName, java.lang.Class<? extends InterMineObject> destinationClass, java.lang.String createFieldName)
          Add a reference to and object of type X in objects of type Y by using a connecting class.
 void insertReferences()
          Fill in missing references/collections in model by querying relations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

osw

protected ObjectStoreWriter osw
Constructor Detail

CreateReferences

public CreateReferences(ObjectStoreWriter osw)
Construct with an ObjectStoreWriter, read and write from same ObjectStore

Parameters:
osw - an ObjectStore to write to
Method Detail

insertReferences

public void insertReferences()
                      throws java.lang.Exception
Fill in missing references/collections in model by querying relations

Throws:
java.lang.Exception - if anything goes wrong

insertReferenceField

protected void insertReferenceField(java.lang.Class<? extends InterMineObject> sourceClass,
                                    java.lang.String sourceClassFieldName,
                                    java.lang.Class<? extends InterMineObject> connectingClass,
                                    java.lang.String connectingClassFieldName,
                                    java.lang.Class<? extends InterMineObject> destinationClass,
                                    java.lang.String createFieldName)
                             throws java.lang.Exception
Add a reference to and object of type X in objects of type Y by using a connecting class. Eg. Add a reference to Gene objects in Exon by examining the Transcript objects in the transcripts collection of the Gene, which would use a query like: SELECT DISTINCT gene FROM Gene AS gene, Transcript AS transcript, Exon AS exon WHERE (gene.transcripts CONTAINS transcript AND transcript.exons CONTAINS exon) ORDER BY gene and then set exon.gene in overview we are doing: BioEntity1 -> BioEntity2 -> BioEntity3 ==> BioEntitiy1 -> BioEntity3

Parameters:
sourceClass - the first class in the query
sourceClassFieldName - the field in the sourceClass which should contain the connectingClass
connectingClass - the class referred to by sourceClass.sourceFieldName
connectingClassFieldName - the field in connectingClass which should contain destinationClass
destinationClass - the class referred to by connectingClass.connectingClassFieldName
createFieldName - the reference field in the destinationClass - the collection to create/set
Throws:
java.lang.Exception - if anything goes wrong

insertCollectionField

protected void insertCollectionField(java.lang.Class<? extends InterMineObject> firstClass,
                                     java.lang.String firstClassFieldName,
                                     java.lang.Class<? extends InterMineObject> connectingClass,
                                     java.lang.String connectingClassFieldName,
                                     java.lang.Class<? extends InterMineObject> secondClass,
                                     java.lang.String createFieldName,
                                     boolean createInFirstClass)
                              throws java.lang.Exception
Add a collection of objects of type X to objects of type Y by using a connecting class. Eg. Add a collection of Protein objects to Gene by examining the Transcript objects in the transcripts collection of the Gene, which would use a query like: SELECT DISTINCT gene FROM Gene AS gene, Transcript AS transcript, Protein AS protein WHERE (gene.transcripts CONTAINS transcript AND transcript.protein CONTAINS protein) ORDER BY gene and then set protected gene.protein (if created BioEntity1 -> BioEntity2 -> BioEntity3 ==> BioEntity1 -> BioEntity3

Parameters:
firstClass - the first class in the query
firstClassFieldName - the field in the firstClass which should contain the connectingClass
connectingClass - the class referred to by firstClass.sourceFieldName
connectingClassFieldName - the field in connectingClass which should contain secondClass
secondClass - the class referred to by connectingClass.connectingClassFieldName
createFieldName - the collection field in the secondClass - the collection to create/set
createInFirstClass - if true create the new collection field in firstClass, otherwise create in secondClass
Throws:
java.lang.Exception - if anything goes wrong

createUtrRefs

public void createUtrRefs()
                   throws java.lang.Exception
Read the UTRs collection of MRNA then set the fivePrimeUTR and threePrimeUTR fields with the corresponding UTRs.

Throws:
java.lang.Exception - if anything goes wrong