Commits

Qian Zhu  committed a30734b

Added option in pcl.cpp to print distribution of distances (use -v 6 in Distancer)
Renamed ushort to utype in seek related classes
Fixed a bug in PCLServer (the location parameter -i is now working)

  • Participants
  • Parent commits c569352

Comments (0)

Files changed (29)

 				for (j = (i + 1); j < Dat.GetGenes(); ++j)
 					if (!CMeta::IsNaN(d = Dat.Get(i, j)) && (d < dCutoff))
 						Dat.Set(i, j, CMeta::GetNaN());
+
+		if(pMeasure->GetName()=="pearson" || pMeasure->GetName()=="pearnorm"){
+			vector<unsigned long> bins;
+			bins.resize(55);
+			float upper = 0;
+			float lower = 0;
+			if(pMeasure->GetName()=="pearson"){
+				upper = 1.0;
+				lower = -1.0;
+			}else if(pMeasure->GetName()=="pearnorm"){
+				upper = 5.0;
+				lower = -5.0;
+			}
+			float bin_size = (upper - lower) / 50;
+			for(i=0; i<55; i++)
+				bins[i] = 0;
+			for(i=0; i<Dat.GetGenes(); i++){
+				for(j=i+1; j<Dat.GetGenes(); j++){
+					d = Dat.Get(i,j);
+					if(CMeta::IsNaN(d)) continue;
+					int b = (int) ((d - lower) / bin_size);
+					if(b<0){
+						bins[0]++;
+						continue;
+					}
+					if(b>=55){
+						bins[54]++;
+						continue;
+					}
+					bins[b]++;
+				}
+			}
+			g_CatSleipnir().info(
+			"Distribution of distances: bin size: %.5f, number of bins: %d, min bin value: %.5f, max bin value: %.5f",
+			bin_size, 55, lower, upper);
+			for(i=0; i<55; i++){
+				g_CatSleipnir().info("%lu\t%lu", i, bins[i]);
+			}
+		}
+
 	}
 
 	return 0;
 				for (j = (i + 1); j < Dat.GetGenes(); ++j)
 					if (!CMeta::IsNaN(d = Dat.Get(i, j)) && (d < dCutoff))
 						Dat.Set(i, j, CMeta::GetNaN());
+
+		if(pMeasure->GetName()=="pearson" || pMeasure->GetName()=="pearnorm"){
+			vector<unsigned long> bins;
+			bins.resize(55);
+			float upper = 0;
+			float lower = 0;
+			if(pMeasure->GetName()=="pearson"){
+				upper = 1.0;
+				lower = -1.0;
+			}else if(pMeasure->GetName()=="pearnorm"){
+				upper = 5.0;
+				lower = -5.0;
+			}
+			float bin_size = (upper - lower) / 50;
+			for(i=0; i<55; i++)
+				bins[i] = 0;
+			for(i=0; i<Dat.GetGenes(); i++){
+				for(j=i+1; j<Dat.GetGenes(); j++){
+					d = Dat.Get(i,j);
+					if(CMeta::IsNaN(d)) continue;
+					int b = (int) ((d - lower) / bin_size);
+					if(b<0){
+						bins[0]++;
+						continue;
+					}
+					if(b>=55){
+						bins[54]++;
+						continue;
+					}
+					bins[b]++;
+				}
+			}
+			g_CatSleipnir().info(
+			"Distribution of distances: bin size: %.5f, number of bins: %d, min bin value: %.5f, max bin value: %.5f",
+			bin_size, 55, lower, upper);
+			for(i=0; i<55; i++){
+				g_CatSleipnir().info("%lu\t%lu", i, bins[i]);
+			}
+		}
 	}
-
 	return 0;
 }
 

File src/seekbasic.h

 #include <gsl/gsl_permute_vector_float.h>
 
 using namespace std;
-typedef unsigned short ushort;
+//typedef unsigned short ushort;
+typedef unsigned int utype;
+//#define MAX_UTYPE 65535
+const utype MAX_UTYPE = 4294967295;
 #endif
 
 

File src/seekcentral.cpp

 	m_mapstrintDataset.clear();
 	m_mapstrintGene.clear();
 
-	ushort i, j;
+	utype i, j;
 	for(i=0; i<m_vc.size(); i++){
 		if(m_vc[i]==NULL) continue;
 		delete m_vc[i];
 bool CSeekCentral::CalculateRestart(){
 	set<string> ss;
 	m_mapLoadTime.clear();
-	ushort i, prev;
+	utype i, prev;
 	prev = 0;
 	for(i=0; i<m_vecstrAllQuery.size(); i++){
 		if(m_vecstrAllQuery[i].size()>m_maxNumDB){
 	ss.clear();
 	//check
 	vector<char> vc;
-	ushort tot = 0;
+	utype tot = 0;
 	CSeekTools::InitVector(vc, m_vecstrAllQuery.size(), (char) 0);
-	map<ushort, vector< vector<string> > >::const_iterator ci =
+	map<utype, vector< vector<string> > >::const_iterator ci =
 		m_mapLoadTime.begin();
 	for(; ci!=m_mapLoadTime.end(); ci++) tot+=(ci->second).size();
 	vc.clear();
 	copy(src->m_vecstrDP.begin(), src->m_vecstrDP.end(), m_vecstrDP.begin());
 
 	m_quant = src->m_quant;
-	ushort i, j;
+	utype i, j;
 	omp_set_num_threads(m_numThreads);
 
 	m_iDatasets = m_vecstrDatasets.size();
 //Checks how many datasets contain the query
 //requires the queries and searchdatasets to be loaded!
 bool CSeekCentral::CheckDatasets(const bool &replace){
-	ushort dd, j;
-	ushort l;
+	utype dd, j;
+	utype l;
 	stringstream ss; //search dataset (new!)
 	stringstream sq; //query availability
 	stringstream aq; //query (new!)
 
 	for(l=0; l<m_searchdsetMap.size(); l++){
-		ushort iUserDatasets = m_searchdsetMap[l]->GetNumSet();
-		const vector<ushort> &allRDatasets = m_searchdsetMap[l]->GetAllReverse();	
+		utype iUserDatasets = m_searchdsetMap[l]->GetNumSet();
+		const vector<utype> &allRDatasets = m_searchdsetMap[l]->GetAllReverse();	
 		vector<int> count;
 		CSeekTools::InitVector(count, m_vecstrAllQuery[l].size(), (int) 0);
 		bool isFirst = true;
 
 		for(dd=0; dd<iUserDatasets; dd++){
-			ushort i = allRDatasets[dd];
+			utype i = allRDatasets[dd];
 			CSeekIntIntMap *si = m_vc[i]->GetGeneMap();
-			ushort present = 0;
+			utype present = 0;
 			for(j=0, present=0; j<m_vecstrAllQuery[l].size(); j++){
 				if(m_mapstrintGene.find(m_vecstrAllQuery[l][j])==
 					m_mapstrintGene.end()) continue;
 
 	if(replace){
 		vector<string> qq;
-		ushort i;
+		utype i;
 		CMeta::Tokenize(refinedQuery.c_str(), qq, "|", true);
 		m_vecstrAllQuery.resize(qq.size());
 		for(i=0; i<qq.size(); i++){
 
 //load everything except query, search datasets, output directory
 bool CSeekCentral::Initialize(const vector<CSeekDBSetting*> &vecDBSetting,
-	const ushort buffer, const bool to_output_text,
+	const utype buffer, const bool to_output_text,
 	const bool bOutputWeightComponent, const bool bSimulateWeight,
 	const enum CSeekDataset::DistanceMeasure dist_measure,
 	const bool bSubtractAvg, const bool bNormPlatform,
 		m_randRandom = NULL;
 	}
 
-	ushort i, j;
+	utype i, j;
 
 	omp_set_num_threads(m_numThreads);
 
 		}
 
 		vector<string> vecstrPlatforms;
-		map<string,ushort> mapstriPlatform;
+		map<string,utype> mapstriPlatform;
 		vector<CSeekPlatform> vp;
 		CSeekTools::ReadPlatforms(vecDBSetting[i]->GetValue("platform"), vp,
 			vecstrPlatforms, mapstriPlatform);
-		for(map<string,ushort>::iterator it=mapstriPlatform.begin();
+		
+		int cur = m_vp.size();
+		for(map<string,utype>::iterator it=mapstriPlatform.begin();
 			it!=mapstriPlatform.end(); it++){
-			m_mapstriPlatform[it->first] = it->second;
+			m_mapstriPlatform[it->first] = it->second + cur;
 		}
 
-		int cur = m_vp.size();
 		m_vp.resize(cur+vp.size());
 		for(j=0; j<vp.size(); j++)
 			m_vp[cur+j].Copy(vp[j]);
 bool CSeekCentral::Initialize(
 	const vector<CSeekDBSetting*> &vecDBSetting,
 	const char *search_dset, const char *query,
-	const char *output_dir, const ushort buffer, const bool to_output_text,
+	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 bool bSubtractAvg, const bool bNormPlatform,
 		return false;
 	}
 
-	ushort i, j;
+	utype i, j;
 	omp_set_num_threads(m_numThreads);
 	m_output_dir = output_dir;
 
 
 bool CSeekCentral::PrepareQuery(const vector<string> &vecstrQuery,
 	CSeekQuery &query){
-	vector<ushort> queryGenes;
-	ushort j;
+	vector<utype> queryGenes;
+	utype j;
 	for(j=0; j<vecstrQuery.size(); j++){
 		if(m_mapstrintGene.find(vecstrQuery[j])==
 			m_mapstrintGene.end()) continue;
 	assert(m_rank_normal_threads==NULL && m_rank_threads==NULL);
 	assert(m_rData==NULL);
 
-	ushort j;
-	const vector<ushort> &queryGenes = query.GetQuery();
-	const vector<ushort> &allRDatasets = dMap.GetAllReverse();
-	ushort iSearchDatasets = dMap.GetNumSet();
-	ushort iQuery = queryGenes.size();
+	utype j;
+	const vector<utype> &queryGenes = query.GetQuery();
+	const vector<utype> &allRDatasets = dMap.GetAllReverse();
+	utype iSearchDatasets = dMap.GetNumSet();
+	utype iQuery = queryGenes.size();
 
 	for(j=0; j<iSearchDatasets; j++)
 		m_vc[allRDatasets[j]]->InitializeQuery(queryGenes);
 
-	m_rData = new ushort**[m_numThreads];
+	m_rData = new utype**[m_numThreads];
 	for(j=0; j<m_numThreads; j++)
-		m_rData[j] = CSeekTools::Init2DArray(m_iGenes, iQuery, (ushort)0);
+		m_rData[j] = CSeekTools::Init2DArray(m_iGenes, iQuery, (utype)0);
 	
 	m_master_rank_threads =
 		CSeekTools::Init2DArray(m_numThreads, m_iGenes, (float)0);
 	m_sum_weight_threads =
 		CSeekTools::Init2DArray(m_numThreads, m_iGenes, (float)0);
 	m_counts_threads =
-		CSeekTools::Init2DArray(m_numThreads, m_iGenes, (ushort)0);
+		CSeekTools::Init2DArray(m_numThreads, m_iGenes, (utype)0);
 	
-	m_rank_normal_threads = new vector<ushort>[m_numThreads];
-	m_rank_threads = new vector<ushort>[m_numThreads];
+	m_rank_normal_threads = new vector<utype>[m_numThreads];
+	m_rank_threads = new vector<utype>[m_numThreads];
 
 	for(j=0; j<m_numThreads; j++){
 		m_rank_normal_threads[j].resize(m_iGenes);
 		m_rank_threads[j].resize(m_iGenes);
-		//CSeekTools::InitVector(m_rank_normal_threads[j], m_iGenes, (ushort) 255);
-		//CSeekTools::InitVector(m_rank_threads[j], m_iGenes, (ushort) 255);
+		//CSeekTools::InitVector(m_rank_normal_threads[j], m_iGenes, (utype) 255);
+		//CSeekTools::InitVector(m_rank_threads[j], m_iGenes, (utype) 255);
 	}
 	
 	CSeekTools::InitVector(m_master_rank, m_iGenes, (float) 0);
 	CSeekTools::InitVector(m_sum_weight, m_iGenes, (float) 0);
-	CSeekTools::InitVector(m_counts, m_iGenes, (ushort) 0);
+	CSeekTools::InitVector(m_counts, m_iGenes, (utype) 0);
 	CSeekTools::InitVector(weight, m_iDatasets, (float)0);
 	
 	return true;
 	assert(m_rank_normal_threads!=NULL && m_rank_threads!=NULL);
 
 	//Aggregate into three vectors: m_master_rank, m_counts, m_sum_weight
-	ushort j, k;
+	utype j, k;
 	for(j=0; j<m_numThreads; j++){
 		for(k=0; k<m_iGenes; k++){
 			m_master_rank[k] += m_master_rank_threads[j][k];
 	return true;
 }
 
-bool CSeekCentral::FilterResults(const ushort &iSearchDatasets){
-	ushort j, k;
+bool CSeekCentral::FilterResults(const utype &iSearchDatasets){
+	utype j, k;
 	bool DEBUG = false;
 	if(DEBUG) fprintf(stderr, "Aggregating genes\n");
 
 bool CSeekCentral::Sort(vector<AResultFloat> &final){
 	if(DEBUG) fprintf(stderr, "Sorting genes\n");
 	final.resize(m_iGenes);
-	ushort j;
+	utype j;
 	for(j=0; j<m_iGenes; j++){
 		//fprintf(stderr, "%d %s\n", j, DB.GetGene((size_t) j).c_str());
 		final[j].i = j;
 
 bool CSeekCentral::Display(CSeekQuery &query, vector<AResultFloat> &final){
 	if(DEBUG) fprintf(stderr, "Results:\n");
-	ushort jj, ii;
+	utype jj, ii;
 	const vector<char> &cQuery = query.GetQueryPresence();
 	for(ii=0, jj=0; jj<500; ii++){
 		if(cQuery[final[ii].i]==1) continue;
 	return true;
 }
 
-bool CSeekCentral::Write(const ushort &i){
+bool CSeekCentral::Write(const utype &i){
 	//assume m_bRandom = false
 	char acBuffer[1024];
 	sprintf(acBuffer, "%s/%d.query", m_output_dir.c_str(), i);
 	}
 
 	if(!m_bRandom && m_bOutputText){
-		const vector<ushort> &allRDatasets =
+		const vector<utype> &allRDatasets =
 			m_searchdsetMap[i]->GetAllReverse();
-		ushort iSearchDatasets = m_searchdsetMap[i]->GetNumSet();
+		utype iSearchDatasets = m_searchdsetMap[i]->GetNumSet();
 		vector<vector<string> > vecOutput;
 		vecOutput.resize(2);
 		vecOutput[0] = vector<string>();
 		sprintf(acBuffer, "%s/%d.results.txt", m_output_dir.c_str(), i);
 		vector<AResultFloat> w;
 		w.resize(m_iDatasets);
-		ushort j;
+		utype j;
 		for(j=0; j<m_iDatasets; j++){
 			w[j].i = j;
 			w[j].f = m_weight[i][j];
 
 bool CSeekCentral::Common(CSeekCentral::SearchMode &sm,
 	gsl_rng *rnd, const CSeekQuery::PartitionMode *PART_M,
-	const ushort *FOLD, const float *RATE,
+	const utype *FOLD, const float *RATE,
 	const vector< vector<float> > *providedWeight,
 	const vector< vector<string> > *newGoldStd){
 
-	ushort i, j, d, dd;
+	utype i, j, d, dd;
 	int k; //keeps track of genes (for random case)
-	ushort l; //keeps track of random repetition (for random case)
+	utype l; //keeps track of random repetition (for random case)
 	char acBuffer[1024];
 	
 	m_Query.resize(m_vecstrAllQuery.size());
 			}
 		}
 
-		const vector<ushort> &allRDatasets =
+		const vector<utype> &allRDatasets =
 			m_searchdsetMap[i]->GetAllReverse();
-		ushort iSearchDatasets = m_searchdsetMap[i]->GetNumSet();
+		utype iSearchDatasets = m_searchdsetMap[i]->GetNumSet();
 
 		//fprintf(stderr, "1 %lu\n", CMeta::GetMemoryUsage());
 
 
 		PrepareQuery(m_vecstrAllQuery[i], query);
 		PrepareOneQuery(query, *(m_searchdsetMap[i]), weight);
-		ushort iQuery = query.GetQuery().size();
+		utype iQuery = query.GetQuery().size();
 
 		//fprintf(stderr, "1b %lu\n", CMeta::GetMemoryUsage());
 		
 
 		if(current_sm==ORDER_STATISTICS)
 			m_rank_d = CSeekTools::Init2DArray(iSearchDatasets, m_iGenes,
-				(ushort) 0);
+				(utype) 0);
 
 		//For outputing component weights!
 		vector<float> wc;
 		schedule(dynamic)
 		for(dd=0; dd<iSearchDatasets; dd++){
 			d = allRDatasets[dd];
-			ushort tid = omp_get_thread_num();
+			utype tid = omp_get_thread_num();
 			if(DEBUG) fprintf(stderr, "Dataset %d, %s\n",
 				d, m_vecstrDatasets[d].c_str());
 
 			CSeekIntIntMap *mapG = m_vc[d]->GetGeneMap();
 			CSeekIntIntMap *mapQ = m_vc[d]->GetQueryMap();
 
-			if(mapG->GetNumSet()<10000){
-				continue;
-			}
+			//if(mapG->GetNumSet()<10000){
+			//	continue;
+			//}
 
 			if(mapQ==NULL ||mapQ->GetNumSet()==0){
 				if(DEBUG) fprintf(stderr, "This dataset is skipped\n");
 				continue;
 			}
 
-			vector<ushort> this_q;
+			vector<utype> this_q;
 			for(j=0; j<mapQ->GetNumSet(); j++)
 				this_q.push_back(mapQ->GetReverse(j));
 
 				}
 
 				if(weightComponent && current_sm==CV){
-					ushort numFold = query.GetNumFold();
+					utype numFold = query.GetNumFold();
 					float ww;
 					for(j=0; j<numFold; j++){
 						//if((ww=m_vc[d]->GetCVWeight(j))==-1) continue;
 
 			if(DEBUG) fprintf(stderr, "Doing linear combination\n");
 
-			const ushort MIN_REQUIRED = max((ushort) 1, (ushort) (
+			const utype MIN_REQUIRED = max((utype) 1, (utype) (
 				m_fPercentQueryAfterScoreCutOff * this_q.size()));
 			CSeekWeighter::LinearCombine(m_rank_normal_threads[tid], this_q,
 				*m_vc[d], MIN_REQUIRED, m_bSquareZ);
 			if(DEBUG) fprintf(stderr,
 				"Adding contribution of dataset %d to master ranking: %.5f\n", d, w);
 
-			ushort iGeneSet = mapG->GetNumSet();
-			const vector<ushort> &allRGenes = mapG->GetAllReverse();
-			vector<ushort>::const_iterator iterR = allRGenes.begin();
-			vector<ushort>::const_iterator endR = allRGenes.begin() + iGeneSet;
-			vector<ushort> &Rank_Normal = m_rank_normal_threads[tid];
+			utype iGeneSet = mapG->GetNumSet();
+			const vector<utype> &allRGenes = mapG->GetAllReverse();
+			vector<utype>::const_iterator iterR = allRGenes.begin();
+			vector<utype>::const_iterator endR = allRGenes.begin() + iGeneSet;
+			vector<utype> &Rank_Normal = m_rank_normal_threads[tid];
 			float* Master_Rank = &m_master_rank_threads[tid][0];
 			float* Sum_Weight = &m_sum_weight_threads[tid][0];
-			ushort* Counts = &m_counts_threads[tid][0];
+			utype* Counts = &m_counts_threads[tid][0];
 
 			if(current_sm==ORDER_STATISTICS)
 				for(; iterR!=endR; iterR++){
 		int ret; //for system calls
 
 		if(m_bRandom){
-			/*ushort z, cz;
+			/*utype z, cz;
 			for(cz=0, z=0; z<m_iDatasets; z++)
 				if(m_weight[i][z]!=0) 
 					cz++;
 				CSeekTools::WriteArray(acBuffer, wc);
 				vector<vector<string> > vecParts;
 				vecParts.resize(query.GetNumFold());
-				ushort kk;
+				utype kk;
 				string strParts = "";
 				for(j=0; j<query.GetNumFold(); j++){
 					vecParts[j] = vector<string>();
-					const vector<ushort> &vu = query.GetCVQuery(j);
+					const vector<utype> &vu = query.GetCVQuery(j);
 					string s = "";
 					for(kk=0; kk<vu.size(); kk++){
 						vecParts[j].push_back(m_vecstrGenes[vu[kk]]);
 	return true;
 }
 
-bool CSeekCentral::CheckWeight(const ushort &i){
-	ushort j = 0;
+bool CSeekCentral::CheckWeight(const utype &i){
+	utype j = 0;
 	bool valid = false;
 	for(j=0; j<m_iDatasets; j++){
 		if(m_weight[i][j]!=0){
 }
 
 bool CSeekCentral::CopyTopGenes(CSeekQuery &csq, 
-	const vector<AResultFloat> &src, const ushort top){
-	ushort i, j;
-	vector<ushort> topGenes;
+	const vector<AResultFloat> &src, const utype top){
+	utype i, j;
+	vector<utype> topGenes;
 	for(i=0; i<top; i++){
 		if(src[i].f==-320) continue;
 		topGenes.push_back(src[i].i);
 }
 
 bool CSeekCentral::SetQueryScoreNull(const CSeekQuery &csq){
-	ushort j;
-	const vector<ushort> &query = csq.GetQuery();
+	utype j;
+	const vector<utype> &query = csq.GetQuery();
 	for(j=0; j<query.size(); j++){
 		m_master_rank[query[j]] = -320;
 	}
 }
 
 bool CSeekCentral::CVSearch(gsl_rng *rnd, const CSeekQuery::PartitionMode &PART_M,
-	const ushort &FOLD, const float &RATE){
+	const utype &FOLD, const float &RATE){
 	CSeekCentral::SearchMode sm = CV;
 	return CSeekCentral::Common(sm, rnd, &PART_M, &FOLD, &RATE);
 }
 	standard gene-set */
 bool CSeekCentral::CVCustomSearch(const vector< vector<string> > &newGoldStd,
 	gsl_rng *rnd, const CSeekQuery::PartitionMode &PART_M,
-	const ushort &FOLD, const float &RATE){
+	const utype &FOLD, const float &RATE){
 	CSeekCentral::SearchMode sm = CV_CUSTOM;
 	return CSeekCentral::Common(sm, rnd, &PART_M, &FOLD, &RATE,
 		NULL, &newGoldStd);
 bool CSeekCentral::VarianceWeightSearch(){
 	vector<vector<float> > weights;
 	weights.resize(m_vecstrAllQuery.size());
-	ushort i, j, k;
+	utype i, j, k;
 	for(i=0; i<m_vecstrAllQuery.size(); i++){
 		weights[i] = vector<float>();
 		CSeekTools::InitVector(weights[i], m_iDatasets, (float)0);
-		const vector<ushort> &allRDatasets =
+		const vector<utype> &allRDatasets =
 			m_searchdsetMap[i]->GetAllReverse();
-		ushort iSearchDatasets = m_searchdsetMap[i]->GetNumSet();
+		utype iSearchDatasets = m_searchdsetMap[i]->GetNumSet();
 
 		CSeekQuery q;
 		PrepareQuery(m_vecstrAllQuery[i], q);
-		const vector<ushort> &qGenes = q.GetQuery();
+		const vector<utype> &qGenes = q.GetQuery();
 
 		for(j=0; j<iSearchDatasets; j++){
-			ushort d = allRDatasets[j];
+			utype d = allRDatasets[j];
 			for(k=0; k<qGenes.size(); k++){
 				float gv = m_vc[d]->GetGeneVariance(qGenes[k]);
 				if(CMeta::IsNaN(gv)) continue;
 }
 
 bool CSeekCentral::Destruct(){
-	ushort j;
+	utype j;
 	//for(j=0; j<m_iDatasets; j++) m_vc[j]->DeleteQueryBlock();
 	for(j=0; j<m_iDatasets; j++){
 		if(m_vc[j]!=NULL) continue;
 	return m_Query;
 }
 
-ushort CSeekCentral::GetGene(const string &strGene) const{
+utype CSeekCentral::GetGene(const string &strGene) const{
 	if(m_mapstrintGene.find(strGene)==m_mapstrintGene.end())
 		return CSeekTools::GetNaN();
 	return m_mapstrintGene.find(strGene)->second;
 }
-string CSeekCentral::GetGene(const ushort &geneID) const{
+string CSeekCentral::GetGene(const utype &geneID) const{
 	return m_vecstrGenes[(size_t) geneID];
 }
 

File src/seekcentral.h

 		const vector<CSeekDBSetting*> &vecDBSetting,
 		const char *search_dset, const char *query,
 		const char* output_dir,
-		const ushort buffer = 20, const bool to_output_text = false,
+		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 bSubtractAvg = true, const bool bNormPlatform = false,
      */
 	bool Initialize(
 		const vector<CSeekDBSetting*> &vecDBSetting,
-		const ushort buffer = 20, const bool to_output_text = false,
+		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 bSubtractAvg = true, const bool bNormPlatform = false,
 	 * \remark The random number generator is used for partitioning the query.
 	 * \remark Assumes that the CSeekCentral::Initialize() has been called.
 	 */
-	bool CVSearch(gsl_rng*, const CSeekQuery::PartitionMode&, const ushort&, const float&);
+	bool CVSearch(gsl_rng*, const CSeekQuery::PartitionMode&, const utype&, const float&);
 
 	/*!
 	 * \brief Run Seek with the custom dataset weighting
 	 * \remark Assumes that the CSeekCentral::Initialize() has been called.
 	 */
 	bool CVCustomSearch(const vector< vector<string> > &, gsl_rng*,
-		const CSeekQuery::PartitionMode&, const ushort&, const float&);
+		const CSeekQuery::PartitionMode&, const utype&, const float&);
 
 	/*!
 	 * \brief Run Seek with the equal dataset weighting
 	 * \param strGene The \a gene-name as a \c string
 	 * \return The gene-map ID
 	 */
-	ushort GetGene(const string &strGene) const;
+	utype GetGene(const string &strGene) const;
 
 	/*!
 	 * \brief Get the \a gene-name for a given gene-map ID
 	 * \param geneID The gene-map ID
 	 * \return The \a gene-name as a \c string
 	 */
-	string GetGene(const ushort &geneID) const;
+	string GetGene(const utype &geneID) const;
 
 	/*!
 	 * \brief Destruct this search instance
 	/* Central search function */
 	bool Common(CSeekCentral::SearchMode&, gsl_rng* = NULL,
 		const CSeekQuery::PartitionMode* = NULL,
-		const ushort* = NULL, const float* = NULL,
+		const utype* = NULL, const float* = NULL,
 		const vector< vector<float> >* = NULL,
 		const vector< vector<string> >* = NULL);
 
-	bool CheckWeight(const ushort &i);
+	bool CheckWeight(const utype &i);
 	bool CopyTopGenes(CSeekQuery&, const vector<AResultFloat>&, 
-		const ushort);
+		const utype);
 	bool SetQueryScoreNull(const CSeekQuery&);
 	bool PrepareQuery(const vector<string>&, CSeekQuery&);
 	bool CalculateRestart();
 	bool PrepareOneQuery(CSeekQuery &, CSeekIntIntMap &, vector<float>&);
 	bool AggregateThreads();
-	bool FilterResults(const ushort &);
+	bool FilterResults(const utype &);
 	bool Sort(vector<AResultFloat> &);
-	bool Write(const ushort &);
+	bool Write(const utype &);
 	bool Display(CSeekQuery &, vector<AResultFloat>&);
 
 	/* Gene, Dataset, and Platform Mapping*/
 	vector<string> m_vecstrDatasets;
 	vector<string> m_vecstrDP;
 	map<string, string> m_mapstrstrDatasetPlatform;
-	map<string, ushort> m_mapstrintDataset;
-	map<string, ushort> m_mapstrintGene;
+	map<string, utype> m_mapstrintDataset;
+	map<string, utype> m_mapstrintGene;
 	vector<vector<string> > m_vecstrSearchDatasets;
 	vector<CSeekIntIntMap*> m_searchdsetMap;
 
 
 	/* Gene-gene correlation matrix for all datasets
 	 Organized per thread */
-	ushort ***m_rData;
+	utype ***m_rData;
 
 	/* Correlation discretization */
 	vector<float> m_quant;
 	/* multi-threaded programming */
 	float **m_master_rank_threads;
 	float **m_sum_weight_threads;
-	ushort **m_counts_threads;
-	vector<ushort> *m_rank_normal_threads;
-	vector<ushort> *m_rank_threads;
+	utype **m_counts_threads;
+	vector<utype> *m_rank_normal_threads;
+	vector<utype> *m_rank_threads;
 
 	/* Essential search results */
 	vector<float> m_master_rank;
 	vector<float> m_sum_weight;
-	vector<ushort> m_counts;
+	vector<utype> m_counts;
 
 	/* Holds results for all queries */
 	vector< vector<float> > m_weight;
 
 	/* Platform */
 	vector<CSeekPlatform> m_vp;
-	map<string, ushort> m_mapstriPlatform;
+	map<string, utype> m_mapstriPlatform;
 	vector<string> m_vecstrPlatform;
 
 	//CDatabase reference
 
 	size_t m_iDatasets;
 	size_t m_iGenes;
-	ushort m_numThreads;
+	utype m_numThreads;
 
-	ushort m_maxNumDB;
-	map<ushort, vector< vector<string> > > m_mapLoadTime;
+	utype m_maxNumDB;
+	map<utype, vector< vector<string> > > m_mapLoadTime;
 	bool DEBUG;
 
 	bool m_bOutputWeightComponent;
 	float m_fPercentQueryAfterScoreCutOff;
 
 	/* for order statistics, a datasets-by-genes matrix */
-	ushort **m_rank_d;
+	utype **m_rank_d;
 
 	/* for network mode */
 	int m_iClient;

File src/seekdataset.cpp

 	if(src->geneAverage.size()>0){
 		//fprintf(stderr, "Great a!\n");
 		geneAverage.resize(src->geneAverage.size());
-		ushort i;
+		utype i;
 		for(i=0; i<src->geneAverage.size(); i++){
 			geneAverage[i] = src->geneAverage[i];
 		}
 	if(src->genePresence.size()>0){
 		//fprintf(stderr, "Great b!\n");
 		genePresence.resize(src->genePresence.size());
-		ushort i;
+		utype i;
 		for(i=0; i<src->genePresence.size(); i++){
 			genePresence[i] = src->genePresence[i];
 		}
 	}
 	if(src->geneVariance.size()>0){
 		geneVariance.resize(src->geneVariance.size());
-		ushort i;
+		utype i;
 		for(i=0; i<src->geneVariance.size(); i++){
 			geneVariance[i] = src->geneVariance[i];
 		}
 		iNumGenes = 0;
 	}
 
-	ushort iSize = genePresence.size();
+	utype iSize = genePresence.size();
 	iNumGenes = iSize;
 	geneMap = new CSeekIntIntMap(src->geneMap);
 
 		cerr << "Gene average or gene presence unread" << endl;
 		return false;
 	}
-	ushort i;
-	ushort iSize = genePresence.size();
+	utype i;
+	utype iSize = genePresence.size();
 	iNumGenes = iSize;
 	geneMap = new CSeekIntIntMap(iSize);
 	vector<char>::const_iterator iterGenePresence = genePresence.begin();
 }
 
 
-bool CSeekDataset::InitializeQueryBlock(const vector<ushort> &queryBlock){
+bool CSeekDataset::InitializeQueryBlock(const vector<utype> &queryBlock){
 
 	DeleteQueryBlock();
 
 	dbMap = new CSeekIntIntMap(iNumGenes);
 
-	vector<ushort>::const_iterator iterQ = queryBlock.begin();
+	vector<utype>::const_iterator iterQ = queryBlock.begin();
 	for(; iterQ!=queryBlock.end(); iterQ++){
 		if(CSeekTools::IsNaN(geneMap->GetForward(*iterQ))){
 			//this query gene is not present in the dataset
 	//fprintf(stderr, "0x1 %lu %d %d\n", CMeta::GetMemoryUsage(), iDBSize, iNumGenes);
 	r = CSeekTools::Init2DArray(iDBSize, iNumGenes, (unsigned char) 255);
 	//fprintf(stderr, "0x2 %lu\n", CMeta::GetMemoryUsage());
-	//CSeekTools::Free2DArray((unsigned short**)r);
 	//free(r[0]);
 	//free(r);
 	//fprintf(stderr, "0x3 %lu\n", CMeta::GetMemoryUsage());
 }
 
 
-bool CSeekDataset::InitializeQuery(const vector<ushort> &query){
+bool CSeekDataset::InitializeQuery(const vector<utype> &query){
 	DeleteQuery();
 
 	if(iDBSize==0 || dbMap==NULL) return true;
 
 	queryMap = new CSeekIntIntMap(iNumGenes);
 
-	ushort i;
-	vector<ushort>::const_iterator iterQ = query.begin();
+	utype i;
+	vector<utype>::const_iterator iterQ = query.begin();
 
 	vector<AResult> a;
 	a.resize(query.size());
 	return true;
 }
 
-const vector<ushort>& CSeekDataset::GetQuery() const{
+const vector<utype>& CSeekDataset::GetQuery() const{
 	return this->query;
 }
 
-const vector<ushort>& CSeekDataset::GetQueryIndex() const{
+const vector<utype>& CSeekDataset::GetQueryIndex() const{
 	return this->queryIndex;
 }
 
-ushort** CSeekDataset::GetDataMatrix(){
+utype** CSeekDataset::GetDataMatrix(){
 	return rData;
 }
 
-bool CSeekDataset::InitializeDataMatrix(ushort **rD,
-	const vector<float> &quant, const ushort &iRows,
-	const ushort &iColumns, const bool bSubtractAvg,
+bool CSeekDataset::InitializeDataMatrix(utype **rD,
+	const vector<float> &quant, const utype &iRows,
+	const utype &iColumns, const bool bSubtractAvg,
 	const bool bNormPlatform, const bool logit,
 	const enum CSeekDataset::DistanceMeasure dist_measure,
 	const float cutoff, 
 		return false;
 	}
 
-	ushort i, j;
+	utype i, j;
 	rData = rD;
-	ushort ii;
-	ushort iNumGenes = geneMap->GetNumSet();
-	ushort iNumQueries = iQuerySize;
+	utype ii;
+	utype iNumGenes = geneMap->GetNumSet();
+	utype iNumQueries = iQuerySize;
 
 	//fprintf(stderr, "iNumQueries is %d\n", iNumQueries);
 	//iRows is the gene id, iColumns is the query id
 	//default value for all rData entries is 0
-	memset(&rData[0][0], 0, sizeof(ushort)*iRows*iColumns);
+	memset(&rData[0][0], 0, sizeof(utype)*iRows*iColumns);
 
 	//assume queryIndex is already sorted
-	vector<ushort> offset;
+	vector<utype> offset;
 	offset.push_back(0);
 	for(i=1; i<queryIndex.size(); i++)
 		offset.push_back(queryIndex[i] - queryIndex[i-1]);
 
 			//GetColumns() is numQuery
 			for(j=0; j<iNumQueries; j++){
-				ushort jj = this->query[j];
+				utype jj = this->query[j];
 				platform_avg[j] = platform->GetPlatformAvg(jj);
 				platform_stdev[j] = platform->GetPlatformStdev(jj);
 			}
 
-			const vector<ushort> &allRGenes = geneMap->GetAllReverse();
+			const vector<utype> &allRGenes = geneMap->GetAllReverse();
 			float a = 0;
 			float vv = 0;
 			unsigned char x = 0;
-			ushort iGeneMapSize = geneMap->GetNumSet();
+			utype iGeneMapSize = geneMap->GetNumSet();
 			if(logit){ //NOT checked
 				for(ii=0; ii<iGeneMapSize; ii++){
 					for(j=0, i = allRGenes[ii], a=GetGeneAverage(i);
 						vv = max((float) min(vv, (float)3.2), (float)-3.2);
 						//By default, cutoff = -nan (i.e., always true)
 						if(vv>cutoff){
-							rData[i][j]= (ushort) (vv*100.0) + 320;
+							rData[i][j]= (utype) (vv*100.0) + 320;
 							//fprintf(stderr, "%.5f %.5f %.5f %.5f\n", quant[x], vv, a, platform_avg[j]);
 						}else{
 							rData[i][j] = 0;
 							/ platform_stdev[j];
 						vv = max((float) min(vv, (float)3.2), (float)-3.2);
 						if(vv>cutoff){
-							rData[i][j]= (ushort) (vv*100.0) + 320;
+							rData[i][j]= (utype) (vv*100.0) + 320;
 							//fprintf(stderr, "r %.2f\n", quant[x]);
 						}else{
 							rData[i][j]= 0;
 						vv = max((float)-3.2, (float)min((float) 3.2, (float) vv));
 						//fprintf(stderr, "%.5f %.5f %.5f\n", quant[x], vv, a);
 						if(vv>cutoff){
-							rData[i][j]= (ushort) (vv*100.0) + 320;
+							rData[i][j]= (utype) (vv*100.0) + 320;
 						}else{
 							rData[i][j] = 0;
 						}
 						vv = quant[x] - a;
 						vv = max((float) min((float)vv, (float)3.2), (float)-3.2);
 						if(vv>cutoff){
-							rData[i][j]= (ushort) (vv*100.0) + 320;
+							rData[i][j]= (utype) (vv*100.0) + 320;
 						}else{
 							rData[i][j] = 0;
 						}
 				float vv = log(quant[x]) - log((float) 1.0 - quant[x]);
 				vv = max((float) min(vv, (float)3.2), (float)-3.2);
 				if(vv>cutoff){
-					rData[i][j] = (ushort) (vv*100.0) + 320;
+					rData[i][j] = (utype) (vv*100.0) + 320;
 				}else{
 					rData[i][j] = 0;
 				}
 								   //precision, should put value to range 
 								   //(-3.0 to 3.0)
 					vv = max((float) min(vv, (float)3.2), (float)-3.2);
-					rData[i][j] = (ushort) (vv*100.0) + 320;
+					rData[i][j] = (utype) (vv*100.0) + 320;
 				}else{
-					rData[i][j] = (ushort) 0; 	//default value for 
+					rData[i][j] = (utype) 0; 	//default value for 
 												//not meeting cutoff
 				}
 			}
 
 				vv = max((float) min(vv, (float)3.2), (float)-3.2);
 				if(vv>cutoff){
-					rData[i][j] = (ushort) (vv*100.0) + 320;
+					rData[i][j] = (utype) (vv*100.0) + 320;
 				}else{
 					rData[i][j] = 0;
 				}
 	}
 
 	if(bRandom){
-		vector<vector<ushort> > allRandom;
+		vector<vector<utype> > allRandom;
 		allRandom.resize(iNumQueries);
 		for(i=0; i<iNumQueries; i++){
-			allRandom[i] = vector<ushort>();
+			allRandom[i] = vector<utype>();
 		}
 
 		for(ii=0; ii<iNumGenes; ii++){
 			}
 		}
 
-		ushort **a = CSeekTools::Init2DArray(iNumQueries, max_size, (ushort)0);
+		utype **a = CSeekTools::Init2DArray(iNumQueries, max_size, (utype)0);
 
 		for(i=0; i<iNumQueries; i++){
 			for(j=0; j<allRandom[i].size(); j++){
 				a[i][j] = allRandom[i][j];
 			}
-			gsl_ran_shuffle(rand, a[i], allRandom[i].size(), sizeof(ushort));
+			gsl_ran_shuffle(rand, a[i], allRandom[i].size(), sizeof(utype));
 		}
 
 		vector<int> k;
 	return m_fDsetStdev;
 }
 
-float CSeekDataset::GetGeneVariance(const ushort &i) const{
+float CSeekDataset::GetGeneVariance(const utype &i) const{
 	return geneVariance[i];
 }
 
-float CSeekDataset::GetGeneAverage(const ushort &i) const{
+float CSeekDataset::GetGeneAverage(const utype &i) const{
 	return geneAverage[i];
 }
 
-ushort CSeekDataset::GetNumGenes() const{
+utype CSeekDataset::GetNumGenes() const{
 	return iNumGenes;
 }
 
-bool CSeekDataset::InitializeCVWeight(const ushort &i){
+bool CSeekDataset::InitializeCVWeight(const utype &i){
 	weight.clear();
 	weight.resize(i);
 	sum_weight = -1;
 	return true;
 }
 
-bool CSeekDataset::SetCVWeight(const ushort &i, const float &f){
+bool CSeekDataset::SetCVWeight(const utype &i, const float &f){
 	weight[i] = f;
 	return true;
 }
 
-float CSeekDataset::GetCVWeight(const ushort &i){
+float CSeekDataset::GetCVWeight(const utype &i){
 	return weight[i];
 }
 
 }
 
 float CSeekDataset::GetDatasetSumWeight(){
-	ushort i;
-	ushort num = 0;
+	utype i;
+	utype num = 0;
 	if(sum_weight==-1){
 		for(sum_weight=0, i=0; i<weight.size(); i++){
 			if(weight[i]==-1) continue;

File src/seekdataset.h

 		const string &sinfo, const string &plat,
 		const string &prep, const string &db,
 		const string &gene, const string &quant,
-		const string &dset, const ushort &numDB){
+		const string &dset, const utype &numDB){
 		m_gvarDirectory = gvar;
 		m_sinfoDirectory = sinfo;
 		m_platformDirectory = plat;
 		const char* sinfo, const char* plat,
 		const char* prep, const char* db,
 		const char* gene, const char* quant,
-		const char* dset, const ushort &numDB){
+		const char* dset, const utype &numDB){
 		m_gvarDirectory = gvar;
 		m_sinfoDirectory = sinfo;
 		m_platformDirectory = plat;
 			return "NULL";
 	}
 
-	ushort GetNumDB(){
+	utype GetNumDB(){
 		return m_numDB;
 	}
 
 	string m_geneMapFile;
 	string m_quantFile;
 	string m_dsetFile;
-	ushort m_numDB;
+	utype m_numDB;
 };
 
 
 	 *
 	 * Indicates which query genes are present in the dataset.
 	 */
-	bool InitializeQuery(const vector<ushort> &);
+	bool InitializeQuery(const vector<utype> &);
 
 	/*!
 	 * \brief
 	 * Flattens all the queries into one vector that contains only the unique query genes, then
 	 * constructs a presence map based on this vector.
 	 */
-	bool InitializeQueryBlock(const vector<ushort> &);
+	bool InitializeQueryBlock(const vector<utype> &);
 
 	/*!
 	 * \brief
 	 * \endcode
 	 * Then if a \a correlation is 2.5, the discretized value would be 2.
 	 */
-	bool InitializeDataMatrix(ushort**, const vector<float> &,
-		const ushort&, const ushort&, const bool=true, 
+	bool InitializeDataMatrix(utype**, const vector<float> &,
+		const utype&, const utype&, const bool=true, 
 		const bool=false, const bool=false,
 		const enum DistanceMeasure=Z_SCORE,
 		const float cutoff=-1.0*CMeta::GetNaN(), 
 	 * \brief
 	 * Get the gene-gene \a correlation matrix
 	 *
-	 * \return A two-dimensional array of type \c ushort. Note that the
+	 * \return A two-dimensional array of type \c utype. Note that the
 	 * \a correlation has been scaled to a integer range from 0 to 640.
 	 * See CSeekDataset::InitializeDataMatrix.
 	 *
 	 */
-	ushort** GetDataMatrix();
+	utype** GetDataMatrix();
 
 	/*!
 	 * \brief
 	 * \brief Get the query genes
 	 * \return A vector of queries
 	 */
-	const vector<ushort>& GetQuery() const;
+	const vector<utype>& GetQuery() const;
 
 	/*!
 	 * \brief Get the query gene indices
 	 * \return A vector of query gene indices
 	 */
-	const vector<ushort>& GetQueryIndex() const;
+	const vector<utype>& GetQueryIndex() const;
 
 	/*!
 	 * \brief Get the gene expression variance vector
 	 * \return The variance vector
 	 */
-	float GetGeneVariance(const ushort&) const;
+	float GetGeneVariance(const utype&) const;
 	/*!
 	 * \brief Get the gene average \a correlation vector
 	 * \return The average \a correlation vector
 	 */
-	float GetGeneAverage(const ushort&) const;
+	float GetGeneAverage(const utype&) const;
 	/*!
 	 * \brief Get the mean of the global gene-gene Pearson distribution
 	 * \return The mean Pearson for the dataset
 	 * \brief Get the genome size
 	 * \return The genome size
 	 */
-	ushort GetNumGenes() const;
+	utype GetNumGenes() const;
 
 	/*!
 	 * \brief Initialize the weight of the dataset
 	 * Initializes the total dataset weight, and the score of the
 	 * individual cross-validation (CV) runs. 
 	 */
-	bool InitializeCVWeight(const ushort&);
+	bool InitializeCVWeight(const utype&);
 
 	/*!
 	 * \brief Set the score for a particular cross-validation
 	 * \param i The index
 	 * \param f The validation score
 	 */
-	bool SetCVWeight(const ushort&, const float&);
+	bool SetCVWeight(const utype&, const float&);
 
 	/*!
 	 * \brief Get the score for a particular cross-validation
 	 * \param i The index
 	 */
-	float GetCVWeight(const ushort&);
+	float GetCVWeight(const utype&);
 
 	/*!
 	 * \brief Get all the cross-validation scores
 
 	CSeekIntIntMap *dbMap;
 	CSeekIntIntMap *queryMap;
-	vector<ushort> query;
-	vector<ushort> queryIndex;
+	vector<utype> query;
+	vector<utype> queryIndex;
 
-	ushort iQuerySize;
-	ushort iNumGenes;
-	ushort iDBSize;
+	utype iQuerySize;
+	utype iNumGenes;
+	utype iDBSize;
 
 	vector<float> weight;
 
-	ushort **rData;
+	utype **rData;
 	unsigned char **r;
 
 	float sum_weight;

File src/seekevaluate.cpp

 namespace Sleipnir {
 
 bool CSeekPerformanceMeasure::SortRankVector(
-	const vector<unsigned short> &rank,
+	const vector<utype> &rank,
 	const CSeekIntIntMap &mapG, vector<AResult> &a,
 	//optional argument
-	const ushort top){
+	const utype top){
 
-	ushort numGenesD = mapG.GetNumSet();
-	ushort TOP = 0;
-	ushort numNonZero = 0;
-	ushort i;
+	utype numGenesD = mapG.GetNumSet();
+	utype TOP = 0;
+	utype numNonZero = 0;
+	utype i;
 	bool DEBUG = false;
 
 	//a should be the same size as rank
 	if(top==0) TOP = rank.size();
 	else TOP = top;
 
-	vector<ushort>::const_iterator itRank = rank.begin();
+	vector<utype>::const_iterator itRank = rank.begin();
 	vector<AResult>::iterator itA = a.begin();
 	for(i = 0; itRank!=rank.end(); itRank++, itA++, i++){
 		itA->i = i;
 /* designed specifically for a CSeekDataset */
 /* mask: the query genes which are not included in RBP calcualtion */
 bool CSeekPerformanceMeasure::RankBiasedPrecision(const float &rate,
-	const vector<unsigned short> &rank, float &rbp,
+	const vector<utype> &rank, float &rbp,
 	const vector<char> &mask, const vector<char> &gold,
 	const CSeekIntIntMap &mapG, vector<AResult> *ar,
 	/* optional arguments */
-	const ushort top){
+	const utype top){
 
-	ushort i, ii, j, jj;
+	utype i, ii, j, jj;
 	float x;
 
-	ushort TOP = top;
+	utype TOP = top;
 	if(top==0) TOP = rank.size();
 
 	//ar should be same size as rank
 }
 
 bool CSeekPerformanceMeasure::AveragePrecision(
-	const vector<unsigned short> &rank, float &ap,
+	const vector<utype> &rank, float &ap,
 	const vector<char> &mask, const vector<char> &gold,
 	const CSeekIntIntMap &mapG, vector<AResult> *ar){
 
-	ushort i, ii, j, jj;
+	utype i, ii, j, jj;
 	float x;
 
-	ushort TOP = rank.size();
+	utype TOP = rank.size();
 
 	//ar should be same size as rank
 	vector<AResult> *sing = ar;

File src/seekevaluate.h

 namespace Sleipnir {
 
 struct AResult{
-	unsigned short i;
-	unsigned short f;
+	utype i;
+	utype f;
 	bool operator<(const AResult& val) const{
 		/*if(f<=val.f){
 			return false;
 
 
 struct AResultFloat{
-	unsigned short i;
+	utype i;
 	float f;
 	bool operator<(const AResultFloat& val) const{
 		/*if(f<=val.f){
 	 * The struct \c AResult represents a (gene ID, gene score) pair. This function sorts the vector of
 	 * \c AResult in the descending order of the gene score.
 	 */
-	static bool SortRankVector(const vector<unsigned short> &rank,
+	static bool SortRankVector(const vector<utype> &rank,
 		const CSeekIntIntMap &mapG, vector<AResult> &a,
-		const ushort top = 0);
+		const utype top = 0);
 
 	/*!
 	 * \brief Calculate the rank-biased precision for a gene ranking
 	/* designed specifically for a CSeekDataset */
 	/* mask: the query genes which are not included in RBP calcualtion */
 	static bool RankBiasedPrecision(const float &rate,
-		const vector<unsigned short> &rank, float &rbp,
+		const vector<utype> &rank, float &rbp,
 		const vector<char> &mask, const vector<char> &gold,
 		const CSeekIntIntMap &mapG, vector<AResult> *sing,
 		/* optional */
-		const ushort top = 0);
+		const utype top = 0);
 
 	/*!
 	 * \brief Calculate the average precision for a gene ranking
 	 * \param ar The sorted vector of (gene ID, gene score) pairs
 	 */
 	static bool AveragePrecision(
-		const vector<unsigned short> &rank, float &ap,
+		const vector<utype> &rank, float &ap,
 		const vector<char> &mask, const vector<char> &gold,
 		const CSeekIntIntMap &mapG, vector<AResult> *ar);
 

File src/seekmap.cpp

 /*
  * IntIntMap Data Structure
  */
-void CSeekIntIntMap::Initialize(const ushort &iSize){
+void CSeekIntIntMap::Initialize(const utype &iSize){
 	m_iF.resize(iSize);
 	m_iR.resize(iSize);
 	m_iSize = iSize;
 	Clear();
 }
-CSeekIntIntMap::CSeekIntIntMap(const ushort &iSize){
+CSeekIntIntMap::CSeekIntIntMap(const utype &iSize){
 	Initialize(iSize);
 }
 
-const vector<ushort>& CSeekIntIntMap::GetAllForward() const{
+const vector<utype>& CSeekIntIntMap::GetAllForward() const{
 	return m_iF;
 }
 
-const vector<ushort>& CSeekIntIntMap::GetAllReverse() const{
+const vector<utype>& CSeekIntIntMap::GetAllReverse() const{
 	return m_iR;
 }
 
 }
 
 
-CSeekIntIntMap::CSeekIntIntMap(const char *cP, const ushort &iSize,
+CSeekIntIntMap::CSeekIntIntMap(const char *cP, const utype &iSize,
 	const bool bReverse){
 	Initialize(iSize);
 	Reset(cP, bReverse);
 	m_iSize = 0;
 }
 
-ushort CSeekIntIntMap::GetForward(const ushort &i) const{
+utype CSeekIntIntMap::GetForward(const utype &i) const{
 	return m_iF[i];
 }
 
-ushort CSeekIntIntMap::GetReverse(const ushort &i) const{
+utype CSeekIntIntMap::GetReverse(const utype &i) const{
 	return m_iR[i];
 }
 
-void CSeekIntIntMap::Add(const ushort &i){
+void CSeekIntIntMap::Add(const utype &i){
 	m_iF[i] = m_iNumSet;
 	*m_iterR = i;
 	m_iterR++;
 }
 
 void CSeekIntIntMap::Clear(){
-	vector<ushort>::iterator iterF = m_iF.begin();
-	vector<ushort>::iterator iterR = m_iR.begin();
+	vector<utype>::iterator iterF = m_iF.begin();
+	vector<utype>::iterator iterR = m_iR.begin();
 	for(; iterF!=m_iF.end(); iterF++, iterR++){
 		*iterF = -1;
 		*iterR = -1;
 	m_iterR = m_iR.begin();
 }
 
-ushort CSeekIntIntMap::GetNumSet() const{
+utype CSeekIntIntMap::GetNumSet() const{
 	return m_iNumSet;
 }
 
-ushort CSeekIntIntMap::GetSize() const{
+utype CSeekIntIntMap::GetSize() const{
 	return m_iSize;
 }
 
 void CSeekIntIntMap::Reset(const char *cP, const bool bReverse){
-	ushort i;
+	utype i;
 	if(bReverse==false){
 		for(i=0; i<m_iSize; i++){
 			if(cP[i]==1){
 }
 
 void CSeekIntIntMap::Reset(const vector<char> &cP, const bool bReverse){
-	ushort i;
+	utype i;
 	if(bReverse==false){
 		for(i=0; i<m_iSize; i++){
 			if(cP[i]==1){
 
 void CSeekStrIntMap::SetAll(const vector<string> &s){
 	Clear();
-	ushort i = 0;
+	utype i = 0;
 	for(i=0; i<s.size(); i++){
 		m_mapstrint[s[i]] = i;
 		m_mapintstr[i] = s[i];
 	}
 }
 
-void CSeekStrIntMap::Set(const string &s, const ushort &i){
+void CSeekStrIntMap::Set(const string &s, const utype &i){
 	m_mapstrint[s] = i;
 	m_mapintstr[i] = s;
 }
 
-map<string, ushort>& CSeekStrIntMap::GetMapForward(){
+map<string, utype>& CSeekStrIntMap::GetMapForward(){
 	return m_mapstrint;
 }
 
-map<ushort, string>& CSeekStrIntMap::GetMapReverse(){
+map<utype, string>& CSeekStrIntMap::GetMapReverse(){
 	return m_mapintstr;
 }
 
 
-ushort CSeekStrIntMap::Get(const string &s) const{
-	map<string, ushort>::const_iterator	iter = m_mapstrint.find(s);
+utype CSeekStrIntMap::Get(const string &s) const{
+	map<string, utype>::const_iterator	iter = m_mapstrint.find(s);
 	return iter->second;
 }
 
-string CSeekStrIntMap::Get(const ushort &i) const{
-	map<ushort, string>::const_iterator	iter = m_mapintstr.find(i);
+string CSeekStrIntMap::Get(const utype &i) const{
+	map<utype, string>::const_iterator	iter = m_mapintstr.find(i);
 	return iter->second;
 }
 
-ushort CSeekStrIntMap::GetSize() const{
+utype CSeekStrIntMap::GetSize() const{
 	return m_mapintstr.size();
 }
 
 	vector<string> vecStr;
 	vecStr.clear();
 	vecStr.resize(GetSize());
-	map<string, ushort>::const_iterator	iter = m_mapstrint.begin();
+	map<string, utype>::const_iterator	iter = m_mapstrint.begin();
 	vector<string>::iterator iterV = vecStr.begin();
 	for(; iter!=m_mapstrint.end(); iter++, iterV++)
 		*iterV = iter->first;
 	return vecStr;
 }
 
-vector<ushort> CSeekStrIntMap::GetAllInteger() const{
-	vector<ushort> vecInt;
+vector<utype> CSeekStrIntMap::GetAllInteger() const{
+	vector<utype> vecInt;
 	vecInt.clear();
 	vecInt.resize(GetSize());
-	map<ushort, string>::const_iterator	iter = m_mapintstr.begin();
-	vector<ushort>::iterator iterV = vecInt.begin();
+	map<utype, string>::const_iterator	iter = m_mapintstr.begin();
+	vector<utype>::iterator iterV = vecInt.begin();
 	for(; iter!=m_mapintstr.end(); iter++, iterV++)
 		*iterV = iter->first;
 	return vecInt;

File src/seekmap.h

 	 * \brief Constructor
 	 * \param iSize The number of genes in the gene-database
 	 */
-	CSeekIntIntMap(const ushort&);
+	CSeekIntIntMap(const utype&);
 
 	/*!
 	 * \brief Constructor
 	 * If \c bReverse is true, then this map captures only the absent genes in the dataset.
 	 * By default, \c bReverse is false.
 	 */
-	CSeekIntIntMap(const char*, const ushort &, const bool=false);
+	CSeekIntIntMap(const char*, const utype &, const bool=false);
 
 	/*!
 	 * \brief Copy constructor
 	 * \brief Helper function that is used by constructor
 	 * \param iSize The genome size
 	 */
-	void Initialize(const ushort&);
+	void Initialize(const utype&);
 
 	/*!
 	 * \brief Destructor
 	 * \param i Element index
 	 * \return The item at the index
 	 */
-	ushort GetForward(const ushort &) const;
+	utype GetForward(const utype &) const;
 
 	/*!
 	 * \brief Get an element from the \a reverse array
 	 * \param i Element index
 	 * \return The item at the index
 	 */
-	ushort GetReverse(const ushort &) const;
+	utype GetReverse(const utype &) const;
 
 	/*!
 	 * \brief Get the entire \a forward array
 	 * \return The \a forward array
 	 */
-	const vector<ushort>& GetAllForward() const;
+	const vector<utype>& GetAllForward() const;
 
 	/*!
 	 * \brief Get the entire \a reverse array
 	 * \return The \a reverse array
 	 */
-	const vector<ushort>& GetAllReverse() const;
+	const vector<utype>& GetAllReverse() const;
 
 	/*!
 	 * \brief Add an available gene to the map
 	 * \remark The gene ID is a number between 0 and 21000 (the genome size). 
 	 * It is specified by the gene ID mapping file \c gene_map.txt.
 	 */
-	void Add(const ushort&);
+	void Add(const utype&);
 
 	/*!
 	 * \brief Clear the member arrays in the structure
 	 * \brief Get the number of present genes that are currently contained in the map
 	 * \return The number of genes that are present
 	 */
-	ushort GetNumSet() const;
+	utype GetNumSet() const;
 
 	/*!
 	 * \brief Get the genome size
 	 * \return The genome size
 	 */
-	ushort GetSize() const;
+	utype GetSize() const;
 
 private:
-	vector<ushort> m_iF;
-	vector<ushort> m_iR;
-	vector<ushort>::iterator m_iterR;
-	ushort m_iSize;
-	ushort m_iNumSet;
+	vector<utype> m_iF;
+	vector<utype> m_iR;
+	vector<utype>::iterator m_iterR;
+	utype m_iSize;
+	utype m_iNumSet;
 };
 
 /*!
 	/*!
 	 * \brief Add a pair to the map
 	 * \param s The string
-	 * \param i The integer in unsigned short (ushort)
+	 * \param i The integer in utype
 	 */
-	void Set(const string&, const ushort&);
+	void Set(const string&, const utype&);
 	/*!
 	 * \brief Add all the pairs at once
 	 * \param s A vector of string
 	/*!
 	 * \brief Get the corresponding integer for the given string
 	 */
-	ushort Get(const string&) const;
+	utype Get(const string&) const;
 	/*!
 	 * \brief Get the entire map with key=string, value=integer
 	 */
-	map<string, ushort>& GetMapForward();
+	map<string, utype>& GetMapForward();
 	/*!
 	 * \brief Get the entire map with key=integer, value=string
 	 */
-	map<ushort, string>& GetMapReverse();
+	map<utype, string>& GetMapReverse();
 	/*!
 	 * \brief Get the genome size
 	 */
-	ushort GetSize() const;
+	utype GetSize() const;
 	/*!
 	 * \brief Get the corresponding string for the given integer
 	 */
-	string Get(const ushort &) const;
+	string Get(const utype &) const;
 	/*!
 	 * \brief Retrieve all the strings in the map as a vector
 	 */
 	/*!
 	 * \brief Retrieve all the integers in the map as a vector
 	 */
-	vector<ushort> GetAllInteger() const;
+	vector<utype> GetAllInteger() const;
 private:
-	map<string, ushort> m_mapstrint;
-	map<ushort, string> m_mapintstr;
+	map<string, utype> m_mapstrint;
+	map<utype, string> m_mapintstr;
 };
 
 }

File src/seekplatform.cpp

 		m_vecfPlatformStdev.begin());
 }
 
-void CSeekPlatform::InitializePlatform(const ushort &numGenes,
+void CSeekPlatform::InitializePlatform(const utype &numGenes,
 		const string &strPlatformName){
 	m_iNumGenes = numGenes;
 	CSeekTools::InitVector(m_vecfPlatformAvg, numGenes, (float) 0);
 	m_strPlatformName = strPlatformName;
 }
 
-void CSeekPlatform::SetPlatformAvg(const ushort &i, const float &val){
+void CSeekPlatform::SetPlatformAvg(const utype &i, const float &val){
 	m_vecfPlatformAvg[i] = val;
 }
 	
-void CSeekPlatform::SetPlatformStdev(const ushort &i, const float &val){
+void CSeekPlatform::SetPlatformStdev(const utype &i, const float &val){
 	m_vecfPlatformStdev[i] = val;
 }
 	
-float CSeekPlatform::GetPlatformAvg(const ushort &i) const{
+float CSeekPlatform::GetPlatformAvg(const utype &i) const{
 	return m_vecfPlatformAvg[i];
 }
 
-float CSeekPlatform::GetPlatformStdev(const ushort &i) const{
+float CSeekPlatform::GetPlatformStdev(const utype &i) const{
 	return m_vecfPlatformStdev[i];
 }
 

File src/seekplatform.h

 	 * \param strPlatformName
 	 * Assign a name to the platform
 	 */
-	void InitializePlatform(const ushort &, const string &);
+	void InitializePlatform(const utype &, const string &);
 
 	/*!
 	 * \brief Set the platform \a correlation average for a particular gene
 	 * \param i Gene index
 	 * \param val The average \a correlation for the gene
 	 */
-	void SetPlatformAvg(const ushort &, const float &);
+	void SetPlatformAvg(const utype &, const float &);
 
 	/*!
 	 * \brief Set the platform standard deviation of \a correlation for a given gene
 	 * \param i Gene index
 	 * \param val The standard deviation
 	 */
-	void SetPlatformStdev(const ushort &, const float &);
+	void SetPlatformStdev(const utype &, const float &);
 
 	/*!
 	 * \brief Get the platform-wide \a correlation average for a given gene
 	 * \param i Gene index
 	 * \return The platform-wide average
 	 */
-	float GetPlatformAvg(const ushort &) const;
+	float GetPlatformAvg(const utype &) const;
 
 	/*!
 	 * \brief Get the platform-wide standard deviation of \a correlation for a given gene
 	 * \param i Gene index
 	 * \return The platform-wide standard deviation
 	 */
-	float GetPlatformStdev(const ushort &) const;
+	float GetPlatformStdev(const utype &) const;
 
 	/*!
 	 * \brief Reset
 	vector<float> m_vecfPlatformAvg;
 	vector<float> m_vecfPlatformStdev;
 	string m_strPlatformName;
-	ushort m_iNumGenes;
+	utype m_iNumGenes;
 };
 
 }

File src/seekquery.cpp

 
 bool CSeekQuery::InitializeQuery(const vector<char> &query){
 	Reset();
-	ushort i;
+	utype i;
 	queryGenePresence.resize(query.size());
 
 	for(i=0; i<query.size(); i++){
 	return true;
 }
 
-bool CSeekQuery::InitializeQuery(const vector<ushort> &query,
-	const ushort &iGenes){
+bool CSeekQuery::InitializeQuery(const vector<utype> &query,
+	const utype &iGenes){
 	Reset();
-	ushort i;
+	utype i;
 	queryGenePresence.resize(iGenes);
 	fill(queryGenePresence.begin(), queryGenePresence.end(), (char) 0);
 	for(i=0; i<query.size(); i++){
 	return true;
 }
 
-ushort CSeekQuery::GetNumFold() const{
+utype CSeekQuery::GetNumFold() const{
 	return iNumFold;
 }
 
 	return queryGenePresence;
 }
 
-const vector<ushort>& CSeekQuery::GetQuery() const{
+const vector<utype>& CSeekQuery::GetQuery() const{
 	return queryGenes;
 }
 
-const vector<ushort>& CSeekQuery::GetCVQuery(ushort &i) const{
+const vector<utype>& CSeekQuery::GetCVQuery(utype &i) const{
 	return crossValGenes[i];
 }
 
 bool CSeekQuery::CreateCVPartitions(const gsl_rng *rnd,
-		const CSeekQuery::PartitionMode &p, const ushort iFold){
+		const CSeekQuery::PartitionMode &p, const utype iFold){
 	//must have run initializequery beforehand
 	if(p!=LEAVE_ONE_IN && p!=LEAVE_ONE_OUT && p!=CUSTOM_PARTITION){
 		cerr << "Error, unknown partition mode" << endl;
 		return false;
 	}
 	qSize = queryGenes.size();
-	ushort fold_size = 0;
-	ushort iFoldx = iFold;
+	utype fold_size = 0;
+	utype iFoldx = iFold;
 	if(CSeekTools::IsNaN(iFold)){
 		if(p==LEAVE_ONE_IN){
 			iFoldx = qSize;
 	}
 	iNumFold = iFoldx;
 	iFoldSize = fold_size;
-	crossValGenes = new vector<ushort>[iNumFold];
+	crossValGenes = new vector<utype>[iNumFold];
 	//printf("Fold size %d %d\n", iNumFold, iFoldSize);
 
-	ushort i, j, k;
-	ushort *q_b = (ushort*)malloc(qSize*sizeof(ushort));
+	utype i, j, k;
+	utype *q_b = (utype*)malloc(qSize*sizeof(utype));
 	for(i=0; i<qSize; i++){
 		q_b[i] = queryGenes[i];
 		//printf("%d ", q_b[i]);
 	}
 	//printf("\n");
 	//getchar();
-	gsl_ran_shuffle(rnd, q_b, qSize, sizeof(ushort));
+	gsl_ran_shuffle(rnd, q_b, qSize, sizeof(utype));
 
 	if(p==LEAVE_ONE_IN || p==CUSTOM_PARTITION){
 		k = 0;
 			crossValGenes[i].resize(crossValGenes[i].size());
 		}
 	}else if(p==LEAVE_ONE_OUT){
-		ushort current_index = -1;
+		utype current_index = -1;
 		for(i=0; i<iNumFold; i++){
 			for(j=0; j<iFoldSize; j++){
 				current_index = (i+j) % qSize;

File src/seekquery.h

  * All elements are 0 except the elements indexed by the query genes, which have
  * a value of 1.
  *
- * \li A \c ushort vector, with number of elements = size of query.
+ * \li A \c utype vector, with number of elements = size of query.
  * A compact representation which only stores the query genes' ID. 
  */
 class CSeekQuery{
      * Initialize with a vector of query genes' ID
      *
      * \param query
-     * A \c ushort-vector that stores the query genes' ID
+     * A \c utype-vector that stores the query genes' ID
      *
      * \param iGenes
      * The number of genes in the genome
      * valid \c query parameter is <201, 242, 42>, 
      * and \c iGenes is 21000 (if there are 21000 genes).
      */
-	bool InitializeQuery(const vector<ushort>&, const ushort &);
+	bool InitializeQuery(const vector<utype>&, const utype &);
 
     /*!
      * \brief Get the number of query partitions
      * \return The number of query partitions
      */
-	ushort GetNumFold() const;
+	utype GetNumFold() const;
     
     /*!
      * \brief Get the query genes as a vector
-     * \return The query genes as a \c ushort vector
+     * \return The query genes as a \c utype vector
      */
-	const vector<ushort>& GetQuery() const;
+	const vector<utype>& GetQuery() const;
     
     /*!
      * \brief Get the query presence as a \c char vector
      * \remarks
      * No bound checking on \c i.
      */
-	const vector<ushort>& GetCVQuery(ushort&) const;
+	const vector<utype>& GetCVQuery(utype&) const;
     
     /*!
      * \brief
      *
      */
 	bool CreateCVPartitions(const gsl_rng*, \
-		const enum PartitionMode &, const ushort=-1);
+		const enum PartitionMode &, const utype=-1);
 
 private:
-	vector<ushort> queryGenes;
+	vector<utype> queryGenes;
 	vector<char> queryGenePresence;
 
-	vector<ushort> *crossValGenes;
-	ushort iNumFold;
-	ushort iFoldSize;
-	ushort qSize;
+	vector<utype> *crossValGenes;
+	utype iNumFold;
+	utype iFoldSize;
+	utype qSize;
 
 };
 

File src/seekreader.cpp

 	return ss.str();//return a string with the contents of the stream
 }
 
-bool CSeekTools::IsNaN(const ushort &v){
-	if(v==65535) return true;
+bool CSeekTools::IsNaN(const utype &v){
+	if(v==MAX_UTYPE) return true;
 	return false;
 }
 
-ushort CSeekTools::GetNaN(){
-	return 65535;
+utype CSeekTools::GetNaN(){
+	return MAX_UTYPE;
 }
 
 bool CSeekTools::ReadDatabaselets(const vector<CDatabase*> &DB,
 	const size_t &iGenes, const size_t &iDatasets,
 	const vector< vector<string> > &vecstrAllQuery,
-	vector<CSeekDataset*> &vc, const map<string,ushort> &mapstriGenes,
+	vector<CSeekDataset*> &vc, const map<string,utype> &mapstriGenes,
 	const vector<vector<string> > &dbDatasets,
-	const map<string,ushort> &mapstriDatasets,
+	const map<string,utype> &mapstriDatasets,
 	//network mode (data sent to client)
 	const int &iClient, const bool &bNetwork){
 
 	for(i=0; i<vecstrAllQuery.size(); i++){
 		for(j=0; j<vecstrAllQuery[i].size(); j++){
 			if(mapstriGenes.find(vecstrAllQuery[i][j])==mapstriGenes.end()) continue;
-			ushort k = mapstriGenes.find(vecstrAllQuery[i][j])->second;
+			utype k = mapstriGenes.find(vecstrAllQuery[i][j])->second;
 			cAllQuery[k] = 1;
 		}
 	}
 
-	vector<ushort> allQ;
+	vector<utype> allQ;
 	for(i=0; i<cAllQuery.size(); i++) if(cAllQuery[i]==1) allQ.push_back(i);
 	allQ.resize(allQ.size());
 
 				cerr << "Gene does not exist" << endl;
 				continue;
 			}
-			ushort db;
+			utype db;
 			CSeekIntIntMap *qu = NULL;
 			unsigned char **r = NULL;
-			vector<ushort> vecDatasetID;
+			vector<utype> vecDatasetID;
 			for(j=0; j<dbDatasets[d].size(); j++){
-				ushort qq = mapstriDatasets.find(dbDatasets[d][j])->second;
+				utype qq = mapstriDatasets.find(dbDatasets[d][j])->second;
 				vecDatasetID.push_back(qq);
 			}
 			#pragma omp parallel for \
 	ifstream ifsm;
 	ifsm.open(file);
 	char acBuffer[lineSize];
-	ushort c_iBuffer = lineSize;
+	utype c_iBuffer = lineSize;
 	vector<string> vecstrLine;
 
 	ifsm.getline(acBuffer, c_iBuffer -1);
 	//fprintf(stderr, "%s\n", acBuffer);
 	CMeta::Tokenize( acBuffer, vecstrLine, " ", false);
 	quant.clear();
-	ushort i;
+	utype i;
 	for(i=0; i<vecstrLine.size(); i++){
 		quant.push_back(atof(vecstrLine[i].c_str()));
 		//fprintf(stderr, "%.5f\n", atof(vecstrLine[i].c_str()));
 	vector<CSeekPlatform> &vp, const vector<CSeekPlatform> &vp_src, 
 	const vector<string> &vecstrDatasets,
 	const map<string, string> &mapstrstrDatasetPlatform, 
-	const map<string, ushort> &mapstriPlatform){
+	const map<string, utype> &mapstriPlatform){
 
 	size_t i, j, k;
 
 		string strFileStem = vecstrDatasets[i];
 		string strPlatform =
 			mapstrstrDatasetPlatform.find(strFileStem)->second;
-		ushort platform_id = mapstriPlatform.find(strPlatform)->second;
+		utype platform_id = mapstriPlatform.find(strPlatform)->second;
 		vc[i]->SetPlatform(vp[platform_id]);
 	}
 
 	const vector<CSeekDBSetting*> &DBSetting,
 	const vector<string> &vecstrDatasets,
 	const map<string, string> &mapstrstrDatasetPlatform,
-	const map<string, ushort> &mapstriPlatform, vector<CSeekPlatform> &vp,
+	const map<string, utype> &mapstriPlatform, vector<CSeekPlatform> &vp,
 	vector<CSeekDataset*> &vc, const vector<vector<string> > &dbDataset,
-	const map<string,ushort> &mapstriDataset,
+	const map<string,utype> &mapstriDataset,
 	const bool bVariance, const bool bCorrelation){
 
 	size_t i, j, k;
 		string strSinfoInputDirectory = DBSetting[i]->GetValue("sinfo");
 
 		for(j=0; j<dset.size(); j++){
-			ushort d = mapstriDataset.find(dset[j])->second;
+			utype d = mapstriDataset.find(dset[j])->second;
 			vc[d] = new CSeekDataset();
 			string strFileStem = dset[j];
 			string strAvgPath = strPrepInputDirectory + "/" +
 			}
 			string strPlatform =
 				mapstrstrDatasetPlatform.find(strFileStem)->second;
-			ushort platform_id = mapstriPlatform.find(strPlatform)->second;
+			utype platform_id = mapstriPlatform.find(strPlatform)->second;
 			vc[d]->SetPlatform(vp[platform_id]);
 		}
 	}
 
 bool CSeekTools::ReadPlatforms(const string &strPlatformDirectory,
 		vector<CSeekPlatform> &plat, vector<string> &vecstrPlatforms,
-		map<string, ushort> &mapstriPlatforms, const int lineSize){
+		map<string, utype> &mapstriPlatforms, const int lineSize){
 	return CSeekTools::ReadPlatforms(strPlatformDirectory.c_str(), plat,
 		vecstrPlatforms, mapstriPlatforms, lineSize);
 }
 
 bool CSeekTools::ReadPlatforms(const char *plat_dir,
 		vector<CSeekPlatform> &plat, vector<string> &vecstrPlatforms,
-		map<string, ushort> &mapstriPlatforms, const int lineSize){
+		map<string, utype> &mapstriPlatforms, const int lineSize){
 
 	string strPlatformDirectory = plat_dir;
 	string strAvgFile = strPlatformDirectory + "/" +
 	plat_stdev.Open(strStdevFile.c_str());
 	plat.clear();
 	plat.resize(plat_avg.GetRows());
-	ushort i, j;
+	utype i, j;
 
 	vecstrPlatforms.clear();
 	mapstriPlatforms.clear();
 	ifstream ifsm;
 	ifsm.open(strPlatformOrderFile.c_str());
 	char acBuffer[lineSize];
-	ushort c_iBuffer = lineSize;