WORK_DIR=/storage2/sasha_yan/2024_MGNC_Sept
cd $WORK_DIR;
declare -a samples=("4C-Ph-MEF-2-fixed1_S11")
for sample in "${samples[@]}"
do
python3 /storage2/sasha_yan/April-BGI-2024/drop_duplicates2.py $WORK_DIR/align_wo_mse_cutadapt/${sample}/${sample}_inside_plasmid_nla.sorted.bam $WORK_DIR/align_wo_mse_cutadapt/${sample}/${sample}_inside_plasmid_nla_nodup.txt
java -jar ~/picard.jar FilterSamReads I=$WORK_DIR/align_wo_mse_cutadapt/${sample}/${sample}_outside_plasmid_nla.sorted.bam O=$WORK_DIR/align_wo_mse_cutadapt/${sample}/${sample}_inside_plasmid_nla_nodup_sorted.bam READ_LIST_FILE=$WORK_DIR/align_wo_mse_cutadapt/${sample}/${sample}_inside_plasmid_nla_nodup.txt FILTER=includeReadList
samtools index $WORK_DIR/align_wo_mse_cutadapt/${sample}/${sample}_inside_plasmid_nla_nodup_sorted.bam
done