Skip to content

Commit

Permalink
phylogenetic: Add profile for CI example build
Browse files Browse the repository at this point in the history
Adds custom rule to copy over the example data to be able to run
the build with example data. This allows users to run the example build
without having to manually copy over the data.
  • Loading branch information
joverlee521 committed Nov 7, 2023
1 parent dddd4ac commit 5d6f898
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
14 changes: 14 additions & 0 deletions phylogenetic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ Follow the [standard installation instructions](https://docs.nextstrain.org/en/l

## Usage

### Example build

You can run an example build using the example data provided in this repository via:

```
nextstrain build . --configfile profiles/ci/builds.yaml
```

When the build has finished running, view the output Auspice trees via:

```
nextstrain view .
```

### Provision input data

Input sequences and metadata can be retrieved from data.nextstrain.org
Expand Down
83 changes: 83 additions & 0 deletions phylogenetic/profiles/ci/builds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
custom_rules:
- profiles/ci/copy_example_data.smk

reference: "config/reference.fasta"
genemap: "config/genemap.gff"
genbank_reference: "config/reference.gb"
include: "config/hmpxv1/include.txt"
clades: "config/clades.tsv"
lat_longs: "config/lat_longs.tsv"
auspice_config: "config/hmpxv1/auspice_config.json"
description: "config/description.md"
tree_mask: "config/tree_mask.tsv"

# Use `accession` as the ID column since `strain` currently contains duplicates¹.
# ¹ https://github.com/nextstrain/monkeypox/issues/33
strain_id_field: "accession"
display_strain_field: "strain"

build_name: "hmpxv1"
auspice_name: "mpox_clade-IIb"

filter:
exclude: "config/exclude_accessions.txt"
min_date: 2017
min_length: 100000


### Set 1: Non-B.1 sequences: use all
### Set 2: B.1 sequences: small sample across year/country, maybe month
subsample:
non_b1:
group_by: "--group-by lineage year country"
sequences_per_group: "--sequences-per-group 50"
other_filters: "outbreak!=hMPXV-1 clade!=IIb"
exclude_lineages:
- B.1
- B.1.1
- B.1.2
- B.1.3
- B.1.4
- B.1.5
- B.1.6
- B.1.7
- B.1.8
- B.1.9
- B.1.10
- B.1.11
- B.1.12
- B.1.13
- B.1.14
- B.1.15
- B.1.16
- B.1.17
- B.1.18
- B.1.19
- B.1.20
- C.1
b1:
group_by: "--group-by country year"
sequences_per_group: "--subsample-max-sequences 100"
other_filters: "--exclude-where outbreak!=hMPXV-1 clade!=IIb"

## align
max_indel: 10000
seed_spacing: 1000

## treefix
fix_tree: true
treefix_root: "--root MK783032"

## refine
timetree: true
root: "MK783032 MK783030"
clock_rate: 5.7e-5
clock_std_dev: 2e-5

## recency
recency: true

mask:
from_beginning: 800
from_end: 6422
maskfile: "config/mask.bed"
15 changes: 15 additions & 0 deletions phylogenetic/profiles/ci/copy_example_data.smk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rule copy_example_data:
input:
sequences="example_data/sequences.fasta",
metadata="example_data/metadata.tsv",
output:
sequences="data/sequences.fasta",
metadata="data/metadata.tsv",
shell:
"""
cp -f {input.sequences} {output.sequences}
cp -f {input.metadata} {output.metadata}
"""


ruleorder: copy_example_data > decompress

0 comments on commit 5d6f898

Please sign in to comment.