Skip to content
Snippets Groups Projects
Commit ac5afac8 authored by tjc's avatar tjc
Browse files

check for primary dbxref in addLazyQualifiers()

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@10750 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 278888f5
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import org.gmod.schema.general.DbXRef;
import org.gmod.schema.sequence.FeatureCvTerm;
import org.gmod.schema.sequence.FeatureDbXRef;
import org.gmod.schema.sequence.FeaturePub;
......@@ -136,6 +137,17 @@ public class GeneUtils
}
// dbxrefs
if(feature.getQualifierByName("Dbxref") == null)
{
DbXRef dbxref = feature.getChadoLazyFeature().getDbXRef();
if(dbxref != null)
{
String value = dbxref.getDb().getName() + ":" +
dbxref.getAccession();
feature.getQualifiers().setQualifier(new Qualifier("Dbxref", value));
}
}
final Collection featureDbXRefs = feature.getChadoLazyFeature().getFeatureDbXRefs();
final Iterator it2 = featureDbXRefs.iterator();
while(it2.hasNext())
......@@ -155,39 +167,40 @@ public class GeneUtils
// feature cvterms (GO, product....)
final Collection featureCvTerms = feature.getChadoLazyFeature().getFeatureCvTerms();
final Iterator it3 = featureCvTerms.iterator();
while(it3.hasNext())
if(featureCvTerms != null)
{
FeatureCvTerm featureCvTerm = (FeatureCvTerm)it3.next();
List featureCvTermDbXRefList = null;
if(featureCvTerm.getFeatureCvTermDbXRefs() != null)
featureCvTermDbXRefList = new Vector(featureCvTerm.getFeatureCvTermDbXRefs());
final Iterator it3 = featureCvTerms.iterator();
while(it3.hasNext())
{
FeatureCvTerm featureCvTerm = (FeatureCvTerm)it3.next();
List featureCvTermDbXRefList = null;
if(featureCvTerm.getFeatureCvTermDbXRefs() != null)
featureCvTermDbXRefList = new Vector(featureCvTerm.getFeatureCvTermDbXRefs());
List featureCvTermPubList = null;
List featureCvTermPubList = null;
if(featureCvTerm.getFeatureCvTermPubs() != null)
featureCvTermPubList = new Vector(featureCvTerm.getFeatureCvTermPubs());
if(featureCvTerm.getFeatureCvTermPubs() != null)
featureCvTermPubList = new Vector(featureCvTerm.getFeatureCvTermPubs());
ByteBuffer this_buff = new ByteBuffer();
DatabaseDocument.appendControlledVocabulary(this_buff, null, featureCvTerm,
ByteBuffer this_buff = new ByteBuffer();
DatabaseDocument.appendControlledVocabulary(this_buff, null, featureCvTerm,
featureCvTermDbXRefList,featureCvTermPubList, null, false);
final String qualifierString = new String(this_buff.getBytes());
int ind = qualifierString.indexOf('=');
final String name = qualifierString.substring(0, ind);
final String value = GFFStreamFeature.decode(
final String qualifierString = new String(this_buff.getBytes());
int ind = qualifierString.indexOf('=');
final String name = qualifierString.substring(0, ind);
final String value = GFFStreamFeature.decode(
qualifierString.substring(ind+1, qualifierString.length()-1));
Qualifier qualifier = feature.getQualifiers().getQualifierByName(name);
if(qualifier == null)
qualifier = new Qualifier(name, value);
else
qualifier.addValue(value);
feature.getQualifiers().setQualifier(qualifier);
Qualifier qualifier = feature.getQualifiers().getQualifierByName(name);
if(qualifier == null)
qualifier = new Qualifier(name, value);
else
qualifier.addValue(value);
feature.getQualifiers().setQualifier(qualifier);
}
}
// feature pubs - literature
final Collection featurePubs = feature.getChadoLazyFeature().getFeaturePubs();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment