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


C++ Genome::readRFPFile方法代码示例

本文整理汇总了C++中Genome::readRFPFile方法的典型用法代码示例。如果您正苦于以下问题:C++ Genome::readRFPFile方法的具体用法?C++ Genome::readRFPFile怎么用?C++ Genome::readRFPFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Genome的用法示例。


在下文中一共展示了Genome::readRFPFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main()
{
	unsigned index;
	bool fromRestart = false;
	std::string modelToRun = "FONSE";
	bool withPhi = false;

	
	std::cout << "Initializing MCMCAlgorithm object---------------" << std::endl;
	int samples = 100;
	int thinning = 10;
	int useSamples = 100;
	unsigned numMixtures = 1;
	std::cout << "\t# Samples: " << samples << "\n";
	std::cout << "\tThinning: " << thinning << "\n";
	std::cout << "\t # Samples used: " << useSamples << "\n";
	MCMCAlgorithm mcmc = MCMCAlgorithm(samples, thinning, 10, true, true, false);
	mcmc.setRestartFileSettings("RestartFile.txt", 20, true);
	std::cout << "Done!-------------------------------\n\n\n";

	if (modelToRun == "FONSE") {
		std::cout << "initialize Genome object--------------------------" << std::endl;
		Genome genome;
		std::cout << "Reading fasta file\n";
		genome.readFasta("C:/Users/Alan/Documents/GitHub/RibModelDev/data/FONSE/nse2000.fasta");
		std::cout << "Done!-------------------------------\n\n\n";


		std::cout << "Initializing shared parameter variables---------------\n";
		std::vector<unsigned> geneAssignment(genome.getGenomeSize());

		std::vector<double> sphi_init(numMixtures, 1);

		/* For 1 mixture */
		for (unsigned i = 0u; i < genome.getGenomeSize(); i++)
		{
			geneAssignment[i] = 0u;
		}
		std::vector<std::vector<unsigned>> mixtureDefinitionMatrix;
		std::cout << "Done!------------------------\n\n\n";

		//ROCParameter parameter;
		FONSEParameter parameter;
		std::cout << "initialize Parameter object" << std::endl;
		std::string mixDef = Parameter::allUnique;
		if (fromRestart)
		{
			FONSEParameter tmp("C:/Users/Alan/Documents/GitHub/RibModelDev/DevRScripts/10restartfile.rst");
			parameter = tmp;
		}
		else
		{
			//ROCParameter tmp(sphi_init, nu/mMixtures, geneAssignment, mixtureDefinitionMatrix, true, mixDef);
			FONSEParameter tmp(sphi_init, numMixtures, geneAssignment, mixtureDefinitionMatrix, true, mixDef);

			for (unsigned i = 0u; i < numMixtures; i++)
			{
				unsigned selectionCategry = tmp.getSelectionCategory(i);
				std::cout << "Sphi_init for selection category " << selectionCategry << ": " << sphi_init[selectionCategry] << std::endl;
			}
			std::cout << "\t# mixtures: " << numMixtures << "\n";
			std::cout << "\tmixture definition: " << mixDef << "\n";

			//std::vector<std::string> files(1);
			//files[0] = std::string("C:/Users/Jeremy/Documents/GitHub/RibModelDev/data/FONSE/Scereviciae.mut.csv");
			//tmp.initMutationCategories(files, tmp.getNumMutationCategories());
			//tmp.InitializeSynthesisRate(genome, sphi_init[0]);
			std::vector<double> phiVals = parameter.readPhiValues("C:/Users/Alan/Documents/GitHub/RibModelDev/data/FONSE/nse2000.phi.csv");
			tmp.InitializeSynthesisRate(phiVals);
			parameter = tmp;
		}
		std::cout << "done initialize Parameter object" << std::endl;


		std::cout << "Initializing Model object\n";

		bool withPhi = true;
		FONSEModel model;
		//ROCModel model(withPhi);
		model.setParameter(parameter);


		std::cout << "starting MCMC for FONSE" << std::endl;
		mcmc.run(genome, model, 1, 0);
		std::cout << std::endl << "Finished MCMC for FONSE" << std::endl;
	}
	else if (modelToRun == "RFP")
	{
		std::cout << "Initializing Genome object--------------------------" << std::endl;
		Genome genome;
		genome.readRFPFile("C:/Users/Jeremy/Documents/GitHub/RibModelDev/data/rfp/rfp.counts.by.codon.and.gene.GSE63789.wt.csv");
		std::cout << "Done!-------------------------------\n\n\n";



		std::cout << "Initializing shared parameter variables---------------\n";
		std::vector<unsigned> geneAssignment(genome.getGenomeSize());
		std::vector<double> sphi_init(numMixtures, 1);

		if (numMixtures == 1)
//.........这里部分代码省略.........
开发者ID:adixon4528,项目名称:RibModelFramework,代码行数:101,代码来源:main.cpp


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