当前位置: 首页>>代码示例>>Java>>正文


Java TreeTraceAnalysis类代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:genomescale,项目名称:starbeast2,代码行数:26,代码来源:GeneTreeSimulator.java

示例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();
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:24,代码来源:WilsonBaldingTest.java

示例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();
	            }
	        }		
	}
 
开发者ID:CompEvol,项目名称:sampled-ancestors,代码行数:52,代码来源:FullToExtantTreeConverter.java

示例4: getAnalysis

import beast.evolution.tree.TreeTraceAnalysis; //导入依赖的package包/类
/**
 * Obtain completed analysis.
 *
 * @return tree trace analysis.
 */
public TreeTraceAnalysis getAnalysis() {
	return traceAnalysis;
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:9,代码来源:WilsonBaldingTest.java


注:本文中的beast.evolution.tree.TreeTraceAnalysis类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。