annotate nanoclust.sh @ 0:cc560d7f391a draft default tip

Uploaded a bash file to test
author trungnguyencoffee97ktest
date Wed, 01 Jun 2022 07:02:10 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
1 #! /bin/bash
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
2 ## This code is invented to test NanoporeSanger pipeline, in which we use barrnap to extract 16S ribosomal of bacteria, and use it for taxonomy
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
3 set -ux
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
4 export THREADS=20
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
5 export nextflow='/media/kt/data/0.Tools/nextflow/nextflow'
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
6 export nanoclust_main='/media/kt/data/TRUNG/2.Tool/NanoCLUST/main.nf'
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
7 export seqtk='/media/kt/data/anaconda3/envs/kt/bin/seqtk'
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
8 export outdir='/media/kt/data/TRUNG/0.Projects/13.NANOPORE-SANGER/3.Output/NanoClust/16SNCBI_REFFSEQ'
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
9 export db16Sncbi='/media/kt/data/TRUNG/2.Tool/NanoCLUST/db/16S_ribosomal_RNA'
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
10 export db16Ssilva_nr_ref='/media/kt/data/TRUNG/3.Database/database_sliva/Nonredundant_Ref/SILVA_138-1_nr_ref'
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
11 export taxdbncbi="/media/kt/data/TRUNG/2.Tool/NanoCLUST/db/taxdb/"
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
12
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
13
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
14 longread='/media/kt/data/TRUNG/0.Projects/13.NANOPORE-SANGER/3.Output/Nanopore_reads_of_GCF_000196035.1_ASM19603v1_genomic.trimmed.fastq.gz'
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
15 allreads=''
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
16 for nread in {100,500,1000,1500,2000}; do
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
17 prefix=$(basename -s .fastq.gz $longread)
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
18 #capacity=$(awk "BEGIN {print int($nread*1500/10**6+0.5)}")
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
19 mkdir -p $outdir/${prefix}
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
20 outread=$outdir/${prefix}/${prefix}_${nread}_reads.fastq.gz
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
21 $seqtk sample -s50 $longread $nread | gzip > $outread
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
22 $nextflow $nanoclust_main -profile docker --reads $outread --outdir $outdir/$prefix/${prefix}_${nread}_reads \
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
23 --db $db16Sncbi --tax $taxdbncbi
cc560d7f391a Uploaded a bash file to test
trungnguyencoffee97ktest
parents:
diff changeset
24 done