-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plasmid_nanopore_polished_flye.sh
55 lines (40 loc) · 1.95 KB
/
Plasmid_nanopore_polished_flye.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## Assembly pipeline for Maboni et al. 2022
## Three Distinct Annotation Platforms Differ in Detection of Antimicrobial Resistance Genes in Long-Read,
## Short-Read, and Hybrid Sequences Derived from Total Genomic DNA or from Purified Plasmid DNA
## Pipeline by Isaac Framst ([email protected])
## University of Guelph, Department of Pathobiology
## University of Georgia, Athens Veterinary Diagnostic Laboratory
#*************************************************
echo "please assign run ID"
read runID
echo "please specify directory for raw ONT reads"
read readDir
echo "Please specify directory for illumina forward reads"
read fwdRead
echo "Please specify directory for illumina reverse reads"
read revRead
printf "\n\n*******************************************************************************\n"
printf "Run started for ${runID} on $(date)\n"
printf "*******************************************************************************\n\n"
## working dirs
mkdir $runID
cd $runID
## join all reads in one file, store in temp location
cat ${readDir}/*.fastq > ${runID}_all.fastq
## trim adapters and barcodes
porechop -i ${runID}_all.fastq -o ${runID}_trimmed.fastq --threads 10 --barcode_threshold 80
## Assemble
flye --nano-raw ${runID}_trimmed.fastq --out-dir ${runID}_assm_raw --threads 4 -i 2
## Polish
bwa index ${runID}_assm_raw/assembly.fasta
bwa mem -v 2 -M ${runID}_assm_raw/assembly.fasta $fwdRead $revRead > bwa_mapping.sam
samtools view -b -S bwa_mapping.sam > bwa_mapping.bam
samtools sort bwa_mapping.bam bwa_mapping_sorted
samtools index bwa_mapping_sorted.bam
pilon --genome ${runID}_assm_raw/assembly.fasta --bam bwa_mapping_sorted.bam --output $runID --outdir ${runID}_pilon --vcf
cd ..
printf "\n\n*******************************************************************************\n"
printf "Run finished for ${runID} on $(date)\n"
printf "*******************************************************************************\n\n"
## Validated May 30, 2022
##EOF