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

look for orthologs made from feature_relationship connections with no match feature

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@11662 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 5bb4ff53
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,7 @@ public class ClusterLazyQualifierValue implements LazyQualifierValue
private boolean loadGeneName = false;
private String value;
private String name;
private GFFStreamFeature feature;
private List clusters;
......@@ -64,9 +65,12 @@ public class ClusterLazyQualifierValue implements LazyQualifierValue
* @param matchFeature
* @param featureId
*/
public ClusterLazyQualifierValue(final String value, final GFFStreamFeature feature)
public ClusterLazyQualifierValue(final String value,
final String name,
final GFFStreamFeature feature)
{
this.value = value;
this.name = name;
this.feature = feature;
}
......@@ -177,7 +181,34 @@ public class ClusterLazyQualifierValue implements LazyQualifierValue
final Feature clusterFeature = (Feature)clusters.get(i);
if(clusterFeature.getCvTerm().getName().indexOf("match") < 0)
{
// this looks like an ortho/paralog stored without a match feature
// and just a feature relationship between features
if(clusterFeature.getCvTerm().getName().equals("polypeptide") ||
clusterFeature.getCvTerm().getName().equals("gene"))
{
final DatabaseDocument document =
(DatabaseDocument)feature.getDocumentEntry().getDocument();
Feature matchFeature =
document.getFeatureByUniquename(clusterFeature.getUniqueName());
value = value.concat(matchFeature.getOrganism().getCommonName()+":");
if(loadGeneName)
{
String geneName = getGeneName(matchFeature);
value = value.concat(geneName+" ");
}
value = value.concat("link="+matchFeature.getUniqueName());
value = value.concat(" type="+name);
String product = getProduct(matchFeature);
if(product != null)
value = value.concat("; product="+product);
}
continue;
}
final Collection subjects = clusterFeature.getFeatureRelationshipsForSubjectId();
Iterator it = subjects.iterator();
......
......@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFStreamFeature.java,v 1.71 2009-08-14 10:16:53 tjc Exp $
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFStreamFeature.java,v 1.72 2009-08-28 10:33:12 tjc Exp $
*/
package uk.ac.sanger.artemis.io;
......@@ -51,7 +51,7 @@ import uk.ac.sanger.artemis.util.StringVector;
* A StreamFeature that thinks it is a GFF feature.
*
* @author Kim Rutherford
* @version $Id: GFFStreamFeature.java,v 1.71 2009-08-14 10:16:53 tjc Exp $
* @version $Id: GFFStreamFeature.java,v 1.72 2009-08-28 10:33:12 tjc Exp $
**/
public class GFFStreamFeature extends SimpleDocumentFeature
......@@ -362,7 +362,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature
List lazyValues = new Vector();
for(int i=0; i<values.size(); i++)
lazyValues.add(
new ClusterLazyQualifierValue( (String)values.get(i),
new ClusterLazyQualifierValue( (String)values.get(i), name,
this ));
setQualifier(new QualifierLazyLoading(name, lazyValues));
......
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