<compilerarg value="-Xlint:-unchecked" />\r
<classpath refid="project.classpath" />\r
</javac>\r
- <!-- Complile the engines -->\r
- <javac srcdir="${basedir}/engine" destdir="${classes}" target="1.6" source="1.6" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">\r
- <compilerarg value="-Xlint:-all" />\r
- <compilerarg value="-Xlint:-unchecked" />\r
- <classpath refid="project.classpath" />\r
- </javac>\r
- <!-- Complile the runners -->\r
- <javac srcdir="${basedir}/runner" destdir="${classes}" target="1.6" source="1.6" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">\r
- <compilerarg value="-Xlint:-unchecked" />\r
- <classpath refid="project.classpath" />\r
- </javac>\r
- <!-- Complile the webservices -->\r
- <javac srcdir="${basedir}/webservices" destdir="${classes}" target="1.6" source="1.6" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">\r
- <compilerarg value="-Xlint:-unchecked" />\r
- <classpath refid="project.classpath" />\r
- </javac>\r
-\r
+ \r
</target>\r
\r
\r
}\r
\r
/**\r
+ * Remove all non AA chars from the sequence\r
+ * \r
+ * @param sequence\r
+ * the sequence to clean\r
+ * @return cleaned sequence\r
+ */\r
+ public static String cleanProteinSequence(String sequence) {\r
+ return SequenceUtil.NON_AA.matcher(sequence).replaceAll("");\r
+ }\r
+\r
+ /**\r
* @param sequence\r
* @return true is the sequence is a protein sequence, false overwise\r
*/\r
}\r
\r
@Test()\r
+ public void testCleanProteinSequence() {\r
+ String dirtySeq = "atgAGTggt\taGGTgc\ncgcAC\rTgc gACtcgcGAt cgA ";\r
+ assertFalse(SequenceUtil.isProteinSequence(dirtySeq));\r
+ // This will still be NON protein sequence despite having only correct\r
+ // letters because the letters match perfectly the nucleotide sequence!\r
+ assertFalse(SequenceUtil.isProteinSequence(SequenceUtil\r
+ .cleanProteinSequence(dirtySeq)));\r
+\r
+ String notaSeq = "atgc1tgatgcatgcatgatgmctga";\r
+ assertFalse(SequenceUtil.isProteinSequence(notaSeq));\r
+ assertTrue(SequenceUtil.isProteinSequence(SequenceUtil\r
+ .cleanProteinSequence(notaSeq)));\r
+\r
+ String AAseq = "ARLGRVRWTQQRHAEAAVLLQQASDAAPEHPGIALWLGHALEDAGQAEAAAAAYTRAHQL";\r
+ assertTrue(SequenceUtil.isProteinSequence(AAseq));\r
+ assertTrue(SequenceUtil.isProteinSequence(SequenceUtil\r
+ .cleanProteinSequence(AAseq)));\r
+ AAseq += "XU";\r
+\r
+ assertFalse(SequenceUtil.isProteinSequence(AAseq));\r
+ assertTrue(SequenceUtil.isProteinSequence(SequenceUtil\r
+ .cleanProteinSequence(AAseq)));\r
+ }\r
+\r
+ @Test()\r
public void testReadWriteFasta() {\r
\r
try {\r