Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,20 @@ In addition to the above, for each strain:
- Use [bactdating](https://github.com/xavierdidelot/BactDating) to make timed trees.
- Use [transphylo](https://github.com/xavierdidelot/TransPhylo) to infer transmission events on these timed trees.

This requires a `transmission_metadata.csv` file containing sampling times, see the PopPIPE configuration section below for a description of its format.
This requires a `transmission_metadata.csv` file containing sampling times, this file should look like this:
```
Name,Date
001334,2001
279388,2001
5Z52R,2007
```
Where the sample names match the PopPUNK analysis, followed by a date.

Please note that bactDating parses the dates using:
```r
tryFormats = c("%Y-%m-%d", "%Y/%m/%d", "%Y")
```
So your dates should be in a compatible format, usually at the same resolution (e.g. all just years)

For an example of this analysis, please find data at [10.6084/m9.figshare.28495571](https://dx.doi.org/10.6084/m9.figshare.28495571).
Input files and config file are in `input/` and the pipeline output after running `snakemake transmission --cores 4` is
Expand Down Expand Up @@ -122,9 +135,7 @@ in `config.yml` which lists the sampling dates. The run the transmission target:
snakemake transmission
```

## Usage example

TODO
Ensure dates are formatted consistently (see above).

## Config file

Expand Down
6 changes: 3 additions & 3 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ rule ska_align:
log:
"logs/ska_align_{strain}.log"
params:
prefix="output/strains/{strain}/align"
prefix="output/strains/{strain}/align",
min_freq=config['ska']['freq_filter']
shell:
"ska align -v --filter no-const --no-gap-only-sites {input.skf} > {output.alignment} 2> {log}"
"ska align -v --min-freq {params.min_freq} --filter no-const --no-gap-only-sites {input.skf} > {output.alignment} 2> {log}"

# ska for mapping (needed for gubbins)
rule ska_map:
Expand Down Expand Up @@ -174,7 +175,6 @@ rule iq_tree:
mode=config['iqtree']['mode'],
model=config['iqtree']['model'],
prefix="output/strains/{strain}/besttree.unrooted"

threads:
4
script:
Expand Down
4 changes: 2 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ska:
fastq_cov: 4
kmer: 31
single_strand: false
freq_filter: 0.9
freq_filter: 0.9 # only used in ska align step

# IQ-TREE options
iqtree:
Expand All @@ -37,7 +37,7 @@ mandrake:

# Microreact title, and your contact details
microreact:
name: Listeria PopPIPE
name: PopPIPE run
website: https://www.poppunk.net
email: poppunk@poppunk.net
api_token: a1b2c3d4 ## see https://docs.microreact.org/api/access-tokens
Expand Down
Loading