compbio.data.sequence
Class ClustalAlignmentUtil
java.lang.Object
compbio.data.sequence.ClustalAlignmentUtil
public final class ClustalAlignmentUtil
- extends java.lang.Object
Tools to read and write clustal formated files
- Author:
- Petr Troshin based on jimp class
Date September 2009
Field Summary |
static char |
gapchar
Dash char to be used as gap char in the alignments |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
gapchar
public static final char gapchar
- Dash char to be used as gap char in the alignments
- See Also:
- Constant Field Values
ClustalAlignmentUtil
public ClustalAlignmentUtil()
readClustalFile
public static Alignment readClustalFile(java.io.InputStream instream)
throws java.io.IOException,
UnknownFileFormatException
- Read Clustal formatted alignment. Limitations: Does not read consensus
Sequence names as well as the sequences are not guaranteed to be unique!
- Throws:
{@link
- IOException}
{@link
- UnknownFileFormatException}
java.io.IOException
UnknownFileFormatException
isValidClustalFile
public static boolean isValidClustalFile(java.io.InputStream input)
- Parameters:
input
-
- Returns:
- true if the file is recognised as Clustal formatted alignment,
false otherwise
writeClustalAlignment
public static void writeClustalAlignment(java.io.OutputStream outStream,
Alignment alignment)
throws java.io.IOException
- Write Clustal formatted alignment Limitations: does not record the
consensus. Potential bug - records 60 chars length alignment where
Clustal would have recorded 50 chars.
- Parameters:
outStream
- alignment
-
- Throws:
java.io.IOException
readClustalFile
public static Alignment readClustalFile(java.io.File file)
throws UnknownFileFormatException,
java.io.IOException
- Throws:
UnknownFileFormatException
java.io.IOException