Skip to content

Commit

Permalink
refine QC output folders and file names
Browse files Browse the repository at this point in the history
  • Loading branch information
sfchen committed Mar 17, 2017
1 parent 6943b9d commit 7b00e2b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions preprocesser.py
Expand Up @@ -304,9 +304,7 @@ def run(self):
qc_base_folder = os.path.join(os.path.dirname(os.path.dirname(good_dir+"/")), "QC")
if not os.path.exists(qc_base_folder):
os.makedirs(qc_base_folder)
qc_dir = os.path.join(qc_base_folder, os.path.basename(self.options.read1_file))
if not os.path.exists(qc_dir):
os.makedirs(qc_dir)
qc_dir = qc_base_folder

if not os.path.exists(good_dir):
os.makedirs(good_dir)
Expand Down Expand Up @@ -711,15 +709,15 @@ def run(self):
reporter.addFigure('Overlap length distribution', self.r1qc_prefilter.overlapPlotly(overlap_histgram, readLen, TOTAL_READS, 'overlap_stat'), 'overlap_stat', "")
#self.r1qc_prefilter.plotOverlapHistgram(overlap_histgram, readLen, TOTAL_READS, os.path.join(qc_dir, "overlap.png"))

stat_file = open(os.path.join(qc_dir, "report.json"), "w")
stat_file = open(os.path.join(qc_dir, os.path.basename(self.options.read1_file) + ".json"), "w")
stat_json = json.dumps(stat, sort_keys=True,indent=4, separators=(',', ': '))
stat_file.write(stat_json)
stat_file.close()

self.addFiguresToReport(reporter)
reporter.setStat(stat)
reporter.setVersion(self.options.version)
reporter.output(os.path.join(qc_dir, "report.html"))
reporter.output(os.path.join(qc_dir, os.path.basename(self.options.read1_file) + ".html"))

def addFiguresToReport(self, reporter):
if self.options.read2_file != None:
Expand Down

0 comments on commit 7b00e2b

Please sign in to comment.