|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectapollo.dataadapter.chado.jdbc.PureJDBCTransactionWriter
public class PureJDBCTransactionWriter
An alternative to JDBCTransactionWriter that:
| Field Summary | |
|---|---|
protected ChadoAdapter |
adapter
|
protected boolean |
copyOnWrite
|
protected JdbcChadoAdapter |
jdbcAdapter
|
protected boolean |
logApolloTransactions
|
protected static org.apache.log4j.Logger |
logger
|
protected boolean |
logSql
|
protected boolean |
noCommit
|
protected boolean |
useCDS
|
| Constructor Summary | |
|---|---|
PureJDBCTransactionWriter(ChadoAdapter adapter,
JdbcChadoAdapter jdbcAdapter,
boolean copyOnWrite,
boolean noCommit,
boolean useCDS)
|
|
| Method Summary | |
|---|---|
protected boolean |
addComment(long annotId,
Comment comment)
Add a comment to the database |
protected boolean |
addComment(SeqFeatureI feature,
AddTransaction t)
Comment strings look like this: Only one EST supports this alternative transcript::DATE:Mon Feb 26 18:08:49 CET 2007::TS:1172509728919 With the author in the pub table |
protected void |
addComments(AnnotatedFeatureI annot)
Add all comments from an AnnotatedFeatureI object |
protected boolean |
addDbXref(long featureId,
DbXref dbx)
|
protected boolean |
addDbXref(SeqFeatureI feature,
AddTransaction t)
|
protected void |
addDbxrefs(AnnotatedFeatureI annot)
Add all dbxrefs from an AnnotatedFeatureI object |
protected java.lang.Long |
addExon(SeqFeatureI exon,
java.lang.String author,
java.util.Date date,
java.lang.Long transId,
int exonNum,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature,
boolean checkExons)
Add an exon to a transcript, inserting the exon into the database if it does not already exist. |
protected java.lang.Long |
addGene(SeqFeatureI gene,
java.lang.String author,
java.util.Date date,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature,
boolean checkExons)
Add a gene to the chado database. |
protected java.lang.Long |
addSequenceEdit(SequenceEdit seqEdit,
java.lang.String author,
java.util.Date date)
|
protected boolean |
addSynonym(long annotId,
java.lang.String name)
Add a synonym to the database |
protected boolean |
addSynonym(SeqFeatureI feature,
AddTransaction t)
|
protected void |
addSynonyms(AnnotatedFeatureI annot)
Add all synonyms from an AnnotatedFeatureI object |
protected java.lang.Long |
addTopLevelAnnot(SeqFeatureI annot,
java.lang.String author,
java.util.Date date,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature)
Add a top level annotation to the chado database. |
protected java.lang.Long |
addTranscript(Transcript transcript,
java.lang.String author,
java.util.Date date,
java.lang.Long geneId,
long transcriptRank,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature,
boolean checkExons)
Add a transcript to the chado database. |
protected boolean |
commitAddTransaction(java.lang.String transId,
AddTransaction t,
boolean checkExons)
|
protected boolean |
commitDeleteTransaction(java.lang.String transId,
DeleteTransaction dt)
|
protected boolean |
commitTransaction(java.lang.String transId,
int numTransactions,
Transaction t,
boolean checkExons)
|
boolean |
commitTransactions(TransactionManager tm)
Write a set of transactions to the database using adapter |
protected boolean |
commitUpdateParentTransaction(java.lang.String transId,
UpdateParentTransaction t)
|
protected boolean |
commitUpdateTransaction(java.lang.String transId,
UpdateTransaction ut)
|
protected boolean |
deleteCDS(long featureId)
|
protected boolean |
deleteComment(long annotId,
Comment comment)
|
protected boolean |
deleteDbXref(long annotId,
DbXref dbXref)
|
protected boolean |
deleteExon(long exonId,
long transcriptId)
Delete an exon from the database (defaults to not checking if it is a shared exon |
protected boolean |
deleteExon(long exonId,
long transcriptId,
boolean checkExon)
Delete an exon from the database |
protected boolean |
deleteGene(long featureId)
|
protected boolean |
deletePolypeptide(long featureId)
|
protected boolean |
deleteSynonym(long annotId,
java.lang.String name)
Delete a synonym from the database |
protected boolean |
deleteTranscript(long featureId)
|
protected boolean |
deleteTranscript(long featureId,
boolean checkExons)
|
protected void |
fatalError(java.lang.String error)
|
protected apollo.dataadapter.chado.jdbc.ChadoCds |
getCdsCoordinatesFromTranscript(Transcript transcript,
int tfmin,
int tfmax)
Figure out chado CDS coordinates and sequence based on the Apollo transcript. |
protected java.lang.String |
getChadoCdsName(ApolloNameAdapterI nameAdapter,
java.lang.String name)
|
protected long |
getChadoFeatureId(SeqFeatureI feature)
|
protected long |
getChadoIdForFeature(SeqFeatureI f)
Retrieve the chado primary key value for a given feature, or -1 if the feature does not exist in the database. |
protected int |
getChadoIsAnalysis(SeqFeatureI feat)
Determine what value to place in the chado feature.is_analysis column for an Apollo feature. |
protected int |
getChadoLocgroup(long feature_id,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature)
|
protected int |
getChadoLocgroup(SeqFeatureI feat,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature)
Compute the chado featureloc.locgroup for an Apollo feature. |
protected java.lang.String |
getChadoPeptideName(ApolloNameAdapterI nameAdapter,
java.lang.String name,
SeqFeatureI pfeat)
|
protected java.lang.Long |
getChadoPrimaryDbxrefId(SeqFeatureI feat)
Determine what to put in the feature.dbxref_id column for an Apollo feature. |
protected java.lang.Long |
getChadoRelationshipCvTermId(java.lang.String cvName)
|
protected java.lang.String |
getChadoResidues(SeqFeatureI feat)
Determine what value to place in the chado feature.residues column for an Apollo feature. |
protected AnnotatedFeatureI |
getSeqEditRefFeature(SequenceEdit seqEdit)
|
protected void |
logTransactionList(java.util.List tlist)
|
protected boolean |
updateCdsFeatureLocation(long featureId,
Transcript transcript,
RangeI oldLocn)
Update the location of a transcript's CDS and polypeptide. |
protected boolean |
updateFeatureLocation(long featureId,
RangeI oldLocn,
apollo.dataadapter.chado.jdbc.ChadoFeatureLoc newLoc)
Update the location of a gene-related feature, e.g. |
protected boolean |
updateFeatureName(long featureId,
java.lang.String newName,
boolean isName)
Update the name |
protected boolean |
updateFeatureType(long featureId,
java.lang.String newType)
Update the type |
protected boolean |
updateOwner(long annotId,
java.lang.String newStatus,
java.lang.String oldStatus)
|
protected boolean |
updateStatus(long annotId,
java.lang.String statusTerm,
java.lang.String newStatus,
java.lang.String oldStatus)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger logger
protected ChadoAdapter adapter
protected JdbcChadoAdapter jdbcAdapter
protected boolean copyOnWrite
protected boolean noCommit
protected boolean logApolloTransactions
protected boolean logSql
protected boolean useCDS
| Constructor Detail |
|---|
public PureJDBCTransactionWriter(ChadoAdapter adapter,
JdbcChadoAdapter jdbcAdapter,
boolean copyOnWrite,
boolean noCommit,
boolean useCDS)
adapter - ChadoAdapter to use for writing changesjdbcAdapter - JdbcChadoAdapter to use for writing changescopyOnWrite - Whether to keep a copy of the old object(s) when writing changes.noCommit - Whether to run in 'no commit' mode.| Method Detail |
|---|
public boolean commitTransactions(TransactionManager tm)
adapter
tm - TransactionManager that contains the uncommitted transactions to write.
protected void logTransactionList(java.util.List tlist)
protected boolean commitTransaction(java.lang.String transId,
int numTransactions,
Transaction t,
boolean checkExons)
checkExons - whether to check database for exons in addExonprotected long getChadoFeatureId(SeqFeatureI feature)
protected boolean commitUpdateParentTransaction(java.lang.String transId,
UpdateParentTransaction t)
protected boolean commitAddTransaction(java.lang.String transId,
AddTransaction t,
boolean checkExons)
checkExons - whether to check database for exons in addExon
protected java.lang.Long addTopLevelAnnot(SeqFeatureI annot,
java.lang.String author,
java.util.Date date,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature)
annot - Apollo feature that represents the top level annotationauthor - Author string from the Apollo transaction.date - Date from the Apollo transaction.srcFeature - Chado feature on which the gene is located. May be null.
protected java.lang.Long addGene(SeqFeatureI gene,
java.lang.String author,
java.util.Date date,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature,
boolean checkExons)
gene - Apollo feature that represents the gene.author - Author string from the Apollo transaction.date - Date from the Apollo transaction.srcFeature - Chado feature on which the gene is located. May be null.checkExons - whether to check database for exons in addExon
protected java.lang.Long addTranscript(Transcript transcript,
java.lang.String author,
java.util.Date date,
java.lang.Long geneId,
long transcriptRank,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature,
boolean checkExons)
transcript - Apollo feature that represents the transcript/mRNA.author - Author string from the Apollo transaction.date - Date from the Apollo transaction.geneId - Chado feature.feature_id of the gene to which the transcript belongs.transcriptRank - Rank of the transcript with respect to the gene.srcFeature - Chado feature on which the transcript is located. May be null.checkExons - whether to check database for exons in addExon
protected java.lang.Long addExon(SeqFeatureI exon,
java.lang.String author,
java.util.Date date,
java.lang.Long transId,
int exonNum,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature,
boolean checkExons)
exon - Apollo feature that represents the exon.author - Author string from the Apollo transaction.date - Date from the Apollo transaction.transId - Chado feature.feature_id of the transcript to which the exon belongs.exonNum - Index of the exon in the transcript (counting from 0, as per chado feature_relationship.rank)srcFeature - Chado feature on which the exon is located. May be null.checkExons - whether to check database for exons in addExon
protected boolean addSynonym(SeqFeatureI feature,
AddTransaction t)
protected boolean addComment(SeqFeatureI feature,
AddTransaction t)
protected void addDbxrefs(AnnotatedFeatureI annot)
annot - - annotation to store dbxrefs from
protected boolean addDbXref(SeqFeatureI feature,
AddTransaction t)
protected boolean addDbXref(long featureId,
DbXref dbx)
protected boolean deleteDbXref(long annotId,
DbXref dbXref)
protected java.lang.Long addSequenceEdit(SequenceEdit seqEdit,
java.lang.String author,
java.util.Date date)
protected int getChadoLocgroup(SeqFeatureI feat,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature)
feat - Apollo feature.srcFeature - Chado feature on which feat is located (determines locgroup).
protected int getChadoLocgroup(long feature_id,
apollo.dataadapter.chado.jdbc.ChadoFeature srcFeature)
protected java.lang.Long getChadoPrimaryDbxrefId(SeqFeatureI feat)
feat - Apollo feature.protected int getChadoIsAnalysis(SeqFeatureI feat)
feat - Apollo feature.protected java.lang.String getChadoResidues(SeqFeatureI feat)
feat - Apollo featureprotected java.lang.Long getChadoRelationshipCvTermId(java.lang.String cvName)
protected boolean commitDeleteTransaction(java.lang.String transId,
DeleteTransaction dt)
protected boolean deleteExon(long exonId,
long transcriptId)
exonId - - feature.feature_id of the exontranscriptId - - feature.feature_id of the parent transcript
protected boolean deleteExon(long exonId,
long transcriptId,
boolean checkExon)
exonId - - feature.feature_id of the exontranscriptId - - feature.feature_id of the parent transcriptcheckExon - - check to see that this exon is not shared before deletion
protected boolean deleteTranscript(long featureId)
protected boolean deleteTranscript(long featureId,
boolean checkExons)
protected boolean deleteCDS(long featureId)
protected boolean deletePolypeptide(long featureId)
protected boolean deleteGene(long featureId)
protected boolean commitUpdateTransaction(java.lang.String transId,
UpdateTransaction ut)
protected boolean updateCdsFeatureLocation(long featureId,
Transcript transcript,
RangeI oldLocn)
featureId - Chado feature id that corresponds to transcripttranscript - Apollo transcript whose peptide has changedoldLocn - The range of the old CDS feature location. MAY BE NULL.
protected boolean updateFeatureLocation(long featureId,
RangeI oldLocn,
apollo.dataadapter.chado.jdbc.ChadoFeatureLoc newLoc)
protected boolean updateFeatureName(long featureId,
java.lang.String newName,
boolean isName)
protected boolean updateFeatureType(long featureId,
java.lang.String newType)
protected void fatalError(java.lang.String error)
protected long getChadoIdForFeature(SeqFeatureI f)
protected apollo.dataadapter.chado.jdbc.ChadoCds getCdsCoordinatesFromTranscript(Transcript transcript,
int tfmin,
int tfmax)
protected void addSynonyms(AnnotatedFeatureI annot)
annot - - annotation to store synonyms from
protected boolean addSynonym(long annotId,
java.lang.String name)
annotId - - Chado ID for owner annotationname - - Synonym
protected boolean deleteSynonym(long annotId,
java.lang.String name)
annotId - - Chado ID for owner annotationname - - Synonym
protected void addComments(AnnotatedFeatureI annot)
annot - - annotation to store comments from
protected boolean addComment(long annotId,
Comment comment)
annotId - - Chado ID for owner annotationcomment - - Comment object
protected boolean deleteComment(long annotId,
Comment comment)
protected boolean updateStatus(long annotId,
java.lang.String statusTerm,
java.lang.String newStatus,
java.lang.String oldStatus)
protected boolean updateOwner(long annotId,
java.lang.String newStatus,
java.lang.String oldStatus)
protected java.lang.String getChadoCdsName(ApolloNameAdapterI nameAdapter,
java.lang.String name)
protected java.lang.String getChadoPeptideName(ApolloNameAdapterI nameAdapter,
java.lang.String name,
SeqFeatureI pfeat)
protected AnnotatedFeatureI getSeqEditRefFeature(SequenceEdit seqEdit)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||