public class FileFormatReader extends FileFormat
FileFormat,
FileFormatConverterCFILE_FORMATS, CLUSTAL_F, CLUSTAL_TYPE, DCSE_F, DESTINATION, FASTA_F, FASTA_TYPE, FILEFORMATS, MASE_F, MASE_TYPE, msafileIn, msafileOut, PCLASSIC_F, PEXTENDED_F, PHYLIP_FTYPES, PHYLIP_TYPE, PHYLIPG_F, PHYLIPI_F, PHYLIPS_F, SOURCE| Constructor and Description |
|---|
FileFormatReader(java.lang.String filepath,
java.lang.String format,
int io)
FileFormatReader constructor method.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getSequence(int index)
Get specific sequence by given index.
|
java.lang.String |
getSequenceTitle(int index)
Get specific sequence title, given index location.
|
java.lang.String[] |
getTaxaNames()
Get all sequences titles or names.
|
boolean |
readSeqsFormatFile()
Read MSA file for instantiated source file and format.
|
void |
setEnableOutput(java.lang.String outfile,
java.lang.String outformat)
Enable saving sequences to file.
This is useful when data read previously from file should not be lost and thus still used for saving. |
void |
setSequence(java.lang.String sequence,
java.lang.String seqname)
Set a single sequence with its name.
|
boolean |
setSequences(java.lang.String[][] sequences,
java.lang.String[] seqnames)
Set a set of sequences with their names in matching order.
|
boolean |
setSequences(java.lang.String[] sequences,
java.lang.String[] seqnames)
Set a set of sequences with their names in matching order.
|
void |
writeSeqsToFile()
Write all sequences to file using chosen format.
|
void |
writeSeqToFile(int index)
Write specific sequence to file using chosen format.
|
getBR, getBW, isWhite, setInputFile, setOutputFilepublic FileFormatReader(java.lang.String filepath,
java.lang.String format,
int io)
filepath - input/output file path.format - corresponding format.io - decide if these arguments are for read (input) or write (output) file.
Values: SOURCE , DESTINATION.public java.lang.String getSequence(int index)
index - of specific sequence.public java.lang.String getSequenceTitle(int index)
index - location of sequence title.public java.lang.String[] getTaxaNames()
public void setSequence(java.lang.String sequence,
java.lang.String seqname)
sequence - any sequence regardless of its format.seqname - sequence corresponding title.setSequences(java.lang.String[], java.lang.String[]),
setSequences(java.lang.String[][], java.lang.String[])public boolean setSequences(java.lang.String[][] sequences,
java.lang.String[] seqnames)
sequences - any set of sequences regardless of its type.seqnames - sequences corresponding titles.setSequences(java.lang.String[], java.lang.String[]),
setSequence(java.lang.String, java.lang.String)public boolean setSequences(java.lang.String[] sequences,
java.lang.String[] seqnames)
sequences - any set of sequences regardless of its type.seqnames - sequences corresponding titles.setSequences(java.lang.String[][], java.lang.String[]),
setSequence(java.lang.String, java.lang.String)public void setEnableOutput(java.lang.String outfile,
java.lang.String outformat)
outfile - output file absolute path.outformat - output file format.public boolean readSeqsFormatFile()
public void writeSeqsToFile()
public void writeSeqToFile(int index)
index - index of selected sequence.