Search in sources :

Example 1 with FastaImporter

use of dr.evolution.io.FastaImporter in project beast-mcmc by beast-dev.

the class DataModelImporter method importFastaFile.

// FASTA
private void importFastaFile(File file, DateGuesser guesser, Map dataModel) throws IOException, ImportException {
    try {
        FileReader reader = new FileReader(file);
        FastaImporter importer = new FastaImporter(reader, Nucleotides.INSTANCE);
        Alignment alignment = importer.importAlignment();
        reader.close();
        setData(dataModel, guesser, file.getName(), alignment, null, alignment, null, null, null);
    } catch (ImportException e) {
        throw new ImportException(e.getMessage());
    } catch (IOException e) {
        throw new IOException(e.getMessage());
    }
}
Also used : ImportException(dr.evolution.io.Importer.ImportException) Alignment(dr.evolution.alignment.Alignment) SimpleAlignment(dr.evolution.alignment.SimpleAlignment) FastaImporter(dr.evolution.io.FastaImporter)

Example 2 with FastaImporter

use of dr.evolution.io.FastaImporter in project beast-mcmc by beast-dev.

the class BEAUTiImporter method importFastaFile.

// FASTA
private void importFastaFile(File file) throws IOException, ImportException {
    try {
        FileReader reader = new FileReader(file);
        FastaImporter importer = new FastaImporter(reader, Nucleotides.INSTANCE);
        Alignment alignment = importer.importAlignment();
        reader.close();
        setData(file.getName(), alignment, alignment, null, null, null, null, null);
    } catch (ImportException e) {
        throw new ImportException(e.getMessage());
    } catch (IOException e) {
        throw new IOException(e.getMessage());
    }
}
Also used : ImportException(dr.evolution.io.Importer.ImportException) Alignment(dr.evolution.alignment.Alignment) SimpleAlignment(dr.evolution.alignment.SimpleAlignment) FastaImporter(dr.evolution.io.FastaImporter)

Aggregations

Alignment (dr.evolution.alignment.Alignment)2 SimpleAlignment (dr.evolution.alignment.SimpleAlignment)2 FastaImporter (dr.evolution.io.FastaImporter)2 ImportException (dr.evolution.io.Importer.ImportException)2