Skip to content

Commit

Permalink
Merge branch 'add_lineage' of https://github.com/jts/ncov-tools into …
Browse files Browse the repository at this point in the history
…watch
  • Loading branch information
jts committed Jan 22, 2021
2 parents 82d4f3a + 13cbd1e commit 4280173
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ rule all:
input:
get_qc_sequencing_plots,
get_qc_analysis_plots,
get_qc_reports
get_qc_reports,
get_recurrent_heatmap_plot
8 changes: 7 additions & 1 deletion workflow/rules/analysis.smk
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ rule make_sample_qc_summary:
alleles=get_run_alleles,
samplecoverage="qc_sequencing/{sample}.per_base_coverage.bed",
samplevariants=get_variants,
sampleconsensus=get_consensus
sampleconsensus=get_consensus,
lineagereport=get_lineage_report,
aa_table="qc_annotation/{sample}_aa_table.tsv",
watch=get_watch_variants_report
output:
"qc_analysis/{sample}.summary.qc.tsv"
params:
Expand All @@ -157,6 +160,9 @@ rule make_sample_qc_summary:
--indel \
--consensus {input.sampleconsensus} {params.platform_opt} \
--sample {wildcards.sample} \
--lineage {input.lineagereport} \
--aa_table {input.aa_table} \
--mutations {input.watch} \
--run_name {params.run_name_opt} > {output}"

# merge the per-sample summary files into the run-level report
Expand Down
13 changes: 9 additions & 4 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,17 @@ def get_tree_consensus_sequences(wildcards):
return consensus_sequences

def get_tree_plot_input(wildcards):

input_list = ["qc_analysis/{prefix}_tree.nwk", "qc_analysis/{prefix}_alleles.tsv"]
if "assign_lineages" in config and config["assign_lineages"]:
input_list.append("lineages/{prefix}_lineage_report.csv")
input_list = ["qc_analysis/{prefix}_tree.nwk", "qc_analysis/{prefix}_alleles.tsv", "lineages/{prefix}_lineage_report.csv"]
return input_list

def get_lineage_report(wildcards):
lineage_report = f"lineages/{config['run_name']}_lineage_report.csv"
return lineage_report

def get_watch_variants_report(wildcards):
watch_variants_report = f"qc_reports/{config['run_name']}_ncov_watch_variants.tsv"
return watch_variants_report

def get_qc_sequencing_plots(wildcards):
prefix = get_run_name()
out = [ "plots/%s_amplicon_covered_fraction.pdf" % (prefix),
Expand Down

0 comments on commit 4280173

Please sign in to comment.