[Genabel-commits] r1276 - pkg/OmicABEL/src/reshuffle
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jul 23 13:48:24 CEST 2013
Author: sharapovsodbo
Date: 2013-07-23 13:48:24 +0200 (Tue, 23 Jul 2013)
New Revision: 1276
Modified:
pkg/OmicABEL/src/reshuffle/DONE.txt
pkg/OmicABEL/src/reshuffle/Parameters.h
pkg/OmicABEL/src/reshuffle/iout_file.h
pkg/OmicABEL/src/reshuffle/main.cpp
pkg/OmicABEL/src/reshuffle/reshuffle.h
pkg/OmicABEL/src/reshuffle/test.cpp
pkg/OmicABEL/src/reshuffle/test.h
Log:
--typedef long long int64_t
Modified: pkg/OmicABEL/src/reshuffle/DONE.txt
===================================================================
--- pkg/OmicABEL/src/reshuffle/DONE.txt 2013-07-22 22:42:34 UTC (rev 1275)
+++ pkg/OmicABEL/src/reshuffle/DONE.txt 2013-07-23 11:48:24 UTC (rev 1276)
@@ -2,6 +2,7 @@
improved parsing of command line:
search for parameter's name only after separator
delete parameter's name and value from command line in case of finding it
+
ver 0.002
tests for all points in specification
one bug with traitsbynames test unfixed
@@ -31,6 +32,7 @@
output corrected
in data/chi_data/slim_data column names are
SNP TRAIT ... ... ... (Chi)
+
ver 0.006
default output
if there are no input parameters(only file's path) output is whole data
Modified: pkg/OmicABEL/src/reshuffle/Parameters.h
===================================================================
--- pkg/OmicABEL/src/reshuffle/Parameters.h 2013-07-22 22:42:34 UTC (rev 1275)
+++ pkg/OmicABEL/src/reshuffle/Parameters.h 2013-07-23 11:48:24 UTC (rev 1276)
@@ -8,6 +8,8 @@
#ifndef PARAMETERS_H_
#define PARAMETERS_H_
+typedef long long int64_t;
+
#include <iostream>
#include <string>
#include <set>
Modified: pkg/OmicABEL/src/reshuffle/iout_file.h
===================================================================
--- pkg/OmicABEL/src/reshuffle/iout_file.h 2013-07-22 22:42:34 UTC (rev 1275)
+++ pkg/OmicABEL/src/reshuffle/iout_file.h 2013-07-23 11:48:24 UTC (rev 1276)
@@ -8,6 +8,8 @@
#ifndef IOUT_FILE_H_
#define IOUT_FILE_H_
+typedef long long int64_t;
+
#include <fstream>
#include <iostream>
#include <vector>
Modified: pkg/OmicABEL/src/reshuffle/main.cpp
===================================================================
--- pkg/OmicABEL/src/reshuffle/main.cpp 2013-07-22 22:42:34 UTC (rev 1275)
+++ pkg/OmicABEL/src/reshuffle/main.cpp 2013-07-23 11:48:24 UTC (rev 1276)
@@ -17,7 +17,7 @@
int main(int argc, char* argv[]) {
//cout<<"Start reshuffeling"<<endl;
Parameters Params(argc, argv);
- if(Params.h.use||Params.help.use||(Params.iout_fname==".iout"&&Params.out_fname==".out")){
+ if((Params.h.use||Params.help.use||(Params.iout_fname==".iout"&&Params.out_fname==".out"))&&(!Params.test.use)){
cout<<"Available commands"<<endl<<endl;
cout<<" --datadims | to get data's dimension"<<endl<<endl;
cout<<" --snpnames=<indexes> | to get names of SNP by indexes"<<endl<<endl;
@@ -34,79 +34,87 @@
}
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();
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
- remove(t_snpsnumbers.result.c_str());
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
+ 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();
+ t_dataslim.run(test_txt);
remove(t_dataslim.result.c_str());
}
if(Params.info.use)
Modified: pkg/OmicABEL/src/reshuffle/reshuffle.h
===================================================================
--- pkg/OmicABEL/src/reshuffle/reshuffle.h 2013-07-22 22:42:34 UTC (rev 1275)
+++ pkg/OmicABEL/src/reshuffle/reshuffle.h 2013-07-23 11:48:24 UTC (rev 1276)
@@ -7,11 +7,14 @@
#ifndef RESHUFFLE_H_
#define RESHUFFLE_H_
+
+typedef long long int64_t;
+
#include "Parameters.h"
#include "iout_file.h"
using namespace std;
-
+typedef long long int64_t;
class Reshuffle{
public:
iout_file * p_iout_file;
Modified: pkg/OmicABEL/src/reshuffle/test.cpp
===================================================================
--- pkg/OmicABEL/src/reshuffle/test.cpp 2013-07-22 22:42:34 UTC (rev 1275)
+++ pkg/OmicABEL/src/reshuffle/test.cpp 2013-07-23 11:48:24 UTC (rev 1276)
@@ -10,7 +10,7 @@
using namespace std;
-ofstream test_txt("test.txt");
+
test::test(string Name,string cmd,string Result,string Check){
Params_test= new Parameters;
name=Name;
@@ -47,7 +47,8 @@
}
}
-void test::run(){
+void test::run(ofstream& test_txt){
+ test_txt.open ("test.txt", fstream::app);
test_txt<<"START TEST "<<name<<"\t";
iout_file iout_F(*Params_test);
if(Params_test->traits.use)
@@ -74,7 +75,7 @@
test_txt<<"Test "<<name<<" FAILED!!!"<<endl;
}else
test_txt<<"Test "<<name<<" OK"<<endl;
-
+ test_txt.close();
//TODO: remove doesn't work from test.cpp
/*if(remove(result.c_strf()) != 0 )
cout<<"Error deleting file";*/
Modified: pkg/OmicABEL/src/reshuffle/test.h
===================================================================
--- pkg/OmicABEL/src/reshuffle/test.h 2013-07-22 22:42:34 UTC (rev 1275)
+++ pkg/OmicABEL/src/reshuffle/test.h 2013-07-23 11:48:24 UTC (rev 1276)
@@ -7,6 +7,10 @@
#ifndef TEST_H_
#define TEST_H_
+
+typedef long long int64_t;
+
+
#include "Parameters.h"
#include "iout_file.h"
#include "reshuffle.h"
@@ -20,7 +24,7 @@
string check;
Parameters *Params_test;//&Paramss;
test(string,string,string,string);
- void run();
+ void run(ofstream&);
};
#endif
/* TEST_H_ */
More information about the Genabel-commits
mailing list