org.intermine.bio.dataconversion
Class BioDirectoryConverter

java.lang.Object
  extended by org.intermine.dataconversion.DataConverter
      extended by org.intermine.dataconversion.DirectoryConverter
          extended by org.intermine.bio.dataconversion.BioDirectoryConverter
Direct Known Subclasses:
PdbConverter, UniprotConverter

public abstract class BioDirectoryConverter
extends DirectoryConverter

A DirectoryConverter that automatically sets the dataSets collection of objects as they are stored.


Constructor Summary
BioDirectoryConverter(ItemWriter writer, Model model, java.lang.String dataSourceName, java.lang.String dataSetTitle)
          Create a new BioDirectoryConverter.
BioDirectoryConverter(ItemWriter writer, Model model, java.lang.String dataSourceName, java.lang.String dataSetTitle, java.lang.String ontology)
          Create a new BioDirectoryConverter.
 
Method Summary
 Item createCrossReference(java.lang.String subjectId, java.lang.String value, java.lang.String dataSource, boolean store)
          Create a new CrossReference.
 Item createSynonym(java.lang.String subjectId, java.lang.String value, boolean store)
          Create a new Synonym.
 java.lang.String getDataSet(java.lang.String title, java.lang.String dataSourceRefId)
          Return a DataSet item with the given details.
 java.lang.String getDataSource(java.lang.String name)
          Return a DataSource item for the given title
 java.lang.String getOrganism(java.lang.String taxonId)
          The Organism item created from the taxon id passed to the constructor.
 java.lang.String getSequenceOntologyRefId()
           
 void setDataSet(java.lang.String refId)
          Update the dataset reference Id.
 
Methods inherited from class org.intermine.dataconversion.DirectoryConverter
close, process
 
Methods inherited from class org.intermine.dataconversion.DataConverter
addUniqueItemId, alias, createItem, getItemWriter, getModel, getUniqueItemId, newId, setStoreHook, store, store, store, store, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BioDirectoryConverter

public BioDirectoryConverter(ItemWriter writer,
                             Model model,
                             java.lang.String dataSourceName,
                             java.lang.String dataSetTitle)
Create a new BioDirectoryConverter.

Parameters:
writer - the Writer used to output the resultant items
model - the data model
dataSourceName - the DataSource name
dataSetTitle - the DataSet title

BioDirectoryConverter

public BioDirectoryConverter(ItemWriter writer,
                             Model model,
                             java.lang.String dataSourceName,
                             java.lang.String dataSetTitle,
                             java.lang.String ontology)
Create a new BioDirectoryConverter.

Parameters:
writer - the Writer used to output the resultant items
model - the data model
dataSourceName - the DataSource name
dataSetTitle - the DataSet title
Method Detail

setDataSet

public void setDataSet(java.lang.String refId)
Update the dataset reference Id. Overwrites the one set in the constructor. Needed for Uniprot which has a few different datasets.

Parameters:
refId - ID representing dataset object

getDataSource

public java.lang.String getDataSource(java.lang.String name)
Return a DataSource item for the given title

Parameters:
name - the DataSource name
Returns:
the DataSource Item

getDataSet

public java.lang.String getDataSet(java.lang.String title,
                                   java.lang.String dataSourceRefId)
Return a DataSet item with the given details.

Parameters:
title - the DataSet title
dataSourceRefId - the DataSource referenced by the the DataSet
Returns:
the DataSet Item

getOrganism

public java.lang.String getOrganism(java.lang.String taxonId)
The Organism item created from the taxon id passed to the constructor.

Parameters:
taxonId - NCBI taxonomy id of organism to create
Returns:
the refId representing the Organism Item

createCrossReference

public Item createCrossReference(java.lang.String subjectId,
                                 java.lang.String value,
                                 java.lang.String dataSource,
                                 boolean store)
                          throws org.xml.sax.SAXException,
                                 ObjectStoreException
Create a new CrossReference. Keeps a map of already processed items, ignores duplicates. The "store" param should be true only if the subject has already been stored. Storing a CrossReference first can signficantly slow down the build process.

Parameters:
subjectId - id representing the object (eg. Gene) this CrossReference describes.
value - identifier
dataSource - external database
store - if true, will store item
Returns:
the synonym item or null if this is a duplicate
Throws:
ObjectStoreException - if the synonym can't be stored
org.xml.sax.SAXException - if the synonym can't be stored

createSynonym

public Item createSynonym(java.lang.String subjectId,
                          java.lang.String value,
                          boolean store)
                   throws org.xml.sax.SAXException,
                          ObjectStoreException
Create a new Synonym. Keeps a map of already processed synonyms, ignores duplicates. The "store" param should be true only if the subject has already been stored. Storing a synonym first can signficantly slow down the build process.

Parameters:
subjectId - id representing the object (eg. Gene) this synonym describes.
value - the Synonym value
store - if true, will store item
Returns:
the synonym item or null if this is a duplicate
Throws:
ObjectStoreException - if the synonym can't be stored
org.xml.sax.SAXException - if the synonym can't be stored

getSequenceOntologyRefId

public java.lang.String getSequenceOntologyRefId()
Returns:
ID represening the Ontology object