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

source ~/programms/ame/bin/activate
WORK_DIR=/mnt/storage/home/psbelokopytova/scratch/202312241147Polina/loxP_project/2023-05-18
cd $WORK_DIR;
mkdir cutadapt;
# Declare a string array with type
declare -a files=("sum_rear1" "sum_rear2" "sum_rear3" "sum_wt1" "sum_wt2")
for file in "${files[@]}"
do

cutadapt -a AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC -A AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT -o $WORK_DIR/cutadapt/cutIL_${file}_R1.fq.gz -p $WORK_DIR/cutadapt/cutIL_${file}_R2.fq.gz $WORK_DIR/raw/${file}/${file}_L1_1.fq.gz $WORK_DIR/raw/${file}/${file}_L1_2.fq.gz -m 8;

cutadapt -g "ada1=AAACGAGTTTTAATGACTCCAACTTAAGTGTATGTAAACTTCCGACTTCAACTGTA;max_error_rate=0;min_overlap=56" -y {name} -g "ada2=ATGTCAGGAATTGTGAAAAAGTGAGTTTAAATGTATTTGGCTAAGGTGTATGTAAACTTCCGACTTCAACTGTA;max_error_rate=0;min_overlap=74" -y {name} -G "ada1=AAACGAGTTTTAATGACTCCAACTTAAGTGTATGTAAACTTCCGACTTCAACTGTA;max_error_rate=0;min_overlap=56" -y {name} -G "ada2=ATGTCAGGAATTGTGAAAAAGTGAGTTTAAATGTATTTGGCTAAGGTGTATGTAAACTTCCGACTTCAACTGTA;max_error_rate=0;min_overlap=74" -y {name} -o $WORK_DIR/cutadapt/cut_barc_praimers_cutIL_${file}_R1.fq.gz -p $WORK_DIR/cutadapt/cut_barc_praimers_cutIL_${file}_R2.fq.gz $WORK_DIR/cutadapt/cutIL_${file}_R1.fq.gz $WORK_DIR/cutadapt/cutIL_${file}_R2.fq.gz --overlap 20;
done
