本文整理汇总了Java中beast.evolution.tree.TreeTraceAnalysis类的典型用法代码示例。如果您正苦于以下问题:Java TreeTraceAnalysis类的具体用法?Java TreeTraceAnalysis怎么用?Java TreeTraceAnalysis使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TreeTraceAnalysis类属于beast.evolution.tree包,在下文中一共展示了TreeTraceAnalysis类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import beast.evolution.tree.TreeTraceAnalysis; //导入依赖的package包/类
@Override
public void run() throws Exception {
List<Tree> treeList = new ArrayList<>();
try (PrintStream ps = new PrintStream(fileNameInput.get())) {
for (int i = 0; i < nSimsInput.get(); i++) {
Tree tree = new SimulatedGeneTree();
tree.initByName(
"speciesTree", speciesTreeInput.get(),
"sampleCounts", sampleCountsInput.get());
treeList.add(tree);
ps.println(tree.toString() + ";");
}
}
if (reportFileNameInput.get() != null) {
try (PrintStream ps = new PrintStream(reportFileNameInput.get())) {
TreeTraceAnalysis analysis = new TreeTraceAnalysis(treeList, 0.0);
analysis.computeCredibleSet(credibilityThresholdInput.get());
analysis.report(ps);
}
}
}
示例2: initAndValidate
import beast.evolution.tree.TreeTraceAnalysis; //导入依赖的package包/类
@Override
public void initAndValidate() {
List<BEASTObject> loggers = loggersInput.get();
final int nLoggers = loggers.size();
if (nLoggers == 0) {
throw new IllegalArgumentException("Logger with nothing to log specified");
}
if (everyInput.get() != null)
m_nEvery = everyInput.get();
burnin = burninInput.get();
if (credibleSetPercentageInput.get() != null)
credibleSetPercentage = credibleSetPercentageInput.get();
if (silentInput.get() != null)
silent = silentInput.get();
treeToTrack = (Tree)loggers.get(0);
traceAnalysis = new TreeTraceAnalysis();
}
示例3: run
import beast.evolution.tree.TreeTraceAnalysis; //导入依赖的package包/类
@Override
public void run() throws Exception {
java.io.File file, file_out;
String outputFile = "";
double customThreshold = -1.;
// ArrayList<String> taxa = null;
file = treesInput.get();
if (file == null || !file.exists()) {
throw new IllegalArgumentException("tree file must be specified and file must exist");
}
if (outputInput.get() != null) {
outputFile = outputInput.get().getPath();
}
customThreshold = thresholdInput.get();
if (outputFile.isEmpty()) {
String inputFileName = file.getPath();
if (inputFileName.contains(".trees")) {
inputFileName = inputFileName.substring(0, inputFileName.indexOf(".trees"));
}
outputFile = inputFileName +"_extant.trees";
}
FileReader reader = null;
try {
System.err.println("Reading file " + file.getName());
reader = new FileReader(file);
List<Tree> trees = TreeTraceAnalysis.Utils.getTrees(file);
FullToExtantTreeConverter converter;
if (customThreshold >= 0.0) {
converter = new FullToExtantTreeConverter(customThreshold);
// } else if (taxa != null) {
// converter = new FullToExtantTreeConverter(taxa);
} else {
converter = new FullToExtantTreeConverter();
}
System.err.println("Writing file " + outputFile);
converter.printConvertedTrees(trees, outputFile);
System.err.println("Done");
}
catch (IOException e) {
//
}
finally {
if (reader != null) {
reader.close();
}
}
}
示例4: getAnalysis
import beast.evolution.tree.TreeTraceAnalysis; //导入依赖的package包/类
/**
* Obtain completed analysis.
*
* @return tree trace analysis.
*/
public TreeTraceAnalysis getAnalysis() {
return traceAnalysis;
}