#PBS -q bl2x220g7q
#PBS -l select=1:ncpus=5:mem=10g
#PBS -l walltime=01:00:00
#PBS -l cput=01:00:00

source ~/programms/ame/bin/activate
WORK_DIR=/mnt/storage/home/psbelokopytova/scratch/202111020942Polina/4c_plasmid/2021-10-20/
cd $WORK_DIR;
mkdir cutadapt;
# Declare a string array with type
declare -a files=("103_S103" "104_S104" "105_S105")

for file in "${files[@]}"
do
cutadapt -a AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC -A AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT -o $WORK_DIR/cutadapt/cutIL_${file}_L001_R1_001.fastq.gz -p $WORK_DIR/cutadapt/cutIL_${file}_L001_R2_001.fastq.gz $WORK_DIR/raw/${file}_L001_R1_001.fastq.gz $WORK_DIR/raw/${file}_L001_R2_001.fastq.gz -m 8;
wait;
cutadapt -g pr_plasmid1=GAATCAGGGGATAACGCAGGAAAGAACATG -y '{name}' -g pr_plasmid2=AACAGCTATGACCATTACGCCAAGCTTGGCCTGCAGGTCGACTCTAGAGGATCCCCGGGTACCGAGCTCGAATTCACTGGCCGTCGTTTTACAACGT -y '{name}' -G pr_plasmid1=GAATCAGGGGATAACGCAGGAAAGAACATG -y '{name}' -G pr_plasmid2=AACAGCTATGACCATTACGCCAAGCTTGGCCTGCAGGTCGACTCTAGAGGATCCCCGGGTACCGAGCTCGAATTCACTGGCCGTCGTTTTACAACGT -y '{name}' -o $WORK_DIR/cutadapt/cut_barc_praimers_cutIL_${file}_L001_R1_001.fastq.gz -p $WORK_DIR/cutadapt/cut_barc_praimers_cutIL_${file}_L001_R2_001.fastq.gz --overlap 10 $WORK_DIR/cutadapt/cutIL_${file}_L001_R1_001.fastq.gz $WORK_DIR/cutadapt/cutIL_${file}_L001_R2_001.fastq.gz;
done
