Skip to content

Commit

Permalink
Adding code to skip unrecognized json.gz files
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAustinNix committed Feb 18, 2020
1 parent c0b2e29 commit 592e5cd
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Source/edu/utah/seq/qc/AggregateQCStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,16 @@ private void loadSamples() {
else {
//fetch name and type
String[] nameType = parseSampleName(j.getName());
//fetch SampleQC
SampleQC sqc = samples.get(nameType[0]);
if (sqc == null){
sqc = new SampleQC(nameType[0], calcReadCoverage, swapExomeForDNA);
samples.put(nameType[0], sqc);
if (nameType == null) IO.pl("\nWarning, no match, skipping json file -> "+j);
else {
//fetch SampleQC
SampleQC sqc = samples.get(nameType[0]);
if (sqc == null){
sqc = new SampleQC(nameType[0], calcReadCoverage, swapExomeForDNA);
samples.put(nameType[0], sqc);
}
sqc.loadJson(j, nameType[1]);
}
sqc.loadJson(j, nameType[1]);
}
}
}
Expand Down Expand Up @@ -441,8 +444,6 @@ private String[] parseSampleName(String name) {
mat = s2uPattern.matcher(name);
if (mat.matches()) return new String[]{mat.group(1), "s2u"};

Misc.printErrAndExit("\nERROR: failed to parse the sample name from "+name +"\nLooking for "+
saePattern.pattern()+" or "+mpaPattern.pattern()+" or "+s2uPattern.pattern());
return null;
}

Expand Down Expand Up @@ -501,7 +502,7 @@ public void processArgs(String[] args){
public static void printDocs(){
System.out.println("\n" +
"**************************************************************************************\n" +
"** Aggregate QC Stats: May 2019 **\n" +
"** Aggregate QC Stats: Feb 2020 **\n" +
"**************************************************************************************\n" +
"Parses and aggregates alignment quality statistics from json files produced by the\n"+
"SamAlignmentExtractor, MergePairedAlignments, Sam2USeq, BamConcordance and Fastq rule.\n"+
Expand Down

0 comments on commit 592e5cd

Please sign in to comment.