#PBS -q xl230g9q
#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/scratch/ws/psbelokopytova/202208081122polya_data/4c_plasmid/2022-06-20/
cd $WORK_DIR;
[ -d stat ] || mkdir cutadapt;
# Declare a string array with type
declare -a files=("C2")

for file in "${files[@]}"
do
cutadapt -a AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC -A AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT -o $WORK_DIR/cutadapt/cutIL_${file}_1.fq.gz -p $WORK_DIR/cutadapt/cutIL_${file}_2.fq.gz $WORK_DIR/raw/${file}/${file}_*_1.fq.gz $WORK_DIR/raw/${file}/${file}_*_2.fq.gz -m 8;
wait;
cutadapt -g pr_plasmid1=GAATCAGGGGATAACGCAGGAAAGAACATG -y '{name}' -g pr_CMVplasmid2=AACAGCTATGACCATTACGCCAAGCTTGGCCTGCAGGTCACGGGGTCATTAGTTCATAGCCCATATATGGAGTTCCGCGTTACATAACTTACGGTAAATGGCCCGCCTGGCTGACCGCCCAACGACCCCCGCCCATTGACGT -y '{name}' -G pr_plasmid1=GAATCAGGGGATAACGCAGGAAAGAACATG -y '{name}' -G pr_CMVplasmid2=AACAGCTATGACCATTACGCCAAGCTTGGCCTGCAGGTCACGGGGTCATTAGTTCATAGCCCATATATGGAGTTCCGCGTTACATAACTTACGGTAAATGGCCCGCCTGGCTGACCGCCCAACGACCCCCGCCCATTGACGT -y '{name}' -o $WORK_DIR/cutadapt/cut_barc_praimers_cutIL_${file}_1.fq.gz -p $WORK_DIR/cutadapt/cut_barc_praimers_cutIL_${file}_2.fq.gz $WORK_DIR/cutadapt/cutIL_${file}_1.fq.gz $WORK_DIR/cutadapt/cutIL_${file}_2.fq.gz --overlap 20;
done
done
