[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Wed Mar 21 16:22:56 UTC 2007
gordonp
Wed Mar 21 12:22:56 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util
In directory dev.open-bio.org:/tmp/cvs-serv15695/src/main/ca/ucalgary/seahawk/util
Modified Files:
Sequence.java
Log Message:
Made sequence finding more lenient w.r.t. whitespace
moby-live/Java/src/main/ca/ucalgary/seahawk/util Sequence.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2007/02/08 16:59:58 1.2
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/Sequence.java 2007/03/21 16:22:56 1.3
@@ -12,6 +12,7 @@
* @return true if ACGTUX comprise > 2/3 of the sequence, and all non-IUPAC letters comprise less than 5%
*/
public static boolean isNucleicAcid(String sequence){
+ sequence = sequence.replaceAll("\\s", "");
String naChars = sequence.replaceAll("[^acgtunxACGTUNX]", "");
String nonNAChars = sequence.replaceAll("[acgtumrwsykvhdbnxACGTUMRWSYKVHDBNX \\-\t\r\n]", "");
double seqLen = (double) sequence.length(); // not int, because we don't want integer division
@@ -20,6 +21,7 @@
}
public static boolean isDNA(String sequence){
+ sequence = sequence.replaceAll("\\s", "");
String dnaChars = sequence.replaceAll("[^acgtnxACGTNX]", "");
String nonDNAChars = sequence.replaceAll("[acgtmrwsykvhdbnxACGTMRWSYKVHDBNX \\-\t\r\n]", "");
double seqLen = (double) sequence.length(); // not int, because we don't want integer division
@@ -27,6 +29,7 @@
}
public static boolean isRNA(String sequence){
+ sequence = sequence.replaceAll("\\s", "");
String rnaChars = sequence.replaceAll("[^acgunxACGUNX]", "");
String nonRNAChars = sequence.replaceAll("[acgumrwsykvhdbnxACGUMRWSYKVHDBNX \\-\t\r\n]", "");
double seqLen = (double) sequence.length(); // not int, because we don't want integer division
@@ -34,6 +37,7 @@
}
public static boolean isProtein(String sequence){
+ sequence = sequence.replaceAll("\\s", "");
String protChars = sequence.replaceAll("[^ARNDCQEGHILKMFPSTWYVBZXarndcqeghilkmfpstwyvbz*]", "");
String nonProtChars = sequence.replaceAll("[ARNDCQEGHILKMFPSTWYVBZXarndcqeghilkmfpstwyvbz \\-\t\r\n]", "");
double seqLen = (double) sequence.length(); // not int, because we don't want integer division
More information about the MOBY-guts
mailing list