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:30:40 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="ClustalAlignmentUtil";
\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/ClustalAlignmentUtil.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/AlignmentMetadata.html" title="class in compbio.data.sequence"><B>PREV CLASS</B></A>
\r
59 <A HREF="../../../compbio/data/sequence/ConservationMethod.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/ClustalAlignmentUtil.html" target="_top"><B>FRAMES</B></A>
\r
62 <A HREF="ClustalAlignmentUtil.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> | <A HREF="#constructor_summary">CONSTR</A> | <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> | <A HREF="#constructor_detail">CONSTR</A> | <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 ClustalAlignmentUtil</H2>
\r
95 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
\r
96 <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>compbio.data.sequence.ClustalAlignmentUtil</B>
\r
100 <DT><PRE>public final class <B>ClustalAlignmentUtil</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
\r
104 Tools to read and write clustal formated files
\r
109 <DT><B>Version:</B></DT>
\r
110 <DD>1.0 September 2009</DD>
\r
111 <DT><B>Author:</B></DT>
\r
112 <DD>Petr Troshin based on jimp class</DD>
\r
117 <!-- =========== FIELD SUMMARY =========== -->
\r
119 <A NAME="field_summary"><!-- --></A>
\r
120 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
121 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
122 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
\r
123 <B>Field Summary</B></FONT></TH>
\r
125 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
126 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
127 <CODE>static char</CODE></FONT></TD>
\r
128 <TD><CODE><B><A HREF="../../../compbio/data/sequence/ClustalAlignmentUtil.html#gapchar">gapchar</A></B></CODE>
\r
131 Dash char to be used as gap char in the alignments</TD>
\r
135 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
\r
137 <A NAME="constructor_summary"><!-- --></A>
\r
138 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
139 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
140 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
\r
141 <B>Constructor Summary</B></FONT></TH>
\r
143 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
144 <TD><CODE><B><A HREF="../../../compbio/data/sequence/ClustalAlignmentUtil.html#ClustalAlignmentUtil()">ClustalAlignmentUtil</A></B>()</CODE>
\r
147 </TD>
\r
151 <!-- ========== METHOD SUMMARY =========== -->
\r
153 <A NAME="method_summary"><!-- --></A>
\r
154 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
155 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
156 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
\r
157 <B>Method Summary</B></FONT></TH>
\r
159 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
160 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
161 <CODE>static boolean</CODE></FONT></TD>
\r
162 <TD><CODE><B><A HREF="../../../compbio/data/sequence/ClustalAlignmentUtil.html#isValidClustalFile(java.io.InputStream)">isValidClustalFile</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> input)</CODE>
\r
165 Please note this method closes the input stream provided as a parameter</TD>
\r
167 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
168 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
169 <CODE>static <A HREF="../../../compbio/data/sequence/Alignment.html" title="class in compbio.data.sequence">Alignment</A></CODE></FONT></TD>
\r
170 <TD><CODE><B><A HREF="../../../compbio/data/sequence/ClustalAlignmentUtil.html#readClustalFile(java.io.File)">readClustalFile</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A> file)</CODE>
\r
173 </TD>
\r
175 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
176 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
177 <CODE>static <A HREF="../../../compbio/data/sequence/Alignment.html" title="class in compbio.data.sequence">Alignment</A></CODE></FONT></TD>
\r
178 <TD><CODE><B><A HREF="../../../compbio/data/sequence/ClustalAlignmentUtil.html#readClustalFile(java.io.InputStream)">readClustalFile</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> instream)</CODE>
\r
181 Read Clustal formatted alignment.</TD>
\r
183 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
184 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
185 <CODE>static void</CODE></FONT></TD>
\r
186 <TD><CODE><B><A HREF="../../../compbio/data/sequence/ClustalAlignmentUtil.html#writeClustalAlignment(java.io.Writer, compbio.data.sequence.Alignment)">writeClustalAlignment</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</A> out,
\r
187 <A HREF="../../../compbio/data/sequence/Alignment.html" title="class in compbio.data.sequence">Alignment</A> alignment)</CODE>
\r
190 Write Clustal formatted alignment Limitations: does not record the
194 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
\r
195 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
196 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
\r
197 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
\r
199 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
200 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
\r
206 <!-- ============ FIELD DETAIL =========== -->
\r
208 <A NAME="field_detail"><!-- --></A>
\r
209 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
210 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
211 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
\r
212 <B>Field Detail</B></FONT></TH>
\r
216 <A NAME="gapchar"><!-- --></A><H3>
\r
219 public static final char <B>gapchar</B></PRE>
\r
221 <DD>Dash char to be used as gap char in the alignments
\r
224 <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#compbio.data.sequence.ClustalAlignmentUtil.gapchar">Constant Field Values</A></DL>
\r
227 <!-- ========= CONSTRUCTOR DETAIL ======== -->
\r
229 <A NAME="constructor_detail"><!-- --></A>
\r
230 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
231 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
232 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
\r
233 <B>Constructor Detail</B></FONT></TH>
\r
237 <A NAME="ClustalAlignmentUtil()"><!-- --></A><H3>
\r
238 ClustalAlignmentUtil</H3>
\r
240 public <B>ClustalAlignmentUtil</B>()</PRE>
\r
244 <!-- ============ METHOD DETAIL ========== -->
\r
246 <A NAME="method_detail"><!-- --></A>
\r
247 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
248 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
249 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
\r
250 <B>Method Detail</B></FONT></TH>
\r
254 <A NAME="readClustalFile(java.io.InputStream)"><!-- --></A><H3>
\r
255 readClustalFile</H3>
\r
257 public static <A HREF="../../../compbio/data/sequence/Alignment.html" title="class in compbio.data.sequence">Alignment</A> <B>readClustalFile</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> instream)
\r
258 throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A>,
\r
259 <A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></PRE>
\r
261 <DD>Read Clustal formatted alignment. Limitations: Does not read consensus
263 Sequence names as well as the sequences are not guaranteed to be unique!
\r
268 <DD><CODE>{@link</CODE> - IOException}
\r
269 <DD><CODE>{@link</CODE> - UnknownFileFormatException}
\r
270 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE>
\r
271 <DD><CODE><A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></CODE></DL>
\r
276 <A NAME="isValidClustalFile(java.io.InputStream)"><!-- --></A><H3>
\r
277 isValidClustalFile</H3>
\r
279 public static boolean <B>isValidClustalFile</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> input)</PRE>
\r
281 <DD>Please note this method closes the input stream provided as a parameter
\r
284 <DT><B>Parameters:</B><DD><CODE>input</CODE> -
\r
285 <DT><B>Returns:</B><DD>true if the file is recognised as Clustal formatted alignment,
286 false otherwise</DL>
\r
291 <A NAME="writeClustalAlignment(java.io.Writer, compbio.data.sequence.Alignment)"><!-- --></A><H3>
\r
292 writeClustalAlignment</H3>
\r
294 public static void <B>writeClustalAlignment</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</A> out,
\r
295 <A HREF="../../../compbio/data/sequence/Alignment.html" title="class in compbio.data.sequence">Alignment</A> alignment)
\r
296 throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
\r
298 <DD>Write Clustal formatted alignment Limitations: does not record the
299 consensus. Potential bug - records 60 chars length alignment where
300 Clustal would have recorded 50 chars.
\r
303 <DT><B>Parameters:</B><DD><CODE>out</CODE> - <DD><CODE>alignment</CODE> -
\r
305 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
\r
310 <A NAME="readClustalFile(java.io.File)"><!-- --></A><H3>
\r
311 readClustalFile</H3>
\r
313 public static <A HREF="../../../compbio/data/sequence/Alignment.html" title="class in compbio.data.sequence">Alignment</A> <B>readClustalFile</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A> file)
\r
314 throws <A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A>,
\r
315 <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
\r
320 <DD><CODE><A HREF="../../../compbio/data/sequence/UnknownFileFormatException.html" title="class in compbio.data.sequence">UnknownFileFormatException</A></CODE>
\r
321 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
\r
324 <!-- ========= END OF CLASS DATA ========= -->
\r
328 <!-- ======= START OF BOTTOM NAVBAR ====== -->
\r
329 <A NAME="navbar_bottom"><!-- --></A>
\r
330 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
\r
331 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
\r
333 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
\r
334 <A NAME="navbar_bottom_firstrow"><!-- --></A>
\r
335 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
\r
336 <TR ALIGN="center" VALIGN="top">
\r
337 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
\r
338 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
\r
339 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
\r
340 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ClustalAlignmentUtil.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
\r
341 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
\r
342 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
\r
343 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
\r
344 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
\r
348 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
\r
354 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
355 <A HREF="../../../compbio/data/sequence/AlignmentMetadata.html" title="class in compbio.data.sequence"><B>PREV CLASS</B></A>
\r
356 <A HREF="../../../compbio/data/sequence/ConservationMethod.html" title="enum in compbio.data.sequence"><B>NEXT CLASS</B></A></FONT></TD>
\r
357 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
358 <A HREF="../../../index.html?compbio/data/sequence/ClustalAlignmentUtil.html" target="_top"><B>FRAMES</B></A>
\r
359 <A HREF="ClustalAlignmentUtil.html" target="_top"><B>NO FRAMES</B></A>
\r
360 <SCRIPT type="text/javascript">
\r
363 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
\r
368 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
\r
375 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
376 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
377 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
378 DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
\r
381 <A NAME="skip-navbar_bottom"></A>
\r
382 <!-- ======== END OF BOTTOM NAVBAR ======= -->
\r