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

allow multiple GO terms with the same id and different evidence codes

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@10968 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 06c63b4f
No related branches found
No related tags found
No related merge requests found
...@@ -354,6 +354,9 @@ public class GoBox extends AbstractCvBox ...@@ -354,6 +354,9 @@ public class GoBox extends AbstractCvBox
return value_index; return value_index;
} }
/**
* Update the qualifier from the GO form.
*/
protected void updateQualifier(final QualifierVector qv) protected void updateQualifier(final QualifierVector qv)
{ {
int index = qv.indexOfQualifierWithName(origQualifier.getName()); int index = qv.indexOfQualifierWithName(origQualifier.getName());
...@@ -362,19 +365,51 @@ public class GoBox extends AbstractCvBox ...@@ -362,19 +365,51 @@ public class GoBox extends AbstractCvBox
final String goId = getField("GOid=", origQualifierString); final String goId = getField("GOid=", origQualifierString);
StringVector values = newQualifier.getValues(); StringVector values = newQualifier.getValues();
Vector values_index = new Vector();
int value_index = -10;
for(int i=0; i<values.size(); i++) for(int i=0; i<values.size(); i++)
{ {
String newGoId = getField("GOid=", (String)values.get(i)); String newGoId = getField("GOid=", (String)values.get(i));
if(newGoId.equals(goId)) if(newGoId.equals(goId))
values_index.add(new Integer(i));
}
int value_index = -99;
if(values_index.size() > 0)
{
if(values_index.size() == 1)
value_index = ((Integer)values_index.get(0)).intValue();
else
{ {
value_index = i; final String with = getField("with=", origQualifierString);
break; final String evidence = getField("evidence=", origQualifierString);
final String dbxref = getField("dbxref=", origQualifierString);
for(int i=0; i<values_index.size(); i++)
{
int ind = ((Integer)values_index.get(i)).intValue();
value_index = ind;
String value = (String) values.get(ind);
String thisEvidence = getField("evidence=", value);
if(thisEvidence.equals(evidence))
break;
if(!with.equals(""))
{
String thisWith = getField("with=", value);
if(thisWith.equals(with))
break;
}
if(!dbxref.equals(""))
{
String thisDbxref = getField("dbxref=", value);
if(thisDbxref.equals(dbxref))
break;
}
}
} }
} }
if(value_index > -1) if(value_index > -1)
values.remove(value_index); values.remove(value_index);
......
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