for i in `tail -n+2 $datafile/metadata.txt|cut -f1`;do
#threads 15 15线程
bowtie2 --threads 15 -x $host_index/Canis_lupus/wolf -1 $workdir/1.host_del_and_qc/cleandata/${i}_1.fastq -2 $workdir/1.host_del_and_qc/cleandata/${i}_2.fastq -S $workdir/1.host_del_and_qc/cleandata/${i}.bowtie.sam --very-sensitive-local 2>$workdir/1.host_del_and_qc/cleandata/${i}.bowtie.map.log done
for i in `tail -n+2 $datafile/metadata.txt|cut -f1`;do
# Filter and output as SAM(or BAM),-f 4 to Remove reads from the alignment,
# if you want to keep the -F on the alignment (12 for both ends), add -b before the output to output in BAM format
samtools view --threads 15 -f 12 -h $workdir/1.host_del_and_qc/cleandata/${i}.bowtie.sam > $workdir/1.host_del_and_qc/cleandata/${i}.fin.sam done
#Convert back to FQ format and Overwrites the original file
tail -n+2 $datafile/metadata.txt | cut -f1 | rush -j 6 "samtools fastq -1 $workdir/1.host_del_and_qc/cleandata/{}_1.fastq -2 $workdir/1.host_del_and_qc/cleandata/{}_2.fastq $workdir/1.host_del_and_qc/cleandata/{}.fin.sam" done