Project

General

Profile

Wiki » History » Version 16

Katie Lennard, 10/03/2022 02:42 PM

1 1 Katie Lennard
# Wiki
2
3
# Data location: 
4
5
The data was transferred from Athena medmicro):
6
7
``` 
8
/MedMicro/Clinton/CRE Pfizer Feb 2022/CRE study_1A_results_17022022 
9
/MedMicro/Clinton/CRE Pfizer Feb 2022/CRE study_1B_results_21022022
10
```
11
 
12
to Ilifu:
13
14
```
15
/scratch3/users/katiel/Clinton/CRE_study_August_2022/
16
```
17
18 4 Katie Lennard
# Reference data:
19 1 Katie Lennard
20
Klebsiella pneumoniae – strain HS11286 (GenBank accession no. CP003200.1) (n=18); 
21
Serratia marcescens – strain KS10 (GenBank accession no. CP027798.1) (n=3); 
22 2 Katie Lennard
Escherichia coli – strain ATCC 25922 (GenBank accession no. CP009072.1) (n=1); and 
23 1 Katie Lennard
Enterobacter cloacae – strain ATCC 13047 (GenBank accession no. NC_014121.1) (n=1).
24
25 2 Katie Lennard
```
26
/scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_genomes
27
```
28
29 4 Katie Lennard
# Objectives workflow:
30 2 Katie Lennard
![workflow.png]()
31 3 Katie Lennard
32 4 Katie Lennard
# QC:
33 15 Katie Lennard
11 sample failed QC phred scores before trimming and filtering and had to be rerun. Filtering and trimming were executed as follows:
34 3 Katie Lennard
35
```
36 1 Katie Lennard
nextflow run kviljoen/fastq_QC --reads '/scratch3/users/katiel/Clinton/CRE_study_August_2022/raw/study_1A_B_combined/*_R{1,2}_001.fastq.gz' -profile ilifu
37
```
38
QC reports can be found in the 'files' tab
39
40 15 Katie Lennard
The rerun data is under:
41
42
```
43
/scratch3/users/katiel/Clinton/CRE_study_August_2022/raw/'CRE study_1A_results_repeat_22092022'
44
```
45
46 4 Katie Lennard
# AMR profiling
47
The preference from Clinton is to do AMR profiling with the ResFinder DB. I'm getting errors there that I think relate to the header formatting though so in the interim have run with the ARG_annot DB that we used for previous projects as:
48 6 Katie Lennard
49
## ARGannot
50 1 Katie Lennard
```
51 6 Katie Lennard
nextflow run kviljoen/uct-srst2 --reads '/scratch3/users/katiel/Clinton/CRE_study_August_2022/2022-09-19-fastq_QC/bbduk/*_{1,2}.fq' -profile ilifu --gene_db /cbio/users/katie/Nicol/Ps_aerug_srst2_MLST/ARGannot_r3.fasta --outdir /scratch3/users/katiel/Clinton/CRE_study_August_2022/srst2_ARGannot/coverage_80_run --min_gene_cov 80
52 1 Katie Lennard
```
53 7 Katie Lennard
Individual results files compiled as:
54 5 Katie Lennard
55 7 Katie Lennard
```
56
srst2 --prev_output *results.txt --output ARGannot_AMRs
57
```
58
59 6 Katie Lennard
## CARD DB: 
60 1 Katie Lennard
61 6 Katie Lennard
This database is the recommended by srst2 and has been formatted by them already. The DB was downloaded with:
62
63 1 Katie Lennard
```
64
wget https://github.com/katholt/srst2/blob/master/data/CARD_v3.0.8_SRST2.fasta?raw=true -O CARD_v3.0.8_SRST2.fasta
65 6 Katie Lennard
```
66
67
Pipeline execution as:
68
69
```
70
nextflow run kviljoen/uct-srst2 --reads '/scratch3/users/katiel/Clinton/CRE_study_August_2022/2022-09-19-fastq_QC/bbduk/*_{1,2}.fq' -profile ilifu --gene_db /scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_files/CARD_v3.0.8_SRST2.fasta --outdir /scratch3/users/katiel/Clinton/CRE_study_August_2022/srst2_CARD/coverage_80_run --min_gene_cov 80
71 7 Katie Lennard
```
72
73
Individual results files compiled as:
74
75
```
76
srst2 --prev_output *results.txt --output CARD_AMRs
77 5 Katie Lennard
```
78 8 Katie Lennard
79
# Virulence factors
80
81 10 Katie Lennard
Building the relevant VFDB for Klebsiella requires a python script that needs the biopython module (use the /cbio/users/katie/singularity_containers/srst2_v2.simg singularity container for this)
82
NB: in order to use the correct python version (2.7.5) for srst2 I first had to comment out the lines at the end of my .bashrc file relating to conda initialize
83 8 Katie Lennard
84
Build genus-specific DB:
85
```
86 10 Katie Lennard
python /cbio/users/katie/Nicol/Ps_aerug_srst2_MLST/VFDB/srst2/database_clustering/VFDBgenus.py --infile /scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_files/VFDB_setB_nt.fas --genus Klebsiella 
87 8 Katie Lennard
```
88
was used to create the VF DB Klebsiella.fsa 
89
90 1 Katie Lennard
The same procedure (as last year ;) was executed for Escherichia, Serratia and Enterobacter
91 8 Katie Lennard
92
cd-hit (needed to build vfdb as outlined here https://github.com/katholt/srst2#using-the-vfdb-virulence-factor-database-with-srst2) docker images was pulled from here https://quay.io/repository/biocontainers/cd-hit?tab=tags and converted to singularity image on BST server:
93
```
94 1 Katie Lennard
singularity exec /cbio/users/katie/singularity_containers/cd-hit.simg /bin/bash
95
```
96
97
then run CD-HIT to cluster the sequences for this genus, at 90% nucleotide identity:
98
99
```
100
 cd-hit -i Klebsiella.fsa -o Klebsiella_cdhit90 -c 0.9 > Klebsiella_cdhit90.stdout
101
```
102
103
Repeat for other .fsa DBs
104 8 Katie Lennard
105 10 Katie Lennard
NExt parse the cluster output and tabulate the results using the specific Virulence gene DB compatible script (use srst2_v2.simg again)
106 8 Katie Lennard
107 9 Katie Lennard
```
108
python /cbio/users/katie/Nicol/Ps_aerug_srst2_MLST/VFDB/srst2/database_clustering/VFDB_cdhit_to_csv_KLedit.py --cluster_file Klebsiella_cdhit90.clstr --infile Klebsiella.fsa --outfile Klebsiella_cdhit90.csv
109 10 Katie Lennard
```
110
111
Next convert the resulting csv table to a SRST2-compatible sequence database using:
112
113
114
```
115
python /cbio/users/katie/Nicol/Ps_aerug_srst2_MLST/VFDB/srst2/database_clustering/csv_to_gene_db.py -t Klebsiella_cdhit90.csv -o Klebsiella_VF_clustered.fasta -s 5
116
117
```
118
119
The actual VF typing can now be done using this clustered DB:
120
121
```
122
nextflow run kviljoen/uct-srst2 --reads '/scratch3/users/katiel/Clinton/CRE_study_August_2022/2022-09-19-fastq_QC/bbduk/*_{1,2}.fq' -profile ilifu --gene_db /scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_files/Klebsiella_VF_clustered.fasta --outdir /scratch3/users/katiel/Clinton/CRE_study_August_2022/srst2_VFs/coverage_80_run --min_gene_cov 80
123 9 Katie Lennard
```
124 11 Katie Lennard
125
Again combine individual sample results files with e.g.
126
```
127
srst2 --prev_output *genes* --output Klebsiella_VFs
128
```
129
130
# MLST
131 12 Katie Lennard
MLST profiles were downloaded for E. coli and K. pneumoniae as:
132
133
```
134
python /cbio/users/katie/Nicol/Ps_aerug_srst2_MLST/VFDB/srst2/scripts/getmlst.py --species 'Escherichia coli#1'
135
python /cbio/users/katie/Nicol/Ps_aerug_srst2_MLST/VFDB/srst2/scripts/getmlst.py --species 'Escherichia coli#2'
136
python /cbio/users/katie/Nicol/Ps_aerug_srst2_MLST/VFDB/srst2/scripts/getmlst.py --species 'Klebsiella pneumoniae'
137
138
```
139
140
Note: MLST profiles not available for Serratia marecescens or Enterobacter cloacae
141 11 Katie Lennard
142 13 Katie Lennard
MLST profiling execution:
143
144
```
145
nextflow run kviljoen/uct-srst2 --reads '/scratch3/users/katiel/Clinton/CRE_study_August_2022/2022-09-19-fastq_QC/bbduk/*_{1,2}.fq' -profile ilifu --mlst_definitions /scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_files/Klebsiella_definitions --mlst_db /scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_files/Klebsiella_pneumoniae.fasta --mlst_delimiter _ --outdir /scratch3/users/katiel/Clinton/CRE_study_August_2022/srst2_MLSTs/Klebsiella_MLSTs
146
```
147 14 Katie Lennard
148
```
149
nextflow run kviljoen/uct-srst2 --reads '/scratch3/users/katiel/Clinton/CRE_study_August_2022/2022-09-19-fastq_QC/bbduk/*_{1,2}.fq' -profile ilifu --mlst_definitions /scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_files/E_coli_1_definitions --mlst_db /scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_files/Escherichia_coli#1.fasta --mlst_delimiter _ --outdir /scratch3/users/katiel/Clinton/CRE_study_August_2022/srst2_MLSTs/E_coli1_MLSTs
150
```
151
152
```
153 1 Katie Lennard
nextflow run kviljoen/uct-srst2 --reads '/scratch3/users/katiel/Clinton/CRE_study_August_2022/2022-09-19-fastq_QC/bbduk/*_{1,2}.fq' -profile ilifu --mlst_definitions /scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_files/E_coli_2_definitions --mlst_db /scratch3/users/katiel/Clinton/CRE_study_August_2022/ref_files/Escherichia_coli#2.fasta --mlst_delimiter _ --outdir /scratch3/users/katiel/Clinton/CRE_study_August_2022/srst2_MLSTs/E_coli2_MLSTs
154 15 Katie Lennard
```
155
156
## Rerun
157
158 16 Katie Lennard
11 samples had to be rerun that failed QC. Here I combine them (post-filter and -trim) with the rest of the samples that passed QC first time via symlinks:
159
Note: to agree with srst2 file naming specifications I renamd the trimmed files from e.g. *_R1.fq to *_1.fq (remove R)
160 15 Katie Lennard
161
```
162
/scratch3/users/katiel/Clinton/CRE_study_August_2022/1A_B_plus_reruns_filtered_trimmed
163 1 Katie Lennard
```
164 16 Katie Lennard
165
All reruns were executed as before but now using the above filepath for input reads and adding extenstion '*_v2' to output folders