diff --git a/uk/ac/sanger/artemis/editor/FastaTextPane.java b/uk/ac/sanger/artemis/editor/FastaTextPane.java index 55b0342234aa24009d4db8d9ec5eb8056c6c2fac..9ff581903b35424985dd1e2392b26477e6dee848 100644 --- a/uk/ac/sanger/artemis/editor/FastaTextPane.java +++ b/uk/ac/sanger/artemis/editor/FastaTextPane.java @@ -231,7 +231,17 @@ public class FastaTextPane extends JScrollPane currentID = line.substring(1,ind); int indDot; if( (indDot = currentID.indexOf(".")) > 5) - currentID= currentID.substring(0,indDot); + { + String version = currentID.substring(indDot+1); + try + { + int version_no = Integer.parseInt(version); + // version number looks like uniprot so strip this + if(version_no < 50) + currentID= currentID.substring(0,indDot); + } + catch(NumberFormatException nfe){} + } } int ind2 = currentID.indexOf(":"); @@ -416,7 +426,19 @@ public class FastaTextPane extends JScrollPane int indDot; if( (indDot = currentID.indexOf(".")) > 5) - currentID= currentID.substring(0,indDot); + { + String version = currentID.substring(indDot+1); + try + { + int version_no = Integer.parseInt(version); + // version number looks like uniprot so strip this + if(version_no < 50) + currentID= currentID.substring(0,indDot); + } + catch(NumberFormatException nfe){} + + // HERE currentID= currentID.substring(0,indDot); + } if(hi != null) hi.setEndPosition(textPosition); @@ -431,6 +453,7 @@ public class FastaTextPane extends JScrollPane if(ind1 > -1) { ind2 = line.indexOf(";",ind1); + hi.setScore(line.substring(ind1+6,ind2)); ind1 = ind2+1; diff --git a/uk/ac/sanger/artemis/editor/HitInfo.java b/uk/ac/sanger/artemis/editor/HitInfo.java index c2af1258d351bb1c6a06067bbce568347d342389..c5aacf7251370a3a47fe1dff603505fb9f6685f1 100644 --- a/uk/ac/sanger/artemis/editor/HitInfo.java +++ b/uk/ac/sanger/artemis/editor/HitInfo.java @@ -117,7 +117,16 @@ public class HitInfo // uniprot fasta headers // >pac.sv id desc // - id = id.substring(0,indDot); + String version = id.substring(indDot+1); + try + { + int version_no = Integer.parseInt(version); + // version number looks like uniprot so strip this + if(version_no < 50) + id = id.substring(0,indDot); + } + catch(NumberFormatException nfe){} + acc = id; } } @@ -177,7 +186,15 @@ public class HitInfo // uniprot fasta headers // >pac.sv id desc // - id = id.substring(0,indDot); + String version = id.substring(indDot+1); + try + { + int version_no = Integer.parseInt(version); + // version number looks like uniprot so strip this + if(version_no < 50) + id = id.substring(0,indDot); + } + catch(NumberFormatException nfe){} acc = id; } }