use of dr.evolution.io.MicroSatImporter in project beast-mcmc by beast-dev.
the class BEAUTiImporter method importMicroSatFile.
// micro-sat
private void importMicroSatFile(File file) throws IOException, ImportException {
try {
Reader reader = new FileReader(file);
BufferedReader bufferedReader = new BufferedReader(reader);
MicroSatImporter importer = new MicroSatImporter(bufferedReader);
List<Patterns> microsatPatList = importer.importPatterns();
Taxa unionSetTaxonList = importer.getUnionSetTaxonList();
Microsatellite microsatellite = importer.getMicrosatellite();
// options.allowDifferentTaxa = importer.isHasDifferentTaxon();
bufferedReader.close();
PartitionSubstitutionModel substModel = new PartitionSubstitutionModel(options, microsatPatList.get(0).getId());
substModel.setMicrosatellite(microsatellite);
for (Patterns patterns : microsatPatList) {
setData(file.getName(), unionSetTaxonList, patterns, substModel, null);
}
// has to call after data is imported
options.microsatelliteOptions.initModelParametersAndOpererators();
} catch (ImportException e) {
throw new ImportException(e.getMessage());
} catch (IOException e) {
throw new IOException(e.getMessage());
}
}
Aggregations