Extract and clean unmapped reads

extract_unmapped.sh is used to extract unmapped reads and remove low quality reads.

Batch submission :

for file in $(find /groups/bipaa/ref/Hemiptera/Acyrthosiphon_pisum/Speciaphid/BAMs_bwa/MAPPED_BWA/*/*.bam) ; do qsub -cwd extract_unmapped.sh $file ; done

Run Centrifuge on unmapped reads

centrifuge.sh is used to perform the taxonomic assignation of unmapped reads.

Script :

#!/bin/bash
~/git/centrifuge/centrifuge -t -x /home/genouest/inrarennes/flegeai/local/Centrifuge/Indexes/nt/nt -1 ${1}_unmapped_cleaned.1.fastq  -2 ${1}_unmapped_cleaned.2.fastq  -p 8 -S ${2}.centrifuge --report-file ${2}.cf.report.tsv

~/git/centrifuge/centrifuge-kreport -x /home/genouest/inrarennes/flegeai/local/Centrifuge/Indexes/nt/nt -min-length 40 $2.centrifuge > $2.kraken

Batch submission on the cluster :

for file in  /groups/bipaa/ref/Hemiptera/Acyrthosiphon_pisum/Speciaphid/BAMs_bwa/UNMAPPED_BWA/*.cleaned.1.fastq  ; do file="${file%_*_*}" ; out=$(basename $file) ; qsub -pe make 8 -l h_vmem=60G -cwd centrifuge.sh $file $out ; done