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

uniprot version no. fix

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@4130 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 5ce8a34e
No related branches found
No related tags found
No related merge requests found
...@@ -231,7 +231,17 @@ public class FastaTextPane extends JScrollPane ...@@ -231,7 +231,17 @@ public class FastaTextPane extends JScrollPane
currentID = line.substring(1,ind); currentID = line.substring(1,ind);
int indDot; int indDot;
if( (indDot = currentID.indexOf(".")) > 5) 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(":"); int ind2 = currentID.indexOf(":");
...@@ -416,7 +426,19 @@ public class FastaTextPane extends JScrollPane ...@@ -416,7 +426,19 @@ public class FastaTextPane extends JScrollPane
int indDot; int indDot;
if( (indDot = currentID.indexOf(".")) > 5) 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) if(hi != null)
hi.setEndPosition(textPosition); hi.setEndPosition(textPosition);
...@@ -431,6 +453,7 @@ public class FastaTextPane extends JScrollPane ...@@ -431,6 +453,7 @@ public class FastaTextPane extends JScrollPane
if(ind1 > -1) if(ind1 > -1)
{ {
ind2 = line.indexOf(";",ind1); ind2 = line.indexOf(";",ind1);
hi.setScore(line.substring(ind1+6,ind2)); hi.setScore(line.substring(ind1+6,ind2));
ind1 = ind2+1; ind1 = ind2+1;
......
...@@ -117,7 +117,16 @@ public class HitInfo ...@@ -117,7 +117,16 @@ public class HitInfo
// uniprot fasta headers // uniprot fasta headers
// >pac.sv id desc // >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; acc = id;
} }
} }
...@@ -177,7 +186,15 @@ public class HitInfo ...@@ -177,7 +186,15 @@ public class HitInfo
// uniprot fasta headers // uniprot fasta headers
// >pac.sv id desc // >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; acc = id;
} }
} }
......
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