Class EntrezOrganismRetriever


  • public class EntrezOrganismRetriever
    extends org.apache.tools.ant.Task
    Class to fill in organism information using Entrez.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static int BATCH_SIZE  
      protected static java.lang.String ESUMMARY_URL  
      protected static org.apache.log4j.Logger LOG  
      • Fields inherited from class org.apache.tools.ant.Task

        description, location, target, taskName, taskType, wrapper
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        project
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()
      For each Organism in the objectstore, retreive it's details from entrez using the taxon and fill in the details in the organism object.
      protected java.util.Map<java.lang.String,​Organism> getOrganisms​(org.intermine.objectstore.ObjectStore os)
      Retrieve the organisms to be updated
      protected static java.io.Reader getReader​(java.lang.Integer id)  
      protected java.io.Reader getReader​(java.util.Set<java.lang.String> ids)
      Obtain the pubmed esummary information for the organisms
      void setOsAlias​(java.lang.String osAlias)
      Set the ObjectStore alias.
      void setOutputFile​(java.lang.String outputFile)
      Set the output file name
      • Methods inherited from class org.apache.tools.ant.Task

        getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        getProject, setProject
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        protected static final org.apache.log4j.Logger LOG
    • Constructor Detail

      • EntrezOrganismRetriever

        public EntrezOrganismRetriever()
    • Method Detail

      • setOsAlias

        public void setOsAlias​(java.lang.String osAlias)
        Set the ObjectStore alias.
        Parameters:
        osAlias - The ObjectStore alias
      • setOutputFile

        public void setOutputFile​(java.lang.String outputFile)
        Set the output file name
        Parameters:
        outputFile - The output file name
      • execute

        public void execute()
        For each Organism in the objectstore, retreive it's details from entrez using the taxon and fill in the details in the organism object.
        Overrides:
        execute in class org.apache.tools.ant.Task
        Throws:
        org.apache.tools.ant.BuildException - if an error occurs
      • getOrganisms

        protected java.util.Map<java.lang.String,​Organism> getOrganisms​(org.intermine.objectstore.ObjectStore os)
        Retrieve the organisms to be updated
        Parameters:
        os - the ObjectStore to read from
        Returns:
        a Map from taxonid to Organism object
      • getReader

        protected java.io.Reader getReader​(java.util.Set<java.lang.String> ids)
                                    throws java.lang.Exception
        Obtain the pubmed esummary information for the organisms
        Parameters:
        ids - the taxon ids of the organisms
        Returns:
        a Reader for the information
        Throws:
        java.lang.Exception - if an error occurs
      • getReader

        protected static java.io.Reader getReader​(java.lang.Integer id)
                                           throws java.lang.Exception
        Parameters:
        id - organism id
        Returns:
        reader
        Throws:
        java.lang.Exception - if something goes wrong