Update of /cvsroot/gmod/apollo/src/java/apollo/dataadapter/chadoxml
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1627/apollo/dataadapter/chadoxml
Modified Files:
ChadoXmlAdapter.java
Log Message:
Now that we're treating one-level annots as one-levels (rather than
promoting them to three levels), we expect them to be identified as such
in the tiers file:
number_of_levels : 1
If the user has an out-of-date tiers file without this line for a
one-level type, the one-level annot will not show up. Pop up a warning.
Index: ChadoXmlAdapter.java
===================================================================
RCS file: /cvsroot/gmod/apollo/src/java/apollo/dataadapter/chadoxml/ChadoXmlAdapter.java,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -d -r1.84 -r1.85
*** ChadoXmlAdapter.java 18 Dec 2005 05:12:48 -0000 1.84
--- ChadoXmlAdapter.java 19 Dec 2005 22:10:22 -0000 1.85
***************
*** 622,642 ****
}
// If annot is unstranded, it won't show up--temporarily force it onto a strand.
forceStrandIfNeeded(annot);
- // Apollo expects annotations to have transcripts, even those that shouldn't,
- // like transposable_element. In GAME XML, even transposable_elements have
- // fake transcripts, like this:
- // <annotation id="TE19303">
- // <feature_set id="TE19303-RA">
- // Apollo shouldn't make that assumption, but because it does, we may need
- // to construct these fake transcripts (and exons) for annotations that are
- // missing them. (And then when we write out those annots in Chado XML,
- // we need to make sure not to write the fake transcript!)
- //
- // 11/2005: Apollo can now handle one-level annots, so no need to make
- // fake transcripts.
- // makeFakeTranscriptIfNeeded(annot, curation);
-
// If annot doesn't have a name, use its ID as a name
// (need a name for it to display as a label).
--- 622,636 ----
}
+ // Now that we're treating one-level annots as one-levels (rather than
+ // promoting them to three levels), we expect them to be identified as such
+ // in the tiers file:
+ // number_of_levels : 1
+ // If the user has an out-of-date tiers file without this line for a
+ // one-level type, the one-level annot will not show up. Pop up a warning.
+ warnIfOneLevelDiscrepancy(annot);
+
// If annot is unstranded, it won't show up--temporarily force it onto a strand.
forceStrandIfNeeded(annot);
// If annot doesn't have a name, use its ID as a name
// (need a name for it to display as a label).
***************
*** 649,652 ****
--- 643,662 ----
}
+ /** Now that we're treating one-level annots as one-levels (rather than
+ * promoting them to three levels), we expect them to be identified as such
+ * in the tiers file:
+ * number_of_levels : 1
+ * If the user has an out-of-date tiers file without this line for a
+ * one-level type, the one-level annot will not show up. Pop up a warning. */
+ private void warnIfOneLevelDiscrepancy(SeqFeature annot) {
+ if ((annot.getFeatures() == null || annot.getFeatures().size() == 0)) {
+ FeatureProperty fp = Config.getPropertyScheme().getFeatureProperty(annot.getFeatureType());
+ if (fp.getNumberOfLevels() != 1) {
+ // errorDialog prints the message to stderr if we're running in command-line mode
+ apollo.util.IOUtil.errorDialog("Annotation " + annot.getName() + " is one-level, but type " + annot.getFeatureType() + "\ndoes not have 'number_of_levels: 1' in tiers file " + Config.getStyle().getTiersFile() + ".\nEither the data is buggy or your tiers file is out of date.");
+ }
+ }
+ }
+
/** Wordy chadoXML way to store feature type is
<type_id> <cvterm> <cv_id> <cv> <name>SO</name> </cv> </cv_id>
|