apollo.config
Class GmodNameAdapter

java.lang.Object
  extended by apollo.config.DefaultNameAdapter
      extended by apollo.config.GmodNameAdapter
All Implemented Interfaces:
ApolloNameAdapterI
Direct Known Subclasses:
FlyNameAdapter, RiceNameAdapter

public class GmodNameAdapter
extends DefaultNameAdapter

This has a lot of stuff that needs to go in FlyNameAdapter subclass. work in progress


Field Summary
protected static int annotNumber
           
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
GmodNameAdapter()
           
 
Method Summary
 java.lang.String generateAnnotSplitName(SeqFeatureI annot, StrandedFeatureSetI annotParent, java.lang.String curationName)
          generates both temp names and split names.
 java.lang.String generateId(StrandedFeatureSetI annots, java.lang.String curation_name, SeqFeatureI feature)
          generates a ID for a given feature.
 java.lang.String generateName(StrandedFeatureSetI annots, java.lang.String curation_name, SeqFeatureI feature)
          generates a name for a given feature - this only works for genes, transcripts and exons
 java.lang.String generatePeptideIdFromTranscriptId(java.lang.String transcriptId)
          Generates peptide id from existing transcript id.
 java.lang.String generatePeptideNameFromTranscriptName(java.lang.String transcriptName)
          Generates peptide name from existing transcript name.
protected  java.lang.String generateTranscriptId(SeqFeatureI trans)
           
protected  java.lang.String generateTranscriptSuffix(int t_index, java.util.Vector transcripts, boolean addTemp)
          Return -transcript#:temp, where # is transcript number.
protected  java.lang.String getDefaultIDPrefix()
          The prefix to use if idFormat is not specified in tiers file for a type
protected  java.lang.String getIDPrefix(SeqFeatureI sf)
          Returns the prefix of a SeqFeature's ID format (e.g.
 java.lang.String getNewChadoDbUniquename(SeqFeatureI feat, long pk)
           
 java.lang.String getNewChadoDbUniquename(java.lang.String featType, long pk)
           
 java.lang.String getNewIdFromTypeChange(java.lang.String oldId, java.lang.String oldType, java.lang.String newType)
          convert oldId to a new id in new type format
protected  java.lang.String getPeptideSuffixRoot()
          The root of the suffix is the non changing part of the suffix - the suffix\ minus the ordinal.
protected  java.lang.String getPrefix(java.lang.String idFormat)
          Given a format string (e.g.
 java.lang.String getTranscriptNamePattern()
          This is used as a check if transcript suffix editing is allowed in the annot info editor.
protected  java.lang.String getTranscriptOrdinalPattern()
           
protected  java.lang.String getTranscriptSuffix(SeqFeatureI trans, AnnotatedFeatureI annot)
           
protected  java.lang.String getTranscriptSuffixRoot()
          This needs some explaining.
protected  boolean isAnnotId(SeqFeatureI annot)
           
protected  boolean match(SeqFeatureI sf, java.lang.String matchString)
          Special version for fly--knows proper format for transcript names
 boolean nameIsId(SeqFeatureI feature)
           
 boolean needsSuffix(java.lang.String type)
          Returns true if this annot type needs a suffix (e.g.
 CompoundTransaction setAnnotName(AnnotatedFeatureI annot, java.lang.String newName)
          This is for top level annots (eg gene).
protected  UpdateTransaction setPeptideIdFromTranscript(SeqFeatureI transcript)
          chado generates peptide ids not apollo.
protected  CompoundTransaction setSeqNamesFromTranscript(AnnotatedFeatureI trans)
          Rice/gmod does peptide names (but not cdna names).
 CompoundTransaction setTranscriptId(SeqFeatureI trans, java.lang.String id)
          Sets transcript id, may also set peptide id
 CompoundTransaction setTranscriptName(AnnotatedFeatureI trans, java.lang.String name)
          sets transcript name to name and adds synonym of old trans name, returns compound transaction with update name and add syn transactions
 CompoundTransaction setTranscriptNameFromAnnot(AnnotatedFeatureI trans, AnnotatedFeatureI ann)
          Sets the name of a transcript based upon its annot parent.
 boolean suffixInUse(java.util.Vector transcripts, java.lang.String suffix, int t_index)
          A simpler signature for this might be (AnnotatedFeatureI gene, String suffix) I dont think t_index is necasary as the suffix in question should be new - even different from the transcript it came from if the trans has a name yet - but maybe im missing something
protected  boolean transcriptCanHaveTempSuffix()
          Returns true.
protected  boolean transcriptOrdinalIsNumeric()
          Return true if transcripts do numbers in suffix, false if do letter [A-Z] in suffix as ordinal.
 boolean typeChangeCausesIdChange(java.lang.String oldType, java.lang.String newType)
          Returns true if changing type from oldType to newType will cause a change in feature ID, i.e.
 
Methods inherited from class apollo.config.DefaultNameAdapter
addSynonym, checkFormat, checkName, generateChadoCdsIdFromTranscriptId, generateChadoCdsNameFromTranscriptName, generateExonId, generateName, generateNewExonId, generateNewId, getSuffixDelimiter, getTransactionManager, idAndNameHaveSameFormat, isTemp, isTemp, nextAnnotNumber, setAnnotId, setDataAdapter, setId, setName, setTransactionManager, skipUsedTempNum, updateExonId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

annotNumber

protected static int annotNumber
Constructor Detail

GmodNameAdapter

public GmodNameAdapter()
Method Detail

generateName

public java.lang.String generateName(StrandedFeatureSetI annots,
                                     java.lang.String curation_name,
                                     SeqFeatureI feature)
generates a name for a given feature - this only works for genes, transcripts and exons

Specified by:
generateName in interface ApolloNameAdapterI
Overrides:
generateName in class DefaultNameAdapter

generateAnnotSplitName

public java.lang.String generateAnnotSplitName(SeqFeatureI annot,
                                               StrandedFeatureSetI annotParent,
                                               java.lang.String curationName)
generates both temp names and split names. a split annot can have 3 kinds of names: temp, id, & real-user-added name. temps, and ids just get temp ids. if its a real-user-added name that means its being split and it needs split numbers. old split numbers are looked for and added to if there. a split number is a :# at the end of a real user name. looks at other annots with same name(prefix) and if they have split numbers uses next highest. curationName not used here (for fly subclass)

Specified by:
generateAnnotSplitName in interface ApolloNameAdapterI
Overrides:
generateAnnotSplitName in class DefaultNameAdapter

generateTranscriptId

protected java.lang.String generateTranscriptId(SeqFeatureI trans)

needsSuffix

public boolean needsSuffix(java.lang.String type)
Returns true if this annot type needs a suffix (e.g. -RA). Currently this decision is made by whether it is a first-tier annotation. Test should probably be whether this is a single-level annot (which can now be specified in tiers file).


generateTranscriptSuffix

protected java.lang.String generateTranscriptSuffix(int t_index,
                                                    java.util.Vector transcripts,
                                                    boolean addTemp)
Return -transcript#:temp, where # is transcript number. If suffix already being used, uses the first unused #. :temp is added to trip chado trigger to create new transcript name - which prevents naming collisions.


generateId

public java.lang.String generateId(StrandedFeatureSetI annots,
                                   java.lang.String curation_name,
                                   SeqFeatureI feature)
generates a ID for a given feature. for annots calls generateAnnotTempId which produces a temp id

Specified by:
generateId in interface ApolloNameAdapterI
Overrides:
generateId in class DefaultNameAdapter

nameIsId

public boolean nameIsId(SeqFeatureI feature)
Specified by:
nameIsId in interface ApolloNameAdapterI
Overrides:
nameIsId in class DefaultNameAdapter

isAnnotId

protected boolean isAnnotId(SeqFeatureI annot)

setAnnotName

public CompoundTransaction setAnnotName(AnnotatedFeatureI annot,
                                        java.lang.String newName)
This is for top level annots (eg gene). not underling annots (transcript) sets gene name, adds old gene name as synonym, sets transcript names.

Specified by:
setAnnotName in interface ApolloNameAdapterI
Overrides:
setAnnotName in class DefaultNameAdapter

setTranscriptNameFromAnnot

public CompoundTransaction setTranscriptNameFromAnnot(AnnotatedFeatureI trans,
                                                      AnnotatedFeatureI ann)
Description copied from interface: ApolloNameAdapterI
Sets the name of a transcript based upon its annot parent. May also set exon names. May also set peptide accession

Specified by:
setTranscriptNameFromAnnot in interface ApolloNameAdapterI
Overrides:
setTranscriptNameFromAnnot in class DefaultNameAdapter

setTranscriptName

public CompoundTransaction setTranscriptName(AnnotatedFeatureI trans,
                                             java.lang.String name)
Description copied from class: DefaultNameAdapter
sets transcript name to name and adds synonym of old trans name, returns compound transaction with update name and add syn transactions

Specified by:
setTranscriptName in interface ApolloNameAdapterI
Overrides:
setTranscriptName in class DefaultNameAdapter

setTranscriptId

public CompoundTransaction setTranscriptId(SeqFeatureI trans,
                                           java.lang.String id)
Description copied from interface: ApolloNameAdapterI
Sets transcript id, may also set peptide id

Specified by:
setTranscriptId in interface ApolloNameAdapterI
Overrides:
setTranscriptId in class DefaultNameAdapter

setPeptideIdFromTranscript

protected UpdateTransaction setPeptideIdFromTranscript(SeqFeatureI transcript)
chado generates peptide ids not apollo. apollo either keeps the existing accession, and if null just creates a temp pep id (just uses name)


getTranscriptSuffix

protected java.lang.String getTranscriptSuffix(SeqFeatureI trans,
                                               AnnotatedFeatureI annot)

setSeqNamesFromTranscript

protected CompoundTransaction setSeqNamesFromTranscript(AnnotatedFeatureI trans)
Rice/gmod does peptide names (but not cdna names). apollo never displays seq names and rice triggers automatically change prot names on transcript name change This is actually needed to give peptides a unique id for putting together chado transactions, otherwise it defaults to transcript name and things get messed up. This is called by setTranscriptNameFromAnnot(). used to be called by FED as well - no longer.


generatePeptideNameFromTranscriptName

public java.lang.String generatePeptideNameFromTranscriptName(java.lang.String transcriptName)
Generates peptide name from existing transcript name. Replace transcript suffix with peptide suffix

Specified by:
generatePeptideNameFromTranscriptName in interface ApolloNameAdapterI
Overrides:
generatePeptideNameFromTranscriptName in class DefaultNameAdapter

generatePeptideIdFromTranscriptId

public java.lang.String generatePeptideIdFromTranscriptId(java.lang.String transcriptId)
Generates peptide id from existing transcript id. Replace transcript suffix with peptide suffix

Specified by:
generatePeptideIdFromTranscriptId in interface ApolloNameAdapterI
Overrides:
generatePeptideIdFromTranscriptId in class DefaultNameAdapter

getTranscriptSuffixRoot

protected java.lang.String getTranscriptSuffixRoot()
This needs some explaining. This is the root of the suffix. Its the part of the transcript suffix that doesnt change. so for rice/gmod its "-transcript", for fly its "-R"


getPeptideSuffixRoot

protected java.lang.String getPeptideSuffixRoot()
The root of the suffix is the non changing part of the suffix - the suffix\ minus the ordinal. for gmod/rice its "-protein"


getTranscriptNamePattern

public java.lang.String getTranscriptNamePattern()
This is used as a check if transcript suffix editing is allowed in the annot info editor. gmod/rice disallows this by default so this is actually not relevant yet for rice. (fly allows this so its important there). move to fly?

Specified by:
getTranscriptNamePattern in interface ApolloNameAdapterI
Overrides:
getTranscriptNamePattern in class DefaultNameAdapter

getTranscriptOrdinalPattern

protected java.lang.String getTranscriptOrdinalPattern()

transcriptOrdinalIsNumeric

protected boolean transcriptOrdinalIsNumeric()
Return true if transcripts do numbers in suffix, false if do letter [A-Z] in suffix as ordinal. Gmod/rice is numeric(true), fly is alpha(false)


transcriptCanHaveTempSuffix

protected boolean transcriptCanHaveTempSuffix()
Returns true. gmod temps transcript suffixes (by default). the :temp indicates that the db needs to create a new transcript name


typeChangeCausesIdChange

public boolean typeChangeCausesIdChange(java.lang.String oldType,
                                        java.lang.String newType)
Returns true if changing type from oldType to newType will cause a change in feature ID, i.e. the ID prefix will change to reflect the new type. This code should probably be moved to default name adapter

Specified by:
typeChangeCausesIdChange in interface ApolloNameAdapterI
Overrides:
typeChangeCausesIdChange in class DefaultNameAdapter

getNewIdFromTypeChange

public java.lang.String getNewIdFromTypeChange(java.lang.String oldId,
                                               java.lang.String oldType,
                                               java.lang.String newType)
convert oldId to a new id in new type format

Specified by:
getNewIdFromTypeChange in interface ApolloNameAdapterI
Overrides:
getNewIdFromTypeChange in class DefaultNameAdapter

match

protected boolean match(SeqFeatureI sf,
                        java.lang.String matchString)
Special version for fly--knows proper format for transcript names

Overrides:
match in class DefaultNameAdapter

suffixInUse

public boolean suffixInUse(java.util.Vector transcripts,
                           java.lang.String suffix,
                           int t_index)
A simpler signature for this might be (AnnotatedFeatureI gene, String suffix) I dont think t_index is necasary as the suffix in question should be new - even different from the transcript it came from if the trans has a name yet - but maybe im missing something

Specified by:
suffixInUse in interface ApolloNameAdapterI
Overrides:
suffixInUse in class DefaultNameAdapter

getIDPrefix

protected java.lang.String getIDPrefix(SeqFeatureI sf)
Returns the prefix of a SeqFeature's ID format (e.g. "CG" for genes)


getDefaultIDPrefix

protected java.lang.String getDefaultIDPrefix()
The prefix to use if idFormat is not specified in tiers file for a type


getPrefix

protected java.lang.String getPrefix(java.lang.String idFormat)
Given a format string (e.g. RICE\d) returns the prefix (e.g. RICE) This allows for colons ater prefix, fly doesnt.


getNewChadoDbUniquename

public java.lang.String getNewChadoDbUniquename(java.lang.String featType,
                                                long pk)

getNewChadoDbUniquename

public java.lang.String getNewChadoDbUniquename(SeqFeatureI feat,
                                                long pk)