Skip to content

Commit 5b5556a

Browse files
author
Iain Bancarz
committed
Changed help messages; require QC output to files (must specify at least one of magnitude, xydiff)
1 parent d62dff9 commit 5b5556a

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

simtools.cpp

+19-8
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ void showUsage(int argc, char *argv[])
127127
cout << "Usage: " << argv[0] << " qc [options]" << endl << endl;
128128
cout << "Compute genotyping QC metrics and write to text files" << endl<< endl;
129129
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;
132132
cout << " --verbose Show progress messages to STDERR" << endl;
133133
exit(0);
134134
}
@@ -456,21 +456,32 @@ void commandQC(string infile, string magnitude, string xydiff, bool verbose)
456456
cerr << "Error: QC metrics require a .sim file, cannot accept "
457457
"standard input." << endl;
458458
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);
459463
}
460464
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+
465476
}
466477

467478
int main(int argc, char *argv[])
468479
{
469480
string infile = "-";
470481
string outfile = "-";
471482
string manfile = "";
472-
string magnitude = "-";
473-
string xydiff = "-";
483+
string magnitude = "";
484+
string xydiff = "";
474485
bool verbose = false;
475486
bool normalize = false;
476487
int start_pos = 0;

0 commit comments

Comments
 (0)