-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protection against using the wrong sample alias which produces zero L… #1242
Changes from 1 commit
232addf
3eeec7d
318cbf5
f92ff60
427a60f
b024781
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,7 +224,9 @@ protected int doWork() { | |
outputDetailMetricsFile = DETAIL_OUTPUT; | ||
outputSummaryMetricsFile = SUMMARY_OUTPUT; | ||
} else { | ||
if (!OUTPUT.endsWith(".")) OUTPUT = OUTPUT + "."; | ||
if (!OUTPUT.endsWith(".")) { | ||
OUTPUT = OUTPUT + "."; | ||
} | ||
outputDetailMetricsFile = new File(OUTPUT + FINGERPRINT_DETAIL_FILE_SUFFIX); | ||
outputSummaryMetricsFile = new File(OUTPUT + FINGERPRINT_SUMMARY_FILE_SUFFIX); | ||
} | ||
|
@@ -366,16 +368,15 @@ protected int doWork() { | |
|
||
summaryFile.addMetric(metrics); | ||
log.info("Read Group: " + metrics.READ_GROUP + " / " + observedSampleAlias + " vs. " + metrics.SAMPLE + ": LOD = " + metrics.LOD_EXPECTED_SAMPLE); | ||
if (metrics.LOD_EXPECTED_SAMPLE!=0) { | ||
anyNonzeroLod |= true; | ||
if (metrics.LOD_EXPECTED_SAMPLE != 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you could write
(also, I think the proper spelling is Conversely avoiding negatives would make this a bit nicer, IMO, e.g.
I find reading code with double negatives like |
||
anyNonzeroLod = true; | ||
} | ||
} | ||
|
||
summaryFile.write(outputSummaryMetricsFile); | ||
detailsFile.write(outputDetailMetricsFile); | ||
|
||
|
||
if (!anyNonzeroLod){ | ||
if (!anyNonzeroLod) { | ||
log.error("No non-zero results found. This is likely an error. " + | ||
"Probable cause: EXPECTED_SAMPLE (if provided) or the sample name from INPUT (if EXPECTED_SAMPLE isn't provided)" + | ||
"isn't a sample in GENOTYPES file."); | ||
|
@@ -401,10 +402,6 @@ protected String[] customCommandLineValidation() { | |
return super.customCommandLineValidation(); | ||
} | ||
|
||
static boolean isBamOrSam(final File f) { | ||
return isBamOrSam(f.toPath()); | ||
} | ||
|
||
static boolean isBamOrSam(final Path p) { | ||
return (p.toUri().getRawPath().endsWith(BamFileIoUtils.BAM_FILE_EXTENSION) || p.toUri().getRawPath().endsWith(IOUtil.SAM_FILE_EXTENSION)); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.