diff --git a/SUBMIT_CONFIG/slurm/config.yaml b/SUBMIT_CONFIG/slurm/config.yaml index b2545ee6c42e7ca50464b6aece0d3e1b192112e8..bbdbe9a74ed1e9416d3e023315007a8fec6b1958 100644 --- a/SUBMIT_CONFIG/slurm/config.yaml +++ b/SUBMIT_CONFIG/slurm/config.yaml @@ -7,9 +7,9 @@ cluster: --qos={resources.qos} --cpus-per-task={threads} --mem={resources.mem_mb} - --job-name=GEP.{rule}.{wildcards}.%j - --output=slurm_logs/{rule}/{wildcards}.%j.out - --error=slurm_logs/{rule}/{wildcards}.%j.err + --job-name=GEP.{rule}.%j + --output=slurm_logs/{rule}/%j.out + --error=slurm_logs/{rule}/%j.err --time={resources.time} diff --git a/Snakefile b/Snakefile index 3502a10834fd8b20a1bc8d3e1154e13b05b09fe9..8338c8bf15568564278ff21d804796b135b217b3 100644 --- a/Snakefile +++ b/Snakefile @@ -201,9 +201,8 @@ elif set(['ID', 'ASM_LEVEL', 'PRI_asm', 'ALT_asm', 'merylDB', 'merylDB_kmer', 'g dictSamples=samples.T.to_dict('list') ruleAllQCFiles=[] - ruleAll=expand(os.path.join(config['Results'],"1_evaluation/{asmID}/KEY_RESULTS/{asmID}_aggregatedResults.tsv"), asmID=list(dictSamples.keys())),\ - os.path.join(config['Results'],"1_evaluation/finalResults/TABLE_OF_RESULTS.tsv"), \ - os.path.join(config['Results'],"1_evaluation/finalResults/FULL_REPORT.pdf") + ruleAll=expand(os.path.join(config['Results'],"1_evaluation/{asmID}/KEY_RESULTS/{asmID}_aggregatedSTATS.tsv"), asmID=list(dictSamples.keys())),\ + os.path.join(config['Results'],"1_evaluation/finalResults/FINAL_REPORT.pdf") ### DOWNLOAD BUSCO LINEAGE (IF IT DOESN'T ALREADY EXIST) #### @@ -258,7 +257,7 @@ elif set(['ID', 'ASM_LEVEL', 'PRI_asm', 'ALT_asm', 'merylDB', 'merylDB_kmer', 'g raise ValueError("Error - could not identify lineage please check busco site for a correct prefix") else: - raise ValueError('Sample Sheet for not recognised. Please make sure you are using the correct sample sheet') + raise ValueError('Sample Sheet not recognised. Please make sure you are using the correct sample sheet') diff --git a/rules/build_illumina.smk b/rules/build_illumina.smk index 0680f4a9db7a157cf824298b3311df1d764c459c..b5c4d41a5a7a32ad610fcf1e44e21cc248bc0fe4 100644 --- a/rules/build_illumina.smk +++ b/rules/build_illumina.smk @@ -251,7 +251,6 @@ rule merylCount_R1_illumina: os.path.join(workflow.basedir, "envs/MERYL_MERQURY.yaml") shell: """ - export OMP_NUM_THREADS={threads} (meryl count k={params.kmer} threads={threads} {input.read1} output {output}) &> {log} """ @@ -275,7 +274,6 @@ rule merylCount_R2_illumina: os.path.join(workflow.basedir, "envs/MERYL_MERQURY.yaml") shell: """ - export OMP_NUM_THREADS={threads} (meryl count k={params.kmer} threads={threads} {input.read2} output {output}) &> {log} """ @@ -306,7 +304,6 @@ rule merylUnion_illumina: os.path.join(workflow.basedir, "envs/MERYL_MERQURY.yaml") shell: """ - export OMP_NUM_THREADS={threads} (meryl union-sum {input.read1} {input.read2} output {output}) &> {log} rm -r {params.removeReadDIR_trimmed} rm -r {params.removeReadDIR_unzipped} diff --git a/rules/evaluate.smk b/rules/evaluate.smk index 2867bd0b5a8b9bbc8e920538262399fb2f3adb54..7e81eff8297cc436ab4fc2e5ba50d5add134cb02 100644 --- a/rules/evaluate.smk +++ b/rules/evaluate.smk @@ -5,24 +5,22 @@ def merylDB(wildcards): return samples.loc[(wildcards.asmID), "merylDB"] -localrules: symlink_UnzippedFastq_R1_HiC, \ - symlink_UnzippedFastq_R2_HiC, \ - symlink_UnzippedFasta_PRI, \ - symlink_UnzippedFasta_ALT, \ - # symlinkMerylDB, \ -# moveBuscoOutputs, \ - copyKeyResults_GenomeScope2Profiles, \ - copyKeyResults, \ - saveConfigurationAndSampleSheet_createComparisonTablesTSV, \ - IndividualKeyResults_createMD, \ - PretextMaps_createMD, \ - ComparisonTables_createMD, \ - ReportWithoutComparisonTables_createMD, \ - ReportWithoutComparisonTables_createPDF, \ - ComparisonTablesColoured_createHTML, \ - ComparisonTables_createPDF, \ - ComparisonTablesGradient_createHTML, \ - COMBINE_ALL_PDFS +localrules: symlink_UnzippedFastq_R1_HiC, \ + symlink_UnzippedFastq_R2_HiC, \ + symlink_UnzippedFasta_PRI, \ + symlink_UnzippedFasta_ALT, \ + KeyResults_GenomescopeProfiles, \ + KeyResults, \ + Tables_TSV, \ + IndividualResults_md, \ + PretextMaps_md, \ + Table_md, \ + Reports_md, \ + Reports_pdf, \ + ColouredTable_html, \ + HeatmapTable_html, \ + BothTables_pdf, \ + ConcatAll_pdfs def HiC_R1_gzipped(wildcards): return yesGzip_HiC_R1.loc[(wildcards.asmID), "HiC_R1"] @@ -533,7 +531,7 @@ rule assemblyStats: -rule copyKeyResults_GenomeScope2Profiles: +rule KeyResults_GenomescopeProfiles: input: gscopeSum=os.path.join(config['Results'], "1_evaluation/{asmID}/GENOMESCOPE_PROFILES/{asmID}_k{kmer}_summary.txt"), gscopeLog=os.path.join(config['Results'], "1_evaluation/{asmID}/GENOMESCOPE_PROFILES/{asmID}_k{kmer}_log_plot.png"), @@ -554,7 +552,7 @@ rule copyKeyResults_GenomeScope2Profiles: -rule copyKeyResults: +rule KeyResults: input: gscopeSum=lambda wildcards: expand(os.path.join(config['Results'], "1_evaluation/{asmID}/GENOMESCOPE_PROFILES/{asmID}_k{kmer}_summary.txt"), asmID=wildcards.asmID, kmer=dictSamples[wildcards.asmID][4]), # gscopeLog=lambda wildcards: expand(os.path.join(config['Results'], "1_evaluation/{asmID}/GENOMESCOPE_PROFILES/{asmID}_k{kmer}_log_plot.png"), asmID=wildcards.asmID, kmer=dictSamples[wildcards.asmID][4]), @@ -628,7 +626,7 @@ rule copyKeyResults: rm {params.rowNames} {params.keyValues} """ -rule saveConfigurationAndSampleSheet_createComparisonTablesTSV: +rule Tables_TSV: input: allResults=expand(os.path.join(config['Results'],"1_evaluation/{asmID}/KEY_RESULTS/{asmID}_aggregatedSTATS.tsv"), asmID=list(dictSamples.keys())), sampleSheet= config['samplesTSV'], @@ -650,7 +648,7 @@ rule saveConfigurationAndSampleSheet_createComparisonTablesTSV: sed -i 's/,//g' {output.results} """ -rule IndividualKeyResults_createMD: +rule IndividualResults_md: input: os.path.join(config['Results'],"1_evaluation/{asmID}/KEY_RESULTS/{asmID}_aggregatedSTATS.tsv"), lambda wildcards: expand(os.path.join(config['Results'], "1_evaluation/{asmID}/KEY_RESULTS/{asmID}_k{kmer}_log_plot.png"),asmID=wildcards.asmID, kmer=dictSamples[wildcards.asmID][4]), @@ -673,7 +671,7 @@ rule IndividualKeyResults_createMD: -rule PretextMaps_createMD: +rule PretextMaps_md: input: PretextMap=os.path.join(config['Results'], "1_evaluation/{asmID}/HiC_MAPS/{asmID}.HiC.COMBINED.FILTERED_FullMap.png") output: @@ -686,7 +684,7 @@ rule PretextMaps_createMD: script: os.path.join(workflow.basedir, "scripts/report/pretextMapsToMarkdown.py") -rule ComparisonTables_createMD: +rule Table_md: input: results=os.path.join(config['Results'],"1_evaluation/finalResults/TABLE_OF_RESULTS.tsv") output: @@ -697,7 +695,7 @@ rule ComparisonTables_createMD: script: os.path.join(workflow.basedir, "scripts/report/addFullTableForReport.py") -rule ComparisonTablesColoured_createHTML: +rule ColouredTable_html: input: os.path.join(config['Results'],"1_evaluation/finalResults/TABLE_OF_RESULTS_roundedMB.tsv") params: @@ -714,7 +712,7 @@ rule ComparisonTablesColoured_createHTML: script: os.path.join(workflow.basedir, "scripts/compare_results/fullTable_heatmap_external.R") -rule ComparisonTablesGradient_createHTML: +rule HeatmapTable_html: input: os.path.join(config['Results'],"1_evaluation/finalResults/TABLE_OF_RESULTS_roundedMB.tsv") params: @@ -731,7 +729,7 @@ rule ComparisonTablesGradient_createHTML: script: os.path.join(workflow.basedir, "scripts/compare_results/fullTable_heatmap_internalComparison.R") -rule ComparisonTables_createPDF: +rule BothTables_pdf: input: coloured=os.path.join(config['Results'],"1_evaluation/finalResults/TABLE_OF_RESULTS_COLOURED.html"), gradient=os.path.join(config['Results'],"1_evaluation/finalResults/TABLE_OF_RESULTS_GRADIENT.html") @@ -756,7 +754,7 @@ rule ComparisonTables_createPDF: -o {output.gradient} --pdf-engine=wkhtmltopdf --pdf-engine-opt="-O" --pdf-engine-opt="Landscape" {input.gradient}) &>> {log} """ -rule ReportWithoutComparisonTables_createMD: +rule Reports_md: input: indivMD=[expand(os.path.join(config['Results'],"1_evaluation/{asmID}/KEY_RESULTS/{asmID}_k{kmer}_markdownForReport.md"), asmID=key, kmer=value5) for key, [value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, value11, value12, value13, value14, value15, value16] in dictSamples.items()], landingPage=os.path.join(workflow.basedir, "scripts/report/reportLandingPage.md"), @@ -775,7 +773,7 @@ rule ReportWithoutComparisonTables_createMD: # cat {input.landingPageTABLE} {input.endTableMD} >> {output.endTableMD} -rule ReportWithoutComparisonTables_createPDF: +rule Reports_pdf: input: md_report=os.path.join(config['Results'],"1_evaluation/finalResults/ALL_individual_REPORTS.md"), # md_comparison_table=os.path.join(config['Results'],"1_evaluation/finalResults/FullTableMarkdown_wPreamble.md") @@ -797,7 +795,7 @@ rule ReportWithoutComparisonTables_createPDF: """ # (pandoc -o {output.pdf_comparison_table} {input.md_comparison_table} --pdf-engine=tectonic) &>> {log} -rule COMBINE_ALL_PDFS: +rule ConcatAll_pdfs: input: pdf_report=os.path.join(config['Results'],"1_evaluation/finalResults/ALL_individual_REPORTS.pdf"), coloured=os.path.join(config['Results'],"1_evaluation/finalResults/TABLE_OF_RESULTS_COLOURED.pdf"), @@ -807,7 +805,7 @@ rule COMBINE_ALL_PDFS: pdf_report=os.path.join(config['Results'],"1_evaluation/finalResults/FINAL_REPORT.pdf"), # pdf_comparison_table=os.path.join(config['Results'],"1_evaluation/finalResults/FULL_TABLE_PDF.pdf") log: - os.path.join(config['Results'], "1_evaluation/logs/COMBINE_ALL_PDFS.log") + os.path.join(config['Results'], "1_evaluation/logs/ConcatAll_pdfs.log") conda: os.path.join(workflow.basedir, "envs/AUXILIARY_PYTHON_SCRIPTS.yaml") # threads: