1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
\r
5 <!-- Generated by javadoc (build 1.6.0_24) on Wed Dec 07 12:08:24 GMT 2011 -->
\r
10 <META NAME="date" CONTENT="2011-12-07">
\r
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
\r
14 <SCRIPT type="text/javascript">
\r
15 function windowTitle()
\r
17 if (location.href.indexOf('is-external=true') == -1) {
\r
18 parent.document.title="SequenceUtil";
\r
27 <BODY BGCOLOR="white" onload="windowTitle();">
\r
31 <!-- ========= START OF TOP NAVBAR ======= -->
\r
32 <A NAME="navbar_top"><!-- --></A>
\r
33 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
\r
34 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
\r
36 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
\r
37 <A NAME="navbar_top_firstrow"><!-- --></A>
\r
38 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
\r
39 <TR ALIGN="center" VALIGN="top">
\r
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
\r
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
\r
42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
\r
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SequenceUtil.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
\r
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
\r
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
\r
46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
\r
47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
\r
51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
\r
57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
58 <A HREF="../../../compbio/data/sequence/ScoreManager.ScoreHolder.html" title="class in compbio.data.sequence"><B>PREV CLASS</B></A>
\r
59 <A HREF="../../../compbio/data/sequence/SMERFSConstraints.html" title="enum in compbio.data.sequence"><B>NEXT CLASS</B></A></FONT></TD>
\r
60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
61 <A HREF="../../../index.html?compbio/data/sequence/SequenceUtil.html" target="_top"><B>FRAMES</B></A>
\r
62 <A HREF="SequenceUtil.html" target="_top"><B>NO FRAMES</B></A>
\r
63 <SCRIPT type="text/javascript">
\r
66 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
\r
71 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
\r
78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
79 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
81 DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
\r
84 <A NAME="skip-navbar_top"></A>
\r
85 <!-- ========= END OF TOP NAVBAR ========= -->
\r
88 <!-- ======== START OF CLASS DATA ======== -->
\r
91 compbio.data.sequence</FONT>
\r
93 Class SequenceUtil</H2>
\r
96 <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>compbio.data.sequence.SequenceUtil</B>
\r
100 <DT><PRE>public final class <B>SequenceUtil</B><DT>extends java.lang.Object</DL>
\r
104 Utility class for operations on sequences
\r
109 <DT><B>Since:</B></DT>
\r
111 <DT><B>Version:</B></DT>
\r
112 <DD>2.0 June 2011</DD>
\r
113 <DT><B>Author:</B></DT>
\r
114 <DD>Peter Troshin</DD>
\r
119 <!-- =========== FIELD SUMMARY =========== -->
\r
121 <A NAME="field_summary"><!-- --></A>
\r
122 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
123 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
124 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
\r
125 <B>Field Summary</B></FONT></TH>
\r
127 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
128 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
129 <CODE>static java.util.regex.Pattern</CODE></FONT></TD>
\r
130 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#AA">AA</A></B></CODE>
\r
133 Valid Amino acids</TD>
\r
135 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
136 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
137 <CODE>static java.util.regex.Pattern</CODE></FONT></TD>
\r
138 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#AMBIGUOUS_AA">AMBIGUOUS_AA</A></B></CODE>
\r
141 Same as AA pattern but with two additional letters - XU</TD>
\r
143 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
144 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
145 <CODE>static java.util.regex.Pattern</CODE></FONT></TD>
\r
146 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#AMBIGUOUS_NUCLEOTIDE">AMBIGUOUS_NUCLEOTIDE</A></B></CODE>
\r
149 Ambiguous nucleotide</TD>
\r
151 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
152 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
153 <CODE>static java.util.regex.Pattern</CODE></FONT></TD>
\r
154 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#DIGIT">DIGIT</A></B></CODE>
\r
157 A digit</TD>
\r
159 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
160 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
161 <CODE>static java.util.regex.Pattern</CODE></FONT></TD>
\r
162 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#NON_AA">NON_AA</A></B></CODE>
\r
165 inversion of AA pattern</TD>
\r
167 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
168 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
169 <CODE>static java.util.regex.Pattern</CODE></FONT></TD>
\r
170 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#NON_NUCLEOTIDE">NON_NUCLEOTIDE</A></B></CODE>
\r
173 Non nucleotide</TD>
\r
175 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
176 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
177 <CODE>static java.util.regex.Pattern</CODE></FONT></TD>
\r
178 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#NONWORD">NONWORD</A></B></CODE>
\r
181 Non word</TD>
\r
183 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
184 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
185 <CODE>static java.util.regex.Pattern</CODE></FONT></TD>
\r
186 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#NUCLEOTIDE">NUCLEOTIDE</A></B></CODE>
\r
189 Nucleotides a, t, g, c, u</TD>
\r
191 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
192 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
193 <CODE>static java.util.regex.Pattern</CODE></FONT></TD>
\r
194 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#WHITE_SPACE">WHITE_SPACE</A></B></CODE>
\r
197 A whitespace character: [\t\n\x0B\f\r]</TD>
\r
201 <!-- ========== METHOD SUMMARY =========== -->
\r
203 <A NAME="method_summary"><!-- --></A>
\r
204 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
205 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
206 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
\r
207 <B>Method Summary</B></FONT></TH>
\r
209 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
210 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
211 <CODE>static java.lang.String</CODE></FONT></TD>
\r
212 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#cleanProteinSequence(java.lang.String)">cleanProteinSequence</A></B>(java.lang.String sequence)</CODE>
\r
215 Remove all non AA chars from the sequence</TD>
\r
217 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
218 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
219 <CODE>static java.lang.String</CODE></FONT></TD>
\r
220 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#cleanSequence(java.lang.String)">cleanSequence</A></B>(java.lang.String sequence)</CODE>
\r
223 Removes all whitespace chars in the sequence string</TD>
\r
225 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
226 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
227 <CODE>static void</CODE></FONT></TD>
\r
228 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#closeSilently(java.util.logging.Logger, java.io.Closeable)">closeSilently</A></B>(java.util.logging.Logger log,
\r
229 java.io.Closeable stream)</CODE>
\r
232 Closes the Closable and logs the exception if any</TD>
\r
234 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
235 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
236 <CODE>static java.lang.String</CODE></FONT></TD>
\r
237 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#deepCleanSequence(java.lang.String)">deepCleanSequence</A></B>(java.lang.String sequence)</CODE>
\r
240 Removes all special characters and digits as well as whitespace chars
241 from the sequence</TD>
\r
243 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
244 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
245 <CODE>static boolean</CODE></FONT></TD>
\r
246 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#isAmbiguosProtein(java.lang.String)">isAmbiguosProtein</A></B>(java.lang.String sequence)</CODE>
\r
249 Check whether the sequence confirms to amboguous protein sequence</TD>
\r
251 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
252 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
253 <CODE>static boolean</CODE></FONT></TD>
\r
254 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#isNonAmbNucleotideSequence(java.lang.String)">isNonAmbNucleotideSequence</A></B>(java.lang.String sequence)</CODE>
\r
257 Ambiguous DNA chars : AGTCRYMKSWHBVDN // differs from protein in only one
260 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
261 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
262 <CODE>static boolean</CODE></FONT></TD>
\r
263 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#isNucleotideSequence(compbio.data.sequence.FastaSequence)">isNucleotideSequence</A></B>(<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A> s)</CODE>
\r
266 </TD>
\r
268 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
269 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
270 <CODE>static boolean</CODE></FONT></TD>
\r
271 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#isProteinSequence(java.lang.String)">isProteinSequence</A></B>(java.lang.String sequence)</CODE>
\r
274 </TD>
\r
276 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
277 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
278 <CODE>static java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>></CODE></FONT></TD>
\r
279 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#openInputStream(java.lang.String)">openInputStream</A></B>(java.lang.String inFilePath)</CODE>
\r
282 Reads and parses Fasta or Clustal formatted file into a list of
283 FastaSequence objects</TD>
\r
285 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
286 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
287 <CODE>static java.util.HashSet<<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>></CODE></FONT></TD>
\r
288 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#readAAConResults(java.io.InputStream)">readAAConResults</A></B>(java.io.InputStream results)</CODE>
\r
291 Read AACon result with no alignment files.</TD>
\r
293 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
294 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
295 <CODE>static java.util.HashMap<java.lang.String,java.util.Set<<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>>></CODE></FONT></TD>
\r
296 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#readDisembl(java.io.InputStream)">readDisembl</A></B>(java.io.InputStream input)</CODE>
\r
299 > Foobar_dundeefriends
301 # COILS 34-41, 50-58, 83-91, 118-127, 160-169, 191-220, 243-252, 287-343
307 # RESIDUE COILS REM465 HOTLOOPS
309 M 0.86010 0.88512 0.37094
311 T 0.79983 0.85864 0.44331
313 >Next Sequence name</TD>
\r
315 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
316 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
317 <CODE>static java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>></CODE></FONT></TD>
\r
318 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#readFasta(java.io.InputStream)">readFasta</A></B>(java.io.InputStream inStream)</CODE>
\r
321 Reads fasta sequences from inStream into the list of FastaSequence
324 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
325 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
326 <CODE>static java.util.HashMap<java.lang.String,java.util.Set<<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>>></CODE></FONT></TD>
\r
327 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#readGlobPlot(java.io.InputStream)">readGlobPlot</A></B>(java.io.InputStream input)</CODE>
\r
330 > Foobar_dundeefriends
332 # COILS 34-41, 50-58, 83-91, 118-127, 160-169, 191-220, 243-252, 287-343
338 # RESIDUE COILS REM465 HOTLOOPS
340 M 0.86010 0.88512 0.37094
342 T 0.79983 0.85864 0.44331
344 >Next Sequence name</TD>
\r
346 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
347 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
348 <CODE>static java.util.Map<java.lang.String,<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>></CODE></FONT></TD>
\r
349 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#readIUPred(java.io.File)">readIUPred</A></B>(java.io.File result)</CODE>
\r
352 Read IUPred output</TD>
\r
354 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
355 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
356 <CODE>static java.util.Map<java.lang.String,<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>></CODE></FONT></TD>
\r
357 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#readJRonn(java.io.File)">readJRonn</A></B>(java.io.File result)</CODE>
\r
360 </TD>
\r
362 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
363 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
364 <CODE>static java.util.Map<java.lang.String,<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>></CODE></FONT></TD>
\r
365 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#readJRonn(java.io.InputStream)">readJRonn</A></B>(java.io.InputStream inStream)</CODE>
\r
368 Reader for JRonn horizontal file format</TD>
\r
370 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
371 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
372 <CODE>static void</CODE></FONT></TD>
\r
373 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#writeFasta(java.io.OutputStream, java.util.List)">writeFasta</A></B>(java.io.OutputStream os,
\r
374 java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>> sequences)</CODE>
\r
377 Writes FastaSequence in the file, each sequence will take one line only</TD>
\r
379 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
380 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
381 <CODE>static void</CODE></FONT></TD>
\r
382 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#writeFasta(java.io.OutputStream, java.util.List, int)">writeFasta</A></B>(java.io.OutputStream outstream,
\r
383 java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>> sequences,
\r
384 int width)</CODE>
\r
387 Writes list of FastaSequeces into the outstream formatting the sequence
388 so that it contains width chars on each line</TD>
\r
390 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
391 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
392 <CODE>static void</CODE></FONT></TD>
\r
393 <TD><CODE><B><A HREF="../../../compbio/data/sequence/SequenceUtil.html#writeFastaKeepTheStream(java.io.OutputStream, java.util.List, int)">writeFastaKeepTheStream</A></B>(java.io.OutputStream outstream,
\r
394 java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>> sequences,
\r
395 int width)</CODE>
\r
398 </TD>
\r
401 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
\r
402 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
403 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
\r
404 <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
\r
406 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
407 <TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
\r
413 <!-- ============ FIELD DETAIL =========== -->
\r
415 <A NAME="field_detail"><!-- --></A>
\r
416 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
417 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
418 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
\r
419 <B>Field Detail</B></FONT></TH>
\r
423 <A NAME="WHITE_SPACE"><!-- --></A><H3>
\r
426 public static final java.util.regex.Pattern <B>WHITE_SPACE</B></PRE>
\r
428 <DD>A whitespace character: [\t\n\x0B\f\r]
\r
435 <A NAME="DIGIT"><!-- --></A><H3>
\r
438 public static final java.util.regex.Pattern <B>DIGIT</B></PRE>
\r
447 <A NAME="NONWORD"><!-- --></A><H3>
\r
450 public static final java.util.regex.Pattern <B>NONWORD</B></PRE>
\r
459 <A NAME="AA"><!-- --></A><H3>
\r
462 public static final java.util.regex.Pattern <B>AA</B></PRE>
\r
464 <DD>Valid Amino acids
\r
471 <A NAME="NON_AA"><!-- --></A><H3>
\r
474 public static final java.util.regex.Pattern <B>NON_AA</B></PRE>
\r
476 <DD>inversion of AA pattern
\r
483 <A NAME="AMBIGUOUS_AA"><!-- --></A><H3>
\r
486 public static final java.util.regex.Pattern <B>AMBIGUOUS_AA</B></PRE>
\r
488 <DD>Same as AA pattern but with two additional letters - XU
\r
495 <A NAME="NUCLEOTIDE"><!-- --></A><H3>
\r
498 public static final java.util.regex.Pattern <B>NUCLEOTIDE</B></PRE>
\r
500 <DD>Nucleotides a, t, g, c, u
\r
507 <A NAME="AMBIGUOUS_NUCLEOTIDE"><!-- --></A><H3>
\r
508 AMBIGUOUS_NUCLEOTIDE</H3>
\r
510 public static final java.util.regex.Pattern <B>AMBIGUOUS_NUCLEOTIDE</B></PRE>
\r
512 <DD>Ambiguous nucleotide
\r
519 <A NAME="NON_NUCLEOTIDE"><!-- --></A><H3>
\r
520 NON_NUCLEOTIDE</H3>
\r
522 public static final java.util.regex.Pattern <B>NON_NUCLEOTIDE</B></PRE>
\r
530 <!-- ============ METHOD DETAIL ========== -->
\r
532 <A NAME="method_detail"><!-- --></A>
\r
533 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
534 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
535 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
\r
536 <B>Method Detail</B></FONT></TH>
\r
540 <A NAME="isNucleotideSequence(compbio.data.sequence.FastaSequence)"><!-- --></A><H3>
\r
541 isNucleotideSequence</H3>
\r
543 public static boolean <B>isNucleotideSequence</B>(<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A> s)</PRE>
\r
547 <DT><B>Returns:</B><DD>true is the sequence contains only letters a,c, t, g, u</DL>
\r
552 <A NAME="isNonAmbNucleotideSequence(java.lang.String)"><!-- --></A><H3>
\r
553 isNonAmbNucleotideSequence</H3>
\r
555 public static boolean <B>isNonAmbNucleotideSequence</B>(java.lang.String sequence)</PRE>
\r
557 <DD>Ambiguous DNA chars : AGTCRYMKSWHBVDN // differs from protein in only one
566 <A NAME="cleanSequence(java.lang.String)"><!-- --></A><H3>
\r
569 public static java.lang.String <B>cleanSequence</B>(java.lang.String sequence)</PRE>
\r
571 <DD>Removes all whitespace chars in the sequence string
\r
574 <DT><B>Parameters:</B><DD><CODE>sequence</CODE> -
\r
575 <DT><B>Returns:</B><DD>cleaned up sequence</DL>
\r
580 <A NAME="deepCleanSequence(java.lang.String)"><!-- --></A><H3>
\r
581 deepCleanSequence</H3>
\r
583 public static java.lang.String <B>deepCleanSequence</B>(java.lang.String sequence)</PRE>
\r
585 <DD>Removes all special characters and digits as well as whitespace chars
589 <DT><B>Parameters:</B><DD><CODE>sequence</CODE> -
\r
590 <DT><B>Returns:</B><DD>cleaned up sequence</DL>
\r
595 <A NAME="cleanProteinSequence(java.lang.String)"><!-- --></A><H3>
\r
596 cleanProteinSequence</H3>
\r
598 public static java.lang.String <B>cleanProteinSequence</B>(java.lang.String sequence)</PRE>
\r
600 <DD>Remove all non AA chars from the sequence
\r
603 <DT><B>Parameters:</B><DD><CODE>sequence</CODE> - the sequence to clean
\r
604 <DT><B>Returns:</B><DD>cleaned sequence</DL>
\r
609 <A NAME="isProteinSequence(java.lang.String)"><!-- --></A><H3>
\r
610 isProteinSequence</H3>
\r
612 public static boolean <B>isProteinSequence</B>(java.lang.String sequence)</PRE>
\r
615 <DT><B>Parameters:</B><DD><CODE>sequence</CODE> -
\r
616 <DT><B>Returns:</B><DD>true is the sequence is a protein sequence, false overwise</DL>
\r
621 <A NAME="isAmbiguosProtein(java.lang.String)"><!-- --></A><H3>
\r
622 isAmbiguosProtein</H3>
\r
624 public static boolean <B>isAmbiguosProtein</B>(java.lang.String sequence)</PRE>
\r
626 <DD>Check whether the sequence confirms to amboguous protein sequence
\r
629 <DT><B>Parameters:</B><DD><CODE>sequence</CODE> -
\r
630 <DT><B>Returns:</B><DD>return true only if the sequence if ambiguous protein sequence
631 Return false otherwise. e.g. if the sequence is non-ambiguous
632 protein or DNA</DL>
\r
637 <A NAME="writeFasta(java.io.OutputStream, java.util.List, int)"><!-- --></A><H3>
\r
640 public static void <B>writeFasta</B>(java.io.OutputStream outstream,
\r
641 java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>> sequences,
\r
643 throws java.io.IOException</PRE>
\r
645 <DD>Writes list of FastaSequeces into the outstream formatting the sequence
646 so that it contains width chars on each line
\r
649 <DT><B>Parameters:</B><DD><CODE>outstream</CODE> - <DD><CODE>sequences</CODE> - <DD><CODE>width</CODE> - - the maximum number of characters to write in one line
\r
651 <DD><CODE>java.io.IOException</CODE></DL>
\r
656 <A NAME="writeFastaKeepTheStream(java.io.OutputStream, java.util.List, int)"><!-- --></A><H3>
\r
657 writeFastaKeepTheStream</H3>
\r
659 public static void <B>writeFastaKeepTheStream</B>(java.io.OutputStream outstream,
\r
660 java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>> sequences,
\r
662 throws java.io.IOException</PRE>
\r
667 <DD><CODE>java.io.IOException</CODE></DL>
\r
672 <A NAME="readFasta(java.io.InputStream)"><!-- --></A><H3>
\r
675 public static java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>> <B>readFasta</B>(java.io.InputStream inStream)
\r
676 throws java.io.IOException</PRE>
\r
678 <DD>Reads fasta sequences from inStream into the list of FastaSequence
682 <DT><B>Parameters:</B><DD><CODE>inStream</CODE> - from
\r
683 <DT><B>Returns:</B><DD>list of FastaSequence objects
\r
685 <DD><CODE>java.io.IOException</CODE></DL>
\r
690 <A NAME="writeFasta(java.io.OutputStream, java.util.List)"><!-- --></A><H3>
\r
693 public static void <B>writeFasta</B>(java.io.OutputStream os,
\r
694 java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>> sequences)
\r
695 throws java.io.IOException</PRE>
\r
697 <DD>Writes FastaSequence in the file, each sequence will take one line only
\r
700 <DT><B>Parameters:</B><DD><CODE>os</CODE> - <DD><CODE>sequences</CODE> -
\r
702 <DD><CODE>java.io.IOException</CODE></DL>
\r
707 <A NAME="readIUPred(java.io.File)"><!-- --></A><H3>
\r
710 public static java.util.Map<java.lang.String,<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>> <B>readIUPred</B>(java.io.File result)
\r
711 throws java.io.IOException,
\r
712 <A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></PRE>
\r
714 <DD>Read IUPred output
\r
717 <DT><B>Parameters:</B><DD><CODE>result</CODE> -
\r
718 <DT><B>Returns:</B><DD>Map key->sequence name, value->Score
\r
720 <DD><CODE>java.io.IOException</CODE>
\r
721 <DD><CODE><A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></CODE></DL>
\r
726 <A NAME="readJRonn(java.io.File)"><!-- --></A><H3>
\r
729 public static java.util.Map<java.lang.String,<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>> <B>readJRonn</B>(java.io.File result)
\r
730 throws java.io.IOException,
\r
731 <A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></PRE>
\r
736 <DD><CODE>java.io.IOException</CODE>
\r
737 <DD><CODE><A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></CODE></DL>
\r
742 <A NAME="readJRonn(java.io.InputStream)"><!-- --></A><H3>
\r
745 public static java.util.Map<java.lang.String,<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>> <B>readJRonn</B>(java.io.InputStream inStream)
\r
746 throws java.io.IOException,
\r
747 <A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></PRE>
\r
749 <DD>Reader for JRonn horizontal file format
752 >Foobar M G D T T A G 0.48 0.42
753 0.42 0.48 0.52 0.53 0.54
756 Where all values are tab delimited
\r
759 <DT><B>Parameters:</B><DD><CODE>inStream</CODE> - the InputStream connected to the JRonn output file
\r
760 <DT><B>Returns:</B><DD>Map key=sequence name value=Score
\r
762 <DD><CODE>java.io.IOException</CODE> - is thrown if the inStream has problems accessing the data
\r
763 <DD><CODE><A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></CODE> - is thrown if the inStream represents an unknown source of
764 data, i.e. not a JRonn output</DL>
\r
769 <A NAME="closeSilently(java.util.logging.Logger, java.io.Closeable)"><!-- --></A><H3>
\r
772 public static final void <B>closeSilently</B>(java.util.logging.Logger log,
\r
773 java.io.Closeable stream)</PRE>
\r
775 <DD>Closes the Closable and logs the exception if any
\r
778 <DT><B>Parameters:</B><DD><CODE>log</CODE> - <DD><CODE>stream</CODE> - </DL>
\r
783 <A NAME="readDisembl(java.io.InputStream)"><!-- --></A><H3>
\r
786 public static java.util.HashMap<java.lang.String,java.util.Set<<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>>> <B>readDisembl</B>(java.io.InputStream input)
\r
787 throws java.io.IOException,
\r
788 <A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></PRE>
\r
790 <DD>> Foobar_dundeefriends
792 # COILS 34-41, 50-58, 83-91, 118-127, 160-169, 191-220, 243-252, 287-343
798 # RESIDUE COILS REM465 HOTLOOPS
800 M 0.86010 0.88512 0.37094
802 T 0.79983 0.85864 0.44331
804 >Next Sequence name
\r
807 <DT><B>Parameters:</B><DD><CODE>input</CODE> - the InputStream
\r
808 <DT><B>Returns:</B><DD>Map key=sequence name, value=set of score
\r
810 <DD><CODE>java.io.IOException</CODE>
\r
811 <DD><CODE><A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></CODE></DL>
\r
816 <A NAME="readGlobPlot(java.io.InputStream)"><!-- --></A><H3>
\r
819 public static java.util.HashMap<java.lang.String,java.util.Set<<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>>> <B>readGlobPlot</B>(java.io.InputStream input)
\r
820 throws java.io.IOException,
\r
821 <A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></PRE>
\r
823 <DD>> Foobar_dundeefriends
825 # COILS 34-41, 50-58, 83-91, 118-127, 160-169, 191-220, 243-252, 287-343
831 # RESIDUE COILS REM465 HOTLOOPS
833 M 0.86010 0.88512 0.37094
835 T 0.79983 0.85864 0.44331
837 >Next Sequence name
\r
840 <DT><B>Parameters:</B><DD><CODE>input</CODE> -
\r
841 <DT><B>Returns:</B><DD>Map key=sequence name, value=set of score
\r
843 <DD><CODE>java.io.IOException</CODE>
\r
844 <DD><CODE><A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></CODE></DL>
\r
849 <A NAME="readAAConResults(java.io.InputStream)"><!-- --></A><H3>
\r
850 readAAConResults</H3>
\r
852 public static java.util.HashSet<<A HREF="../../../compbio/data/sequence/Score.html" title="class in compbio.data.sequence">Score</A>> <B>readAAConResults</B>(java.io.InputStream results)</PRE>
\r
854 <DD>Read AACon result with no alignment files. This method leaves incoming
858 <DT><B>Parameters:</B><DD><CODE>results</CODE> - output file of AAConservation
\r
859 <DT><B>Returns:</B><DD>Map with keys <A HREF="../../../compbio/data/sequence/ConservationMethod.html" title="enum in compbio.data.sequence"><CODE>ConservationMethod</CODE></A> -> float[]</DL>
\r
864 <A NAME="openInputStream(java.lang.String)"><!-- --></A><H3>
\r
865 openInputStream</H3>
\r
867 public static java.util.List<<A HREF="../../../compbio/data/sequence/FastaSequence.html" title="class in compbio.data.sequence">FastaSequence</A>> <B>openInputStream</B>(java.lang.String inFilePath)
\r
868 throws java.io.IOException,
\r
869 <A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></PRE>
\r
871 <DD>Reads and parses Fasta or Clustal formatted file into a list of
872 FastaSequence objects
\r
875 <DT><B>Parameters:</B><DD><CODE>inFilePath</CODE> - the path to the input file
\r
876 <DT><B>Returns:</B><DD>the List of FastaSequence objects
\r
878 <DD><CODE>java.io.IOException</CODE> - if the file denoted by inFilePath cannot be read
\r
879 <DD><CODE><A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></CODE> - if the inFilePath points to the file which format cannot be
883 <!-- ========= END OF CLASS DATA ========= -->
\r
887 <!-- ======= START OF BOTTOM NAVBAR ====== -->
\r
888 <A NAME="navbar_bottom"><!-- --></A>
\r
889 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
\r
890 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
\r
892 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
\r
893 <A NAME="navbar_bottom_firstrow"><!-- --></A>
\r
894 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
\r
895 <TR ALIGN="center" VALIGN="top">
\r
896 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
\r
897 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
\r
898 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
\r
899 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SequenceUtil.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
\r
900 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
\r
901 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
\r
902 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
\r
903 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
\r
907 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
\r
913 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
914 <A HREF="../../../compbio/data/sequence/ScoreManager.ScoreHolder.html" title="class in compbio.data.sequence"><B>PREV CLASS</B></A>
\r
915 <A HREF="../../../compbio/data/sequence/SMERFSConstraints.html" title="enum in compbio.data.sequence"><B>NEXT CLASS</B></A></FONT></TD>
\r
916 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
917 <A HREF="../../../index.html?compbio/data/sequence/SequenceUtil.html" target="_top"><B>FRAMES</B></A>
\r
918 <A HREF="SequenceUtil.html" target="_top"><B>NO FRAMES</B></A>
\r
919 <SCRIPT type="text/javascript">
\r
922 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
\r
927 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
\r
934 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
935 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
936 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
937 DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
\r
940 <A NAME="skip-navbar_bottom"></A>
\r
941 <!-- ======== END OF BOTTOM NAVBAR ======= -->
\r