[Genabel-commits] r1333 - pkg/filevector/fvfutil
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Sep 10 17:20:11 CEST 2013
Author: lckarssen
Date: 2013-09-10 17:20:11 +0200 (Tue, 10 Sep 2013)
New Revision: 1333
Modified:
pkg/filevector/fvfutil/text2fvf_main.cpp
pkg/filevector/fvfutil/usage.cpp
Log:
Filevector Utilities: prepare for upcoming change. This has no functional changes, only removal of superfluous spaces and changing tabs to spaces.
Modified: pkg/filevector/fvfutil/text2fvf_main.cpp
===================================================================
--- pkg/filevector/fvfutil/text2fvf_main.cpp 2013-09-06 14:31:39 UTC (rev 1332)
+++ pkg/filevector/fvfutil/text2fvf_main.cpp 2013-09-10 15:20:11 UTC (rev 1333)
@@ -8,22 +8,22 @@
int quiet = 0;
const char * const short_options = "i:o:c:r:1:2:3:4:t:R:T:d";
const struct option long_options [] =
- {
- {"infile", required_argument, NULL, 'i'},
- {"outfile", required_argument, NULL, 'o'},
- {"skipcols", required_argument, NULL, 'c'},
- {"skiprows", required_argument, NULL, 'r'},
- {"rncol", required_argument, NULL, '1'},
- {"cnrow", required_argument, NULL, '2'},
- {"rnfile", required_argument, NULL, '3'},
- {"cnfile", required_argument, NULL, '4'},
- {"transpose", no_argument, NULL, 't'},
- {"Rmatrix", no_argument, NULL, 'R'},
- {"outType", required_argument, NULL, 'T'},
- {"dataType", required_argument, NULL, 'd'},
- {"nanString", no_argument, NULL, 'n'},
- { NULL , no_argument, NULL, 0 }
- };
+ {
+ {"infile", required_argument, NULL, 'i'},
+ {"outfile", required_argument, NULL, 'o'},
+ {"skipcols", required_argument, NULL, 'c'},
+ {"skiprows", required_argument, NULL, 'r'},
+ {"rncol", required_argument, NULL, '1'},
+ {"cnrow", required_argument, NULL, '2'},
+ {"rnfile", required_argument, NULL, '3'},
+ {"cnfile", required_argument, NULL, '4'},
+ {"transpose", no_argument, NULL, 't'},
+ {"Rmatrix", no_argument, NULL, 'R'},
+ {"outType", required_argument, NULL, 'T'},
+ {"dataType", required_argument, NULL, 'd'},
+ {"nanString", no_argument, NULL, 'n'},
+ { NULL , no_argument, NULL, 0 }
+ };
char *program_name = argv[0];
char *infilename = NULL;
@@ -38,51 +38,51 @@
do
{
- next_option = getopt_long(argc,argv,short_options,long_options,NULL);
- switch (next_option)
- {
- case 'i':
- infilename = optarg;
- break;
- case 'o':
- outfilename = optarg;
- break;
- case 'c':
- skipcols = atoi(optarg);
- break;
- case 'r':
- skiprows = atoi(optarg);
- break;
- case '1':
- rownames = atoi(optarg);
- break;
- case '2':
- colnames = atoi(optarg);
- break;
- case '3':
- rownames = 1;
- rownamesfilename = optarg;
- break;
- case '4':
- colnames = 1;
- colnamesfilename = string(optarg);
- break;
- case 't':
- transpose=1;
- break;
- case 'R':
- Rmatrix=1;
- break;
- case 'd':
- dataType = dataTypeFromString(optarg);
- break;
- case 'n':
- nanString = string(optarg);
- break;
- case '?': print_text2fvf_usage(program_name);
- case ':': print_text2fvf_usage(program_name);
- case -1 : break;
- default: abort();
+ next_option = getopt_long(argc,argv,short_options,long_options,NULL);
+ switch (next_option)
+ {
+ case 'i':
+ infilename = optarg;
+ break;
+ case 'o':
+ outfilename = optarg;
+ break;
+ case 'c':
+ skipcols = atoi(optarg);
+ break;
+ case 'r':
+ skiprows = atoi(optarg);
+ break;
+ case '1':
+ rownames = atoi(optarg);
+ break;
+ case '2':
+ colnames = atoi(optarg);
+ break;
+ case '3':
+ rownames = 1;
+ rownamesfilename = optarg;
+ break;
+ case '4':
+ colnames = 1;
+ colnamesfilename = string(optarg);
+ break;
+ case 't':
+ transpose=1;
+ break;
+ case 'R':
+ Rmatrix=1;
+ break;
+ case 'd':
+ dataType = dataTypeFromString(optarg);
+ break;
+ case 'n':
+ nanString = string(optarg);
+ break;
+ case '?': print_text2fvf_usage(program_name);
+ case ':': print_text2fvf_usage(program_name);
+ case -1 : break;
+ default: abort();
}
}
while (next_option != -1);
@@ -95,16 +95,16 @@
// check that in- and out-filenames are supplied
if (infilename == NULL || outfilename == NULL)
{
- print_text2fvf_usage(program_name);
+ print_text2fvf_usage(program_name);
}
string Pname = program_name, Iname = infilename, Oname = outfilename, RFname = rownamesfilename, CFname = colnamesfilename;
text2fvf(Pname, Iname, Oname,
- RFname, CFname,
- rownames, colnames,
- skiprows, skipcols,
- transpose, Rmatrix, dataType, !!quiet, nanString);
+ RFname, CFname,
+ rownames, colnames,
+ skiprows, skipcols,
+ transpose, Rmatrix, dataType, !!quiet, nanString);
return(0);
}
Modified: pkg/filevector/fvfutil/usage.cpp
===================================================================
--- pkg/filevector/fvfutil/usage.cpp 2013-09-06 14:31:39 UTC (rev 1332)
+++ pkg/filevector/fvfutil/usage.cpp 2013-09-10 15:20:11 UTC (rev 1333)
@@ -2,67 +2,67 @@
using namespace std;
-void print_text2fvf_usage(char * progname)
+void print_text2fvf_usage(char * progname)
{
- cout << "USAGE: " << progname << " -i INFILE -o OUTFILE [-r N2] [--colnames[=CFILE]] [-t] [-datatype=TYPE]" << endl;
- cout << endl;
- cout << "\t--infile=INFILE : the name of the input file containing matrix in text format" << endl;
- cout << "\t--outfile=OUTFILE : name of the output file which will containing matrix in FVF format" << endl;
- cout << "\t--skipcols=N1 : skip N1 first columns when reading from the input text file" << endl;
- cout << "\t--rownames=N2 : row names are provided in the N2-th column of the text file" << endl;
- cout << "\t--colnames[=CFILE] : column names are provided either as the first line of the text" << endl;
- cout << "\t matrix text file (if no arguments supplied) or in a separate" << endl;
- cout << "\t text file CFILE" << endl;
- cout << "\t--transpose : should the matrix be transposed" << endl;
- cout << "\t--datatype=TYPE : specify destination data type, default is DOUBLE" << endl;
-
- cout << endl;
- cout << "The program will convert text matrix to FileVector (FVF) format."<< endl;
- cout << "By default, the columns of the text matrix are considered as 'variables'"<< endl;
- cout << "for which FVF will provide fast access. If you want it other way around,"<< endl;
- cout << "please specify '-t' option."<< endl;
- cout << ""<< endl;
- cout << "EXAMPLES: " << progname << " -i test.mldose -o test.mldose.fvf -s 2 -r 1"<< endl;
- cout << " Text matrix file contains two starting columns, first of which"<< endl;
- cout << " contains subjects IDs."<< endl;
- cout << " Command will convert text matrix provided in 'test.mldose' to "<< endl;
- cout << " FVF-formated file 'test.mldose.fvf'. Columns will be stored as"<< endl;
- cout << " the fast-access FVF 'variables'"<< endl;
- cout << ""<< endl;
- cout << " " << progname << " -i test.mldose -o test.mldose.fvf -s 2 -r 1 -t"<< endl;
- cout << " Same as above, but transposing the matrix. Rows will be stores as"<< endl;
- cout << " the fast-access FVF 'variables'"<< endl;
- cout << ""<< endl;
- cout << " " << progname << " -i test.mldose -o test.mldose.fvf -s 2 -r 1 --colnames=test.snplist"<< endl;
- cout << " Same as example 1, but we tell that column names are stored in file"<< endl;
- cout << " 'test.snplist' (mind the full format used: '--colnames=CFILE')"<< endl;
- cout << ""<< endl;
- exit(0);
+ cout << "USAGE: " << progname << " -i INFILE -o OUTFILE [-r N2] [--colnames[=CFILE]] [-t] [-datatype=TYPE]" << endl;
+ cout << endl;
+ cout << "\t--infile=INFILE : the name of the input file containing matrix in text format" << endl;
+ cout << "\t--outfile=OUTFILE : name of the output file which will containing matrix in FVF format" << endl;
+ cout << "\t--skipcols=N1 : skip N1 first columns when reading from the input text file" << endl;
+ cout << "\t--rownames=N2 : row names are provided in the N2-th column of the text file" << endl;
+ cout << "\t--colnames[=CFILE] : column names are provided either as the first line of the text" << endl;
+ cout << "\t matrix text file (if no arguments supplied) or in a separate" << endl;
+ cout << "\t text file CFILE" << endl;
+ cout << "\t--transpose : should the matrix be transposed" << endl;
+ cout << "\t--datatype=TYPE : specify destination data type, default is DOUBLE" << endl;
+
+ cout << endl;
+ cout << "The program will convert text matrix to FileVector (FVF) format."<< endl;
+ cout << "By default, the columns of the text matrix are considered as 'variables'"<< endl;
+ cout << "for which FVF will provide fast access. If you want it other way around,"<< endl;
+ cout << "please specify '-t' option."<< endl;
+ cout << ""<< endl;
+ cout << "EXAMPLES: " << progname << " -i test.mldose -o test.mldose.fvf -s 2 -r 1"<< endl;
+ cout << " Text matrix file contains two starting columns, first of which"<< endl;
+ cout << " contains subjects IDs."<< endl;
+ cout << " Command will convert text matrix provided in 'test.mldose' to "<< endl;
+ cout << " FVF-formated file 'test.mldose.fvf'. Columns will be stored as"<< endl;
+ cout << " the fast-access FVF 'variables'"<< endl;
+ cout << ""<< endl;
+ cout << " " << progname << " -i test.mldose -o test.mldose.fvf -s 2 -r 1 -t"<< endl;
+ cout << " Same as above, but transposing the matrix. Rows will be stores as"<< endl;
+ cout << " the fast-access FVF 'variables'"<< endl;
+ cout << ""<< endl;
+ cout << " " << progname << " -i test.mldose -o test.mldose.fvf -s 2 -r 1 --colnames=test.snplist"<< endl;
+ cout << " Same as example 1, but we tell that column names are stored in file"<< endl;
+ cout << " 'test.snplist' (mind the full format used: '--colnames=CFILE')"<< endl;
+ cout << ""<< endl;
+ exit(0);
}
-void print_text2fvf_welcome()
+void print_text2fvf_welcome()
{
- cout << "\ntext2fvf v. " << T2F_VERSION << " (" << T2F_RELEASEDATE << ")"<< endl;
- cout << "(C) " << T2F_AUTHORS << endl;
- cout << "based on FileVector v. " << FV_VERSION << " (" << FV_RELEASEDATE << ")"<< endl;
- cout << "(C) " << FV_AUTHORS << endl;
+ cout << "\ntext2fvf v. " << T2F_VERSION << " (" << T2F_RELEASEDATE << ")"<< endl;
+ cout << "(C) " << T2F_AUTHORS << endl;
+ cout << "based on FileVector v. " << FV_VERSION << " (" << FV_RELEASEDATE << ")"<< endl;
+ cout << "(C) " << FV_AUTHORS << endl;
}
void print_mergevars_usage(char * progname)
{
- cout << "USAGE: " << progname << " INFILE1 INFILE2 OUTFILE [cachesize]" << ""<< endl;
- cout << ""<< endl;
- cout << "\tINFILE1, INFILE2 : two files in FVF-format"<< endl;
- cout << "\tOUTFILE : name of file where merged data will be written to"<< endl;
- cout << "\tcachesize : size (Mb) of cache to be used (optional)"<< endl;
- cout << ""<< endl;
- exit(0);
+ cout << "USAGE: " << progname << " INFILE1 INFILE2 OUTFILE [cachesize]" << ""<< endl;
+ cout << ""<< endl;
+ cout << "\tINFILE1, INFILE2 : two files in FVF-format"<< endl;
+ cout << "\tOUTFILE : name of file where merged data will be written to"<< endl;
+ cout << "\tcachesize : size (Mb) of cache to be used (optional)"<< endl;
+ cout << ""<< endl;
+ exit(0);
}
-void print_mergevars_welcome()
+void print_mergevars_welcome()
{
- cout << "\nmergevars v. " << MERGEVARS_VERSION << " (" << MERGEVARS_RELEASEDATE << ")"<< endl;
- cout << "(C) " << MERGEVARS_AUTHORS << "\n"<< endl;
- cout << "based on FileVector v. " << FV_VERSION << " (" << FV_RELEASEDATE << ")"<< endl;
- cout << "(C) " << FV_AUTHORS << "\n"<< endl;
+ cout << "\nmergevars v. " << MERGEVARS_VERSION << " (" << MERGEVARS_RELEASEDATE << ")"<< endl;
+ cout << "(C) " << MERGEVARS_AUTHORS << "\n"<< endl;
+ cout << "based on FileVector v. " << FV_VERSION << " (" << FV_RELEASEDATE << ")"<< endl;
+ cout << "(C) " << FV_AUTHORS << "\n"<< endl;
}
More information about the Genabel-commits
mailing list