From: amwaterhouse Date: Mon, 7 Feb 2005 17:05:18 +0000 (+0000) Subject: Now displays sequence features X-Git-Tag: Release_2_0~699 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1fbd8cb915ebe49b9d214731b810484a96081528;p=jalview.git Now displays sequence features --- diff --git a/src/jalview/analysis/AlignmentUtil.java b/src/jalview/analysis/AlignmentUtil.java index 1e0011a..24d23b2 100755 --- a/src/jalview/analysis/AlignmentUtil.java +++ b/src/jalview/analysis/AlignmentUtil.java @@ -1,9 +1,7 @@ package jalview.analysis; import jalview.datamodel.*; -import jalview.io.*; import jalview.util.*; - import java.util.*; public class AlignmentUtil { @@ -226,114 +224,9 @@ public class AlignmentUtil { return pos; } - class FeatureThread extends Thread - { - - } - - public static void addUniprotFeatures(AlignmentI align) + public static void fetchSequenceFeatures(AlignmentI al, jalview.gui.AlignmentPanel ap) { - EBIFetchClient ebi = new EBIFetchClient(); - int seqIndex = 0; - Vector sequences = align.getSequences(); - SequenceI sequence; - - while (seqIndex < sequences.size()) - { - StringBuffer ids = new StringBuffer("uniprot:"); - for (int i=0; seqIndex")>-1) - { - sequence = align.findName( parseElement( result[r], "" )) ; - features = new Vector(); - type=""; start="0"; end="0"; description=""; status=""; pdb=""; - } - - if(sequence==null) - continue; - - if( result[r].indexOf("-1) - { - pdb = parseValue( result[r], "value=" ); - sequence.setPDBId(pdb); - } - - if(result[r].indexOf("feature type")>-1) - { - type = parseValue( result[r], "type=" ); - description = parseValue( result[r], "description=" ); - status = parseValue ( result[r], "status="); - - while( result[r].indexOf("")==-1) - { - r++; // - } - r++; - if(result[r].indexOf("begin")>-1) - { - start = parseValue( result[r], "position=" ); - end = parseValue( result[++r], "position=" ); - } - else - { - start = parseValue( result[r], "position=" ); - end = parseValue( result[r], "position=" ); - } - int sstart = Integer.parseInt(start); - int eend = Integer.parseInt(end); - - if(sstart>=sequence.getStart() && eend<=sequence.getEnd()) - { - SequenceFeature sf = new SequenceFeature(type, - sstart, - eend, - description, - status); - features.add(sf); - } - } - - if(result[r].indexOf("")>-1) - { - sequence.setSequenceFeatures( features ); - features = null; - sequence = null; - } - } - } + SequenceFeatureFetcher sft = new SequenceFeatureFetcher(al, ap); } - static String parseValue(String line, String tag) - { - - int index = line.indexOf(tag)+tag.length()+1; - if(index==tag.length()) - return ""; - - return line.substring( index, line.indexOf("\"", index+1) ); - } - - - static String parseElement(String line, String tag) - { - int index = line.indexOf(tag)+tag.length(); - return line.substring( index, line.indexOf("