uk.ac.ebi.intact.util
Class GoTools

java.lang.Object
  |
  +--uk.ac.ebi.intact.util.GoTools

public class GoTools
extends java.lang.Object

Utilities to read and write files in GO format


Constructor Summary
GoTools()
           
 
Method Summary
static java.lang.String getGoid(CvObject current, java.lang.String goidDatabase)
          Return an identifier to be used in the go flat file format for the goid: element.
static java.lang.String getUniqueShortLabel(IntactHelper helper, java.lang.Class targetClass, java.lang.String ac, java.lang.String label, java.lang.String externalAc)
          Generate a label which is unique in targetClass and resembles label.
static CvObject insertDefinition(java.util.Hashtable definition, IntactHelper helper, java.lang.String goidDatabase, java.lang.Class targetClass, boolean deleteold)
          Insert a GO term into IntAct.
static void insertGoDag(java.lang.Class aTargetClass, IntactHelper helper, java.lang.String goidDatabase, java.lang.String sourceFile)
          Read a GO DAG file from the given URL, insert or update DAG into aTargetClass.
static void insertGoDefinitions(java.lang.Class aTargetClass, IntactHelper helper, java.lang.String goidDatabase, java.lang.String sourceFile)
          Read a GO definition flat file from the given URL, insert or update all terms into aTargetClass.
static void main(java.lang.String[] args)
          Load or unload Controlled Vocabularies in GO format.
static CvObject selectCvObject(IntactHelper helper, java.lang.String goidDatabase, java.util.Hashtable definition, java.lang.Class targetClass)
          Select an appropriate CvObject for update if it exists.
static CvObject selectCvObject(IntactHelper helper, java.lang.String goidDatabase, java.lang.String goid, java.lang.String shortLabel, java.lang.Class targetClass)
          Select an appropriate CvObject for update if it exists.
static java.lang.String toGoString(CvObject current, java.lang.String goidDatabase)
          Return a single CvObject as a GO flatfile formatted string
static void writeGoDefinitions(java.lang.Class aTargetClass, IntactHelper helper, java.lang.String goidDatabase, java.lang.String targetFile)
          Write a Controlled vocabulary in GO definition format flat file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GoTools

public GoTools()
Method Detail

getUniqueShortLabel

public static java.lang.String getUniqueShortLabel(IntactHelper helper,
                                                   java.lang.Class targetClass,
                                                   java.lang.String ac,
                                                   java.lang.String label,
                                                   java.lang.String externalAc)
                                            throws IntactException,
                                                   DuplicateLabelException
Generate a label which is unique in targetClass and resembles label. Label as a label of "current" is considered unique.

Parameters:
helper -
targetClass -
ac - the ac of the current object.
label -
externalAc -
Returns:
a label unique in targetClass
IntactException
DuplicateLabelException

insertDefinition

public static CvObject insertDefinition(java.util.Hashtable definition,
                                        IntactHelper helper,
                                        java.lang.String goidDatabase,
                                        java.lang.Class targetClass,
                                        boolean deleteold)
                                 throws IntactException,
                                        java.lang.Exception
Insert a GO term into IntAct.

IntactException
java.lang.Exception

insertGoDefinitions

public static void insertGoDefinitions(java.lang.Class aTargetClass,
                                       IntactHelper helper,
                                       java.lang.String goidDatabase,
                                       java.lang.String sourceFile)
                                throws java.lang.Exception
Read a GO definition flat file from the given URL, insert or update all terms into aTargetClass.

java.lang.Exception

insertGoDag

public static void insertGoDag(java.lang.Class aTargetClass,
                               IntactHelper helper,
                               java.lang.String goidDatabase,
                               java.lang.String sourceFile)
                        throws java.lang.Exception
Read a GO DAG file from the given URL, insert or update DAG into aTargetClass.

java.lang.Exception

writeGoDefinitions

public static void writeGoDefinitions(java.lang.Class aTargetClass,
                                      IntactHelper helper,
                                      java.lang.String goidDatabase,
                                      java.lang.String targetFile)
                               throws IntactException,
                                      java.io.IOException
Write a Controlled vocabulary in GO definition format flat file.

IntactException
java.io.IOException

toGoString

public static java.lang.String toGoString(CvObject current,
                                          java.lang.String goidDatabase)
Return a single CvObject as a GO flatfile formatted string


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Load or unload Controlled Vocabularies in GO format. Usage: GoTools upload IntAct_classname goid_db Go_DefinitionFile [Go_DagFile] | GoTools download IntAct_classname goid_db Go_DefinitionFile [Go_DagFile] goid_db is the shortLabel of the database which is to be used to establish object identity by mapping it to goid: in the GO flat file. Example: If goid_db is psi-mi, an CvObject with an xref "psi-mi; MI:123" is considered to be the same object as an object from the flat file with goid MI:123. If goid_db is '-', the shortLabel will be used if present.

Parameters:
args -
Throws:
java.lang.Exception

selectCvObject

public static CvObject selectCvObject(IntactHelper helper,
                                      java.lang.String goidDatabase,
                                      java.lang.String goid,
                                      java.lang.String shortLabel,
                                      java.lang.Class targetClass)
                               throws IntactException
Select an appropriate CvObject for update if it exists. Criterion of object identity: if goidDatabase is '-', try to match by shortlabel otherwise try to match by goid and goidDatabase

IntactException

selectCvObject

public static CvObject selectCvObject(IntactHelper helper,
                                      java.lang.String goidDatabase,
                                      java.util.Hashtable definition,
                                      java.lang.Class targetClass)
                               throws IntactException
Select an appropriate CvObject for update if it exists. Criterion of object identity: if goidDatabase is '-', try to match by shortlabel otherwise try to match by goid and goidDatabase

IntactException

getGoid

public static java.lang.String getGoid(CvObject current,
                                       java.lang.String goidDatabase)
Return an identifier to be used in the go flat file format for the goid: element.



IntAct Project - EMBL-EBI 2004 - intact-help@ebi.ac.uk