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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 7 15:11:11 CEST 2013


Author: sharapovsodbo
Date: 2013-10-07 15:11:10 +0200 (Mon, 07 Oct 2013)
New Revision: 1338

Modified:
   pkg/OmicABEL/src/reshuffle/Parameters.cpp
   pkg/OmicABEL/src/reshuffle/reshuffle.cpp
Log:
--ver 0.03 stable version
-correct exceptions
-default outfile names for each option
TODO:
-change/improve documentation
-improve throughput adding input caching

Modified: pkg/OmicABEL/src/reshuffle/Parameters.cpp
===================================================================
--- pkg/OmicABEL/src/reshuffle/Parameters.cpp	2013-10-03 10:45:27 UTC (rev 1337)
+++ pkg/OmicABEL/src/reshuffle/Parameters.cpp	2013-10-07 13:11:10 UTC (rev 1338)
@@ -201,7 +201,7 @@
 		defaultstate=write_datadims+snpnames.use+traitnames.use+traits.use
 					+snps.use+herit.use+chi.use+write_slim_data;
 		param_coutner = write_datadims+snpnames.use+traitnames.use +
-				(traits.use||snps.use||chi.use) +
+				(traits.use||snps.use||(chi.use&&!write_slim_data)) +
 				(write_slim_data&&chi.use);
 }
 

Modified: pkg/OmicABEL/src/reshuffle/reshuffle.cpp
===================================================================
--- pkg/OmicABEL/src/reshuffle/reshuffle.cpp	2013-10-03 10:45:27 UTC (rev 1337)
+++ pkg/OmicABEL/src/reshuffle/reshuffle.cpp	2013-10-07 13:11:10 UTC (rev 1338)
@@ -25,7 +25,7 @@
 	txt_datadims << "Number of traits\t" << (*p_iout_file).header.t << endl;
 	txt_datadims << "Number of SNP\t" << (*p_iout_file).header.m << endl;
 	txt_datadims << "Number of covariates\t" << ((*p_iout_file).header.p - 2);
-	cout<<"End write data dimension\t"<< double(clock()) / CLOCKS_PER_SEC <<" sec" << endl;
+	cout<<"\nEnd write data dimension\t"<< double(clock()) / CLOCKS_PER_SEC <<" sec";
 }
 
 void Reshuffle::write_snpnames(ofstream& txt_snpnames){
@@ -149,7 +149,7 @@
 	set<int> goodsnps;
 	double chi = 0;
 	if((*p_Parameters).chi.def_value||(!(*p_Parameters).chi.use)){
-		cout << "\nERROR: " << "Chi value doesn't set";
+		cout << "\nERROR: " << "Chi value doesn't exist";
 		cout << "\nPlease, set Chi value to get slim data";
 		exit(1);
 	}
@@ -280,15 +280,21 @@
 
 void Reshuffle::run(){
 	if((*p_Parameters).write_datadims){
+		if(((*p_Parameters).outfile).size()==0)
+			(*p_Parameters).outfile="datadims.txt";
 		ofstream datadims((*p_Parameters).outfile.c_str());
 		write_datadims(datadims);
 	}
 	if((*p_Parameters).snpnames.use){
+		if(((*p_Parameters).outfile).size()==0)
+			(*p_Parameters).outfile="snpnames.txt";
 		ofstream snpnames((*p_Parameters).outfile.c_str());
 		write_snpnames(snpnames);
 	}
 
 	if((*p_Parameters).traitnames.use){
+		if(((*p_Parameters).outfile).size()==0)
+			(*p_Parameters).outfile="traitnames.txt";
 		ofstream traitnames((*p_Parameters).outfile.c_str());
 		write_traitnames(traitnames);
 	}
@@ -319,23 +325,31 @@
 	}
 
 	if((((*p_Parameters).traits.use||(*p_Parameters).snps.use)&&!(*p_Parameters).chi.use)||!(*p_Parameters).defaultstate){
+		if(((*p_Parameters).outfile).size()==0)
+			(*p_Parameters).outfile="data.txt";
 		ofstream data((*p_Parameters).outfile.c_str());
 		write_data(out_file,data);
 	}
 
 	if((*p_Parameters).chi.use&&!(*p_Parameters).write_slim_data){
+		if(((*p_Parameters).outfile).size()==0)
+			(*p_Parameters).outfile="data_chi.txt";
 		ofstream chi_data((*p_Parameters).outfile.c_str());
 		write_data_chi(out_file,chi_data);
 
 	}
 
 	if((*p_Parameters).write_slim_data){
+		if(((*p_Parameters).outfile).size()==0)
+			(*p_Parameters).outfile="data_slim.txt";
 		ofstream dataslim((*p_Parameters).outfile.c_str());
 		write_slim_data(out_file,dataslim);
 
 	}
 
 	if((*p_Parameters).herit.use){
+		if(((*p_Parameters).outfile).size()==0)
+			(*p_Parameters).outfile="heritab.txt";
 		ofstream herest((*p_Parameters).outfile.c_str());
 		write_herest(out_file,herest);
 	}



More information about the Genabel-commits mailing list