* @param pFile
* @param pStudy
* @param pDataSet
*/
public void parseOneFile(File pFile, Study pStudy, NexusDataSet pDataSet) {
Document document = null;
try {
document = DocumentFactory.parse(pFile);
} catch (Exception e) {
e.printStackTrace();
}
// Taxa
NexmlOTUReader noc = new NexmlOTUReader(pStudy,getTaxonLabelHome(),document);
for ( OTUs xmlOTUs : document.getOTUsList() ) {
pDataSet.addTaxonLabelSet(xmlOTUs, noc.fromXmlToTreeBase(xmlOTUs));
}
// Matrices
NexmlMatrixReader nmc = new NexmlMatrixReader(pStudy,getTaxonLabelHome(),document);
for ( org.nexml.model.Matrix<?> xmlMatrix : document.getMatrices() ) {
Matrix tbMatrix = nmc.fromXmlToTreeBase(xmlMatrix);
tbMatrix.setNexusFileName(pFile.getName());
pDataSet.getMatrices().add(tbMatrix);
}
// Trees
NexmlTreeBlockReader ntbc = new NexmlTreeBlockReader(pStudy,getTaxonLabelHome(),document);
for ( org.nexml.model.TreeBlock xmlTreeBlock : document.getTreeBlockList() ) {
TreeBlock tbTreeBlock = ntbc.fromXmlToTreeBase(xmlTreeBlock);
for ( PhyloTree phyloTree : tbTreeBlock.getTreeList() ) {
phyloTree.setNexusFileName(pFile.getName());
}
pDataSet.getTreeBlocks().add(tbTreeBlock);