Skip to content

Commit

Permalink
Merge pull request #4 from Zymo-Research/modularity
Browse files Browse the repository at this point in the history
Modularity
  • Loading branch information
michael-weinstein authored Jan 19, 2020
2 parents 63f170a + f87fdc0 commit 3352145
Show file tree
Hide file tree
Showing 36 changed files with 21 additions and 3,047 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "miqScoreNGSReadCountPublic"]
path = miqScoreNGSReadCountPublic
url = [email protected]:Zymo-Research/miqScoreNGSReadCountPublic.git
[submodule "miqScoreShotgunPublicSupport"]
path = miqScoreShotgunPublicSupport
url = https://github.com/Zymo-Research/miqScoreShotgunPublicSupport.git
18 changes: 17 additions & 1 deletion analyzeStandardReads.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,30 @@ def saveResult(result:miqScoreNGSReadCountPublic.MiqScoreData):
return outputFilePath


def generateReportReplacementTable(sampleMiq, goodExampleMiq, badExampleMiq, readFatePrintNames:dict=None):
readFateTable = miqScoreShotgunPublicSupport.reporting.generateReadFateChartBody(miqScoreShotgunPublicSupport.reporting.generateAbsoluteReadFateCounts(sampleMiq), readFatePrintNames)
replacementTable = {"SAMPLENAME": sampleMiq.sampleID,
"MIQSCORE": str(round(sampleMiq.miqScore)),
"READFATETABLE": readFateTable,
"READFATECHART": sampleMiq.plots["readFates"],
"COMPOSITIONBARPLOT": sampleMiq.plots["compositionPlot"],
"GOODRADARPLOTLYSIS": goodExampleMiq.plots["radarPlots"]["Lysis Difficulty"],
"SAMPLERADARPLOTLYSIS": sampleMiq.plots["radarPlots"]["Lysis Difficulty"],
"BADRADARPLOTLYSIS": badExampleMiq.plots["radarPlots"]["Lysis Difficulty"],
"GOODRADARPLOTGC": goodExampleMiq.plots["radarPlots"]["GC Content"],
"SAMPLERADARPLOTGC": sampleMiq.plots["radarPlots"]["GC Content"],
"BADRADARPLOTGC": badExampleMiq.plots["radarPlots"]["GC Content"]}
return replacementTable


def generateReport(result:miqScoreNGSReadCountPublic.MiqScoreData):
referenceData = miqScoreNGSReadCountPublic.referenceHandler.StandardReference(parameters.referenceDataFile.value)
templateFilePath = os.path.join(os.path.split(os.path.abspath(__file__))[0], "reference", "shotgunReportTemplate.html")
templateFile = open(templateFilePath, 'r')
template = templateFile.read()
templateFile.close()
goodMiq, badMiq = miqScoreNGSReadCountPublic.loadExampleData(parameters.goodMiqExample.value, parameters.badMiqExample.value, referenceData, "Genomic")
replacementTable = miqScoreShotgunPublicSupport.reporting.generateReplacementTable(result, goodMiq, badMiq, readFatePrintNames=readFatePrintNames)
replacementTable = generateReportReplacementTable(result, goodMiq, badMiq, readFatePrintNames=readFatePrintNames)
report = miqScoreNGSReadCountPublic.reportGeneration.generateReport(template, replacementTable)
reportFilePath = os.path.join(parameters.outputFolder.value, "%s.html" % parameters.sampleName.value)
print("Output report to %s" % reportFilePath)
Expand Down
1 change: 1 addition & 0 deletions miqScoreShotgunPublicSupport
11 changes: 0 additions & 11 deletions miqScoreShotgunPublicSupport/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions miqScoreShotgunPublicSupport/alignmentAnalysis/__init__.py

This file was deleted.

301 changes: 0 additions & 301 deletions miqScoreShotgunPublicSupport/alignmentAnalysis/alignmentAnalysisPE.py

This file was deleted.

Loading

0 comments on commit 3352145

Please sign in to comment.