[Genabel-commits] r1282 - pkg/OmicABEL/src/reshuffle

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 5 07:51:47 CEST 2013


Author: sharapovsodbo
Date: 2013-08-05 07:51:47 +0200 (Mon, 05 Aug 2013)
New Revision: 1282

Modified:
   pkg/OmicABEL/src/reshuffle/iout_file.cpp
   pkg/OmicABEL/src/reshuffle/iout_file.h
   pkg/OmicABEL/src/reshuffle/main.cpp
   pkg/OmicABEL/src/reshuffle/makereshuffle
   pkg/OmicABEL/src/reshuffle/reshuffle.cpp
   pkg/OmicABEL/src/reshuffle/reshuffle.h
Log:
--ver 0.011
little changes
TODO: heritabilities

Modified: pkg/OmicABEL/src/reshuffle/iout_file.cpp
===================================================================
--- pkg/OmicABEL/src/reshuffle/iout_file.cpp	2013-07-31 14:04:44 UTC (rev 1281)
+++ pkg/OmicABEL/src/reshuffle/iout_file.cpp	2013-08-05 05:51:47 UTC (rev 1282)
@@ -80,8 +80,8 @@
 	return os;
 }
 
-int64_t iout_file::tilecoordinates(int traitNo, int snpNo) {
-	int64_t tileCoor = 0;
+long long iout_file::tilecoordinates(int traitNo, int snpNo) {
+	long long tileCoor = 0;
 	int t_tile = traitNo / header.tile_t;
 	int t_off = traitNo % header.tile_t;
 	int m_tile = snpNo / header.tile_m;
@@ -91,13 +91,13 @@
 
 	//cout <<t_tile<<endl<<t_off<<endl<<m_tile<<endl<<m_off<<endl<<endl;
 	//cout<<(tileCoor)<<endl;
-	tileCoor = (int64_t)t_tile * header.m * header.tile_t;
+	tileCoor = (long long)t_tile * header.m * header.tile_t;
 	//cout<<(tileCoor)<<endl;
-	tileCoor += (int64_t)m_tile * header.tile_m * min(header.tile_t,header.t - header.tile_t * t_tile);
+	tileCoor += (long long)m_tile * header.tile_m * min(header.tile_t,header.t - header.tile_t * t_tile);
 	//cout<<(tileCoor)<<endl;
-	tileCoor += (int64_t)t_off * min(header.tile_m, header.m - header.tile_m * m_tile)+ m_off;
+	tileCoor += (long long)t_off * min(header.tile_m, header.m - header.tile_m * m_tile)+ m_off;
 	//cout<<(tileCoor)<<endl;
-	tileCoor *= (int64_t)per_trait_per_snp * sizeof(double);
+	tileCoor *= (long long)per_trait_per_snp * sizeof(double);
 	//cout<<(tileCoor)<<endl;
 	return tileCoor;
 }

Modified: pkg/OmicABEL/src/reshuffle/iout_file.h
===================================================================
--- pkg/OmicABEL/src/reshuffle/iout_file.h	2013-07-31 14:04:44 UTC (rev 1281)
+++ pkg/OmicABEL/src/reshuffle/iout_file.h	2013-08-05 05:51:47 UTC (rev 1282)
@@ -52,6 +52,6 @@
 	iout_header header;
 	labels_data labels;
 	iout_file(Parameters &);
-	int64_t tilecoordinates(int, int);
+	long long tilecoordinates(int, int);
 };
 #endif /* IOUT_FILE_H_ */

Modified: pkg/OmicABEL/src/reshuffle/main.cpp
===================================================================
--- pkg/OmicABEL/src/reshuffle/main.cpp	2013-07-31 14:04:44 UTC (rev 1281)
+++ pkg/OmicABEL/src/reshuffle/main.cpp	2013-08-05 05:51:47 UTC (rev 1282)
@@ -10,7 +10,6 @@
 #include "Parameters.h"
 #include "reshuffle.h"
 #include <iterator>
-#include "test.h"
 
 using namespace std;
 
@@ -33,90 +32,6 @@
 		exit(1);
 	}
 
-	if(Params.test.use){
-		ofstream test_txt;
-		test_txt.open("test.txt");
-		test_txt<<"";
-		test_txt.close();
-
-		test t_datadims("datadims","--datadims--","datadims.txt","data_4test_check/datadims.txt");
-		t_datadims.run(test_txt);
-		remove(t_datadims.result.c_str());
-
-		test t_snpnamesdef("snpnamesdef","--snpnames--","snpnames.txt","data_4test_check/snpnamesdef.txt");
-		t_snpnamesdef.run(test_txt);
-		remove(t_snpnamesdef.result.c_str());
-
-		test t_traitnamesdef("traitnamesdef","--traitnames--","traitnames.txt","data_4test_check/traitnamesdef.txt");
-		t_traitnamesdef.run(test_txt);
-		remove(t_traitnamesdef.result.c_str());
-
-		test t_snpnames("snpnames","--snpnames=10-27,1,20-35,55--","snpnames.txt","data_4test_check/snpnames.txt");
-		t_snpnames.run(test_txt);
-		remove(t_snpnames.result.c_str());
-
-		test t_traitnames("traitnames","--traitnames=1-3,5--","traitnames.txt","data_4test_check/traitnames.txt");
-		t_traitnames.run(test_txt);
-		remove(t_traitnames.result.c_str());
-
-		test t_snpsdef("snpsdef","--snps--","data.txt","data_4test_check/data_def.txt");
-		t_snpsdef.run(test_txt);
-		remove(t_snpsdef.result.c_str());
-
-		test t_traitsdef("traitsdef","--traits--","data.txt","data_4test_check/data_def.txt");
-		t_traitsdef.run(test_txt);
-		remove(t_traitsdef.result.c_str());
-
-		test t_traitsnumbers("traitsnumbers","--traits=1-3,5--","data.txt","data_4test_check/data_traitnumbers.txt");
-		t_traitsnumbers.run(test_txt);
-		remove(t_traitsnumbers.result.c_str());
-
-		test t_traitsbynames("traitsbynames","--traits=1-2,tca--","data.txt","data_4test_check/data_traitsbynames.txt");
-		t_traitsbynames.run(test_txt);
-		remove(t_traitsbynames.result.c_str());
-
-
-		test t_snpsnumbers("snpsnumbers","--snps=1-20,66,15-30,13--","data.txt","data_4test_check/data_snpsnumbers.txt");
-		t_snpsnumbers.run(test_txt);
-		if(remove(t_snpsnumbers.result.c_str())!=0)
-			cout<<endl<<endl<<endl<<"ERROR DELETING FILE"<<endl<<endl<<endl;
-
-		test t_snpsbynames("snpsbynames","--snps=3-8,rs3121561,10,rs6687776--","data.txt","data_4test_check/data_snpsbynames.txt");
-		t_snpsbynames.run(test_txt);
-		remove(t_snpsbynames.result.c_str());
-
-		test t_traitssnpscombo("traitssnpscombo","--snps=1-20,66,15-30,13--traits=1-3,5--","data.txt","data_4test_check/data_ts_combo.txt");
-		t_traitssnpscombo.run(test_txt);
-		remove(t_traitssnpscombo.result.c_str());
-
-		test t_chiall("chiall","--chi--","chi_data.txt","data_4test_check/data_chiall.txt");
-		t_chiall.run(test_txt);
-		remove(t_chiall.result.c_str());
-
-		test t_chiover("chiover","--chi=2--","chi_data.txt","data_4test_check/data_chiover.txt");
-		t_chiover.run(test_txt);
-		remove(t_chiover.result.c_str());
-
-		test t_traitssnpschicombo("traitssnpschicombo","--chi=2--traits--1-3,5--snps=1-20,66,15-30,13--","chi_data.txt","data_4test_check/data_chi_trsnp.txt");
-		t_traitssnpschicombo.run(test_txt);
-		remove(t_traitssnpschicombo.result.c_str());
-
-		test t_estdef("estdef","--heritabilities--","estimates.txt","data_4test_check/estdef.txt");
-		t_estdef.run(test_txt);
-		remove(t_estdef.result.c_str());
-
-		test t_estnum("estnumbers","--heritabilities=1-3,5--","estimates.txt","data_4test_check/estnum.txt");
-		t_estnum.run(test_txt);
-		remove(t_estnum.result.c_str());
-
-		test t_estnames("estnames","--heritabilities=1-2,tca,hdla--","estimates.txt","data_4test_check/estnames.txt");
-		t_estnames.run(test_txt);
-		remove(t_estnames.result.c_str());
-
-		test t_dataslim("dataslim","--chi=5--dataslim--","slim_data.txt","data_4test_check/data_slim.txt");
-		t_dataslim.run(test_txt);
-		remove(t_dataslim.result.c_str());
-	}
 	if(Params.info.use)
 		cout << Params;
 	iout_file iout_F(Params);

Modified: pkg/OmicABEL/src/reshuffle/makereshuffle
===================================================================
--- pkg/OmicABEL/src/reshuffle/makereshuffle	2013-07-31 14:04:44 UTC (rev 1281)
+++ pkg/OmicABEL/src/reshuffle/makereshuffle	2013-08-05 05:51:47 UTC (rev 1282)
@@ -1 +1 @@
-g++ main.cpp iout_file.cpp Parameters.cpp reshuffle.cpp test.cpp -Wall -o reshuffle
+g++ -O3 main.cpp iout_file.cpp Parameters.cpp reshuffle.cpp -Wall -o reshuffle

Modified: pkg/OmicABEL/src/reshuffle/reshuffle.cpp
===================================================================
--- pkg/OmicABEL/src/reshuffle/reshuffle.cpp	2013-07-31 14:04:44 UTC (rev 1281)
+++ pkg/OmicABEL/src/reshuffle/reshuffle.cpp	2013-08-05 05:51:47 UTC (rev 1282)
@@ -6,7 +6,6 @@
  */
 
 #include "reshuffle.h"
-//#include <dir.h>
 #include <ctime>
 #include <math.h>
 #include <iterator>
@@ -85,8 +84,8 @@
 	char s[30];
 	ostringstream ostr;
 	for (set<int>::iterator trait= (*p_Parameters).traits.numbersset.begin();trait!=(*p_Parameters).traits.numbersset.end();trait++) {
-		int64_t oldPos = 0;
-		int64_t pos;
+		long long oldPos = 0;
+		long long pos;
 		//TODO: 2 previous lines to ONE
 		for (set<int>::iterator snp= (*p_Parameters).snps.numbersset.begin();snp!=(*p_Parameters).snps.numbersset.end();snp++) {
 			ostr << (*(*p_iout_file).labels.snp_names)[*snp] << "\t";
@@ -136,8 +135,8 @@
 	ostringstream ostr;
 	for (set<int>::iterator trait= (*p_Parameters).traits.numbersset.begin();trait!=(*p_Parameters).traits.numbersset.end();trait++) {
 		//ofstream txt_chi(create_filename("chi_data//chi", (*(*p_iout_file).labels.trait_names)[*trait]).c_str());
-		int64_t oldPos = 0;
-		int64_t pos = 0;
+		long long oldPos = 0;
+		long long pos = 0;
 		//TODO: 2 previous lines to ONE
 		for (set<int>::iterator snp= (*p_Parameters).snps.numbersset.begin();snp!=(*p_Parameters).snps.numbersset.end();snp++) {
 			pos = (*p_iout_file).tilecoordinates(*trait, *snp);
@@ -183,8 +182,8 @@
 	double CheckChi = atof((*p_Parameters).chi.value.c_str());
 	double* buf = new double[per_trait_per_snp];
 	for (set<int>::iterator trait= (*p_Parameters).traits.numbersset.begin();trait!=(*p_Parameters).traits.numbersset.end();trait++) {
-		int64_t oldPos = 0;
-		int64_t pos = 0;
+		long long oldPos = 0;
+		long long pos = 0;
 		//TODO: 2 previous lines to ONE
 		//char s[30];
 		for (set<int>::iterator snp= (*p_Parameters).snps.numbersset.begin();snp!=(*p_Parameters).snps.numbersset.end();snp++) {
@@ -216,8 +215,8 @@
 	txt_slim << "Chi2" << endl;
 	ostringstream ostr;
 	for (set<int>::iterator trait= goodtraits.begin();trait!=goodtraits.end();trait++) {
-		int64_t oldPos = 0;
-		int64_t pos = 0;
+		long long oldPos = 0;
+		long long pos = 0;
 		//TODO: 2 previous lines to ONE
 		char s[30];
 		for (set<int>::iterator snp= goodsnps.begin();snp!=goodsnps.end();snp++) {

Modified: pkg/OmicABEL/src/reshuffle/reshuffle.h
===================================================================
--- pkg/OmicABEL/src/reshuffle/reshuffle.h	2013-07-31 14:04:44 UTC (rev 1281)
+++ pkg/OmicABEL/src/reshuffle/reshuffle.h	2013-08-05 05:51:47 UTC (rev 1282)
@@ -29,7 +29,7 @@
 	void write_data_chi(ifstream&,ofstream&);
 	void write_slim_data(ifstream&,ofstream&);
 	void write_herest(ifstream&,ofstream&);
-	int64_t herest_startpos;
+	long long herest_startpos;
 	int est_shift(int);
 	int est_beta_shift(int);
 	void run(Parameters);



More information about the Genabel-commits mailing list