@@ -127,8 +127,8 @@ void showUsage(int argc, char *argv[])
127
127
cout << " Usage: " << argv[0 ] << " qc [options]" << endl << endl;
128
128
cout << " Compute genotyping QC metrics and write to text files" << endl<< endl;
129
129
cout << " Options: --infile The name of the SIM file (cannot accept STDIN)" << endl;
130
- cout << " --magnitude Output file for sample magnitude (normalised by SNP), defaults to STDOUT" << endl;
131
- cout << " --xydiff Output file for XY intensity difference, defaults to STDOUT" << endl;
130
+ cout << " --magnitude Output file for sample magnitude (normalised by SNP); cannot use STDOUT" << endl;
131
+ cout << " --xydiff Output file for XY intensity difference; cannot use STDOUT" << endl;
132
132
cout << " --verbose Show progress messages to STDERR" << endl;
133
133
exit (0 );
134
134
}
@@ -456,21 +456,32 @@ void commandQC(string infile, string magnitude, string xydiff, bool verbose)
456
456
cerr << " Error: QC metrics require a .sim file, cannot accept "
457
457
" standard input." << endl;
458
458
exit (1 );
459
+ } else if (magnitude == " " && xydiff == " " ) {
460
+ cerr << " Error: Must specify at least one of "
461
+ " --magnitude, --xydiff for QC" << endl;
462
+ exit (1 );
459
463
}
460
464
QC myqc = QC (infile);
461
- myqc.writeMagnitude (magnitude);
462
- cout << " Magnitude written successfully to " << magnitude << endl;
463
- // TODO omit xydiff if output filename is empty
464
- myqc.writeXydiff (xydiff);
465
+ if (magnitude!=" " ) {
466
+ if (verbose) cerr << " Writing magnitude of intensity" << endl;
467
+ myqc.writeMagnitude (magnitude);
468
+ if (verbose) cerr << " Magnitude written to " << magnitude << endl;
469
+ }
470
+ if (xydiff!=" " ) {
471
+ if (verbose) cerr << " Writing XY intensity difference" << endl;
472
+ myqc.writeXydiff (xydiff);
473
+ if (verbose) cerr << " Xydiff written to " << xydiff << endl;
474
+ }
475
+
465
476
}
466
477
467
478
int main (int argc, char *argv[])
468
479
{
469
480
string infile = " -" ;
470
481
string outfile = " -" ;
471
482
string manfile = " " ;
472
- string magnitude = " - " ;
473
- string xydiff = " - " ;
483
+ string magnitude = " " ;
484
+ string xydiff = " " ;
474
485
bool verbose = false ;
475
486
bool normalize = false ;
476
487
int start_pos = 0 ;
0 commit comments