Skip to content

Commit

Permalink
transition commit from laptop
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Oct 30, 2020
1 parent 4c69d76 commit 573931c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 21 deletions.
26 changes: 25 additions & 1 deletion docs-new/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,32 @@ TBD

## Genomic Alignment

Edit ```config/snakemake.yaml``` to increase the number of assembly downloads.

### Modern Assembly

Construct an alignment of ALL modern *Y. pestis* assemblies. Modify ```config/snakemake.yaml``` to have the following lines:


```bash
max_datasets_assembly : 600
sqlite_select_command_asm : SELECT
AssemblyFTPGenbank
FROM
BioSample
LEFT JOIN Assembly
ON AssemblyBioSampleAccession = BioSampleAccession
WHERE (BioSampleComment LIKE '%Assembly%Modern%')
```

Construct the pairwise alignment to the reference genome.

```bash
snakemake --profile profiles/infoserv snippy_pairwise_assembly
```

Create a MultiQC report of the genome alignment statistics.

```bash
snakemake --profile profiles/infoserv multiqc_assembly
```

31 changes: 13 additions & 18 deletions workflow/rules/qc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ rule multiqc:
"""
input:
multiqc_config = config_dir + "/multiqc.yaml",
qualimap_asm_dir = expand(results_dir + "/qualimap/assembly/{sample}/", sample=identify_assembly_sample()),
#qualimap_local_dir = expand(results_dir + "/eager/local/{sample}/qualimap/{sample}/", sample=identify_local_sample()),
qualimap_local_dir = expand(results_dir + "/qualimap/local/{sample}/", sample=identify_local_sample()),
#qualimap_sra_dir = expand(results_dir + "/eager/sra/{sample}/qualimap/{sample}/", sample=identify_sra_sample()),
qualimap_sra_dir = expand(results_dir + "/qualimap/sra/{sample}/", sample=identify_sra_sample()),
snippy_multi_txt = results_dir + "/snippy_multi/snippy-core.txt",
snippy_asm_dir = expand(results_dir + "/snippy_pairwise/assembly/{sample}/", sample=identify_assembly_sample()),
snippy_local_dir = expand(results_dir + "/snippy_pairwise/local/{sample}/", sample=identify_local_sample()),
snippy_sra_dir = expand(results_dir + "/snippy_pairwise/sra/{sample}/", sample=identify_sra_sample()),
qualimap_dir = lambda wildcards: expand(results_dir + "/qualimap/{{reads_origin}}/{sample}/",
sample=file_acc=globals()["identify_" + wildcards.reads_origin + "_sample"]()),
snippy_pairwise_dir = lambda wildcards: expand(results_dir + "/snippy_pairwise/{{reads_origin}}/{sample}/",
sample=file_acc=globals()["identify_" + wildcards.reads_origin + "_sample"]()),
snippy_multi_dir = results_dir + "/snippy_multi/",
wildcard_constraints:
reads_origin="(assembly|sra|local)",
output:
report(results_dir + "/multiqc/multiqc_report.html",
multiqc_report = report(results_dir + "/multiqc/multiqc_{reads_origin}.html",
caption=os.path.join(report_dir,"multiqc_report.rst"),
category="Quality Control",
subcategory="MultiQC"),
Expand All @@ -68,19 +66,16 @@ rule multiqc:
subcategory="Qualimap"),
dir = directory(results_dir + "/multiqc/"),
log:
os.path.join(logs_dir, "multiqc/multiqc.log")
os.path.join(logs_dir, "multiqc/multiqc_{reads_origin}.log")
resources:
cpus = 1,
shell:
"multiqc \
-c {input.multiqc_config} \
--export \
--outdir {output.dir} \
--filename {output.multiqc_report} \
--force \
{input.qualimap_asm_dir} \
{input.qualimap_local_dir} \
{input.qualimap_sra_dir} \
{input.snippy_multi_txt} \
{input.snippy_asm_dir} \
{input.snippy_local_dir} \
{input.snippy_sra_dir} 2> {log}"
{input.qualimap_dir} \
{input.snippy_pairwise_dir} \
{input.snippy_multi_dir} 2> {log}"
13 changes: 11 additions & 2 deletions workflow/rules/targets.smk
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,17 @@ rule qualimap_local:
expand(results_dir + "/qualimap/local/{sample}/qualimapReport.html",
sample=identify_local_sample())

# multiqc can be run for testing as
# rule: iqtree
rule multiqc_assembly:
input:
results_dir + "/multiqc/multiqc_assembly.html",

rule multiqc_sra:
input:
results_dir + "/multiqc/multiqc_sra.html",

rule multiqc_local:
input:
results_dir + "/multiqc/multiqc_local.html",

#------------------------------------------------------------------------------#
# Plot
Expand Down

0 comments on commit 573931c

Please sign in to comment.