Skip to content

Commit d5a0cb8

Browse files
author
Will Rowe
authored
Merge pull request #67 from artic-network/symposiumRelease
Final changes for 1.2.0
2 parents 9111543 + f5cbba9 commit d5a0cb8

File tree

11 files changed

+24
-9
lines changed

11 files changed

+24
-9
lines changed

artic/minion.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ def get_scheme(scheme_name, scheme_directory, scheme_version="1"):
9090

9191
def run(parser, args):
9292

93+
# check for medaka-model
94+
if args.medaka and (args.medaka_model is None):
95+
print(colored.red('Must specify --medaka-model if using the --medaka workflow.'))
96+
raise SystemExit(1)
97+
9398
# 1) check the parameters and set up the filenames
9499
## find the primer scheme, reference sequence and confirm scheme version
95100
bed, ref, _ = get_scheme(args.scheme, args.scheme_directory, args.scheme_version)
@@ -204,7 +209,6 @@ def run(parser, args):
204209

205210
# 9) get the depth of coverage for each readgroup, create a coverage mask and plots, and add failed variants to the coverage mask (artic_mask must be run before bcftools consensus)
206211
cmds.append("artic_make_depth_mask --store-rg-depths %s %s.primertrimmed.rg.sorted.bam %s.coverage_mask.txt" % (ref, args.sample, args.sample))
207-
cmds.append("artic_plot_amplicon_depth --primerScheme %s --sampleID %s --outFilePrefix %s %s*.depths" % (bed, args.sample, args.sample, args.sample))
208212
cmds.append("artic_mask %s %s.coverage_mask.txt %s.fail.vcf %s.preconsensus.fasta" % (ref, args.sample, args.sample, args.sample))
209213

210214
# 10) generate the consensus sequence

artic/minion_validator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ def genCommand(sampleID, workflow):
191191
]
192192
if workflow=="medaka":
193193
cmd.append("--medaka")
194+
cmd.append("--medaka-model")
195+
cmd.append("r941_min_high_g351")
194196
if sampleID in extraFlags[workflow]:
195197
for flag in extraFlags[workflow][sampleID]:
196198
cmd.append(flag)

artic/pipeline.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ def init_pipeline_parser():
9797
'sample', metavar='sample', help='The name of the sample')
9898
parser_minion.add_argument('--medaka', dest='medaka', action='store_true',
9999
help='Use medaka instead of nanopolish for variants')
100-
parser_minion.add_argument('--medaka-model', metavar='medaka_model',
101-
default='r941_min_high_g351', help='The model to use for medaka (default: %(default)s)')
100+
parser_minion.add_argument('--medaka-model', metavar='medaka_model', help='The model to use for medaka (required if using --medaka)')
102101
parser_minion.add_argument('--no-longshot', dest='no_longshot', action='store_true', help='Do not use Longshot for variant filtering after medaka')
103102
parser_minion.add_argument('--minimap2', dest='minimap2', default=True,
104103
action='store_true', help='Use minimap2 (default)')

artic/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.1.3"
1+
__version__ = "1.2.0"

docs/commands.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ artic minion <scheme> <sample>
234234
| scheme | Y | NA | The name of the primer scheme |
235235
| sample | Y | NA | The name of the sample |
236236
| --medaka | N | False | Use medaka instead of nanopolish for variants |
237+
| --medaka-model | - | NA | Medaka model to use (required if --medaka set) |
237238
| --minimap2 | N | True | Use minimap2 |
238239
| --bwa | N | False | Use bwa instead of minimap2 |
239240
| --normalise | N | 100 | Normalise down to moderate coverage to save runtime |

docs/minion.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This page describes the core pipeline which is run via the `artic minion` comman
1616
There are **2 workflows** baked into the core pipeline, one which uses signal data (via [nanopolish](https://github.com/jts/nanopolish)) and one that does not (via [medaka](https://github.com/nanoporetech/medaka)). As the workflows are identical in many ways, this page will describe the pipeline as whole and notify the reader when there is dfferent behaviour between the two workflows.
1717
It should be noted here that by default the `nanopolish` workflow is selected; you need to specify `--medaka` (and `--medaka-model`) if you want the medaka workflow enabled.
1818

19+
> **NOTE**: It is very important that you select the appropriate value for `--medaka-model`.
20+
1921
At the end of each stage, we list here the "useful" stage output files which are kept. There will also be some additional files leftover at the end of the pipeline but these can be ignored (and are hopefully quite intuitively named).
2022

2123
## Stages
@@ -100,7 +102,7 @@ Finally, we use the `artic_vcf_filter` module to filter the merged variant file
100102

101103
### Consensus building
102104

103-
Prior to building a consensus, we use the post-processed alignment from the previous step to check each position of the reference sequence for sample coverage. Any poition that is not covered by at least 20 reads from either read group are marked as low coverage. We use the `artic_make_depth_mask` module for this, which produces coverage information for each read group and also produces a coverage mask to tell us which coordinates in the reference sequence failed the coverage threshold. We use `artic_plot_amplicon_depth` to take the read group depth data and plot amplicon coverage.
105+
Prior to building a consensus, we use the post-processed alignment from the previous step to check each position of the reference sequence for sample coverage. Any poition that is not covered by at least 20 reads from either read group are marked as low coverage. We use the `artic_make_depth_mask` module for this, which produces coverage information for each read group and also produces a coverage mask to tell us which coordinates in the reference sequence failed the coverage threshold.
104106

105107
Next, to build a consensus sequence for a sample, we require a pre-consensus sequence based on the input reference sequence. The preconsensus has low quality sites masked out with `N`'s using the coverage mask and the `$SAMPLE.fail.vcf` file. We then use `bcftools consensus` to combine the preconsensus with the `$SAMPLE.pass.vcf` variants to produce a consensus sequence for the sample. The consensus sequence has the artic workflow written to its header.
106108

@@ -122,6 +124,13 @@ Finally, the consensus sequence is aligned against the reference sequence using
122124
| artic_vcf_merge | combines VCF files from multiple read groups |
123125
| artic_vcf_filter | filters a combined VCF into PASS and FAIL variant files |
124126
| artic_make_depth_mask | create a coverage mask from the post-processed alignment |
125-
| artic_plot_amplicon_depth | plots per amplicon coverage |
126127
| artic_mask | combines the reference sequence, FAIL variants and coverage mask to produce a pre-consensus sequence |
127128
| artic_fasta_header | applies the artic workflow and identifier to the consensus sequence header |
129+
130+
## Optional pipeline report
131+
132+
As of version 1.2.0, you can run the artic fork of MultiQC (which should be installed as part of the artic conda environment) and this will produce a report containing amplicon coverage plots and variant call information. To generate a report from within your pipeline output directory:
133+
134+
```
135+
multiqc .
136+
```

environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ dependencies:
2525
- pyvcf=0.6.8
2626
- samtools=1.10
2727
- tqdm
28+
- pip:
29+
- git+https://github.com/will-rowe/MultiQC.git@artic

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
biopython
22
clint
3-
matplotlib
43
pandas
54
pysam
65
pytest
76
pyvcf
87
requests
9-
seaborn
108
tqdm

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
'artic_vcf_merge=artic.vcf_merge:main',
3939
'artic_vcf_filter=artic.vcf_filter:main',
4040
'artic_make_depth_mask=artic.make_depth_mask:main',
41-
'artic_plot_amplicon_depth=artic.plot_amplicon_depth:main',
4241
'artic_fasta_header=artic.fasta_header:main',
4342
'artic_mask=artic.mask:main',
4443
],

0 commit comments

Comments
 (0)