Commits

Qian Zhu committed 8594a4c

Allow SEEK to support variance based search

Comments (0)

Files changed (4)

src/seekcentral.cpp

 bool CSeekCentral::Initialize(const vector<CSeekDBSetting*> &vecDBSetting,
 	const utype buffer, const bool to_output_text,
 	const bool bOutputWeightComponent, const bool bSimulateWeight,
-	const enum CSeekDataset::DistanceMeasure dist_measure,
+	const enum CSeekDataset::DistanceMeasure dist_measure, const bool bVariance, 
 	const bool bSubtractAvg, const bool bNormPlatform,
 	const bool bLogit, const float fCutOff, const float fPercentQueryRequired,
 	const float fPercentGenomeRequired,
 	CSeekTools::LoadDatabase(m_vecDB, m_iGenes, m_iDatasets,
 		vecDBSetting, m_vecstrDatasets, m_mapstrstrDatasetPlatform,
 		m_mapstriPlatform, m_vp, m_vc, m_vecDBDataset, m_mapstrintDataset,
-		false, bCorrelation);
+		bVariance, bCorrelation);
 
 	return true;
 }
 	const char *search_dset, const char *query,
 	const char *output_dir, const utype buffer, const bool to_output_text,
 	const bool bOutputWeightComponent, const bool bSimulateWeight,
-	const enum CSeekDataset::DistanceMeasure dist_measure,
+	const enum CSeekDataset::DistanceMeasure dist_measure, const bool bVariance,
 	const bool bSubtractAvg, const bool bNormPlatform,
 	const bool bLogit, const float fCutOff, 
 	const float fPercentQueryRequired, const float fPercentGenomeRequired,
 	gsl_rng *rand, const bool useNibble, const int numThreads){
 
 	if(!CSeekCentral::Initialize(vecDBSetting, buffer, to_output_text,
-		bOutputWeightComponent, bSimulateWeight, dist_measure,
+		bOutputWeightComponent, bSimulateWeight, dist_measure, bVariance,
 		bSubtractAvg, bNormPlatform, bLogit, fCutOff, 
 		fPercentQueryRequired, fPercentGenomeRequired,
 		bSquareZ, bRandom, iNumRandom, bNegativeCor,

src/seekcentral.h

 		const utype buffer = 20, const bool to_output_text = false,
 		const bool bOutputWeightComponent = false, const bool bSimulateWeight = false,
 		const enum CSeekDataset::DistanceMeasure dist_measure = CSeekDataset::Z_SCORE,
+		const bool bVariance = false,
 		const bool bSubtractAvg = true, const bool bNormPlatform = false,
 		const bool bLogit = false, const float fCutOff = -9999, 
 		const float fPercentQueryRequired = 0, const float fPercentGenomeRequired = 0,
 		const utype buffer = 20, const bool to_output_text = false,
 		const bool bOutputWeightComponent = false, const bool bSimulateWeight = false,
 		const enum CSeekDataset::DistanceMeasure dist_measure = CSeekDataset::Z_SCORE,
+		const bool bVariance = false,
 		const bool bSubtractAvg = true, const bool bNormPlatform = false,
 		const bool bLogit = false, const float fCutOff = -9999, 
 		const float fPercentQueryRequired = 0, const float fPercentGenomeRequired = 0,

tools/SeekMiner/SeekMiner.cpp

 		}
 	}
 
+	bool bVariance = false;
+	if(method=="VAR"){
+		bVariance = true;
+	}
+
 	if(!csfinal->Initialize(cc,
 		sArgs.search_dset_arg, 
 		//"/tmp/ex_query2.txt", 
 		sArgs.output_dir_arg,
 		sArgs.buffer_arg, !!sArgs.output_text_flag,
 		bOutputWeightComponent, bSimulateWeight,
-		eDistMeasure,
+		eDistMeasure, bVariance,
 		!!sArgs.norm_subavg_flag, !!sArgs.norm_subavg_plat_flag,
 		false,
 		sArgs.score_cutoff_arg, 

tools/SeekServer/SeekServer.cpp

 	bool bSubtractAvg = false;
 	bool bNormPlatform = false;
 	bool bLogit = false;
+	bool bVariance = false;
+
+	string strGvar = sArgs.dir_gvar_arg;
+	if(strGvar!="NA"){
+		bVariance = true;
+	}
 
 	csfinal = new CSeekCentral();
 	CSeekDBSetting *dbSetting = new CSeekDBSetting(sArgs.dir_gvar_arg,
 		sArgs.buffer_arg, !!sArgs.output_text_flag,
 		bOutputWeightComponent, bSimulateWeight,
 		CSeekDataset::CORRELATION, //to be overwritten by individual search instance's setting
+		bVariance, //decide whether or not to load gvar
 		bSubtractAvg, bNormPlatform, //to be overwritten by individual search instance's settings
 		bLogit, //always false
 		sArgs.score_cutoff_arg,