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

WORK_DIR=/mnt/scratch/ws/psbelokopytova/202208081122polya_data/4c_plasmid/2022-06-20/
THR=5
source activate nn_Polina_tf2
cd $WORK_DIR;
[ -d stat ] || mkdir compartments_stat;
#calculate coverage in compartments
#~/insulatory_index/miniconda3/envs/aquas_chipseq/bin/multiBamSummary BED-file -p $THR --outRawCounts $WORK_DIR/compartments_stat/BamSummary_NlaIII_cut_TaiI_100Kb.txt --BED ~/scratch/202208081122polya_data/4c_plasmid/compartments_stat/K562eigen_100Kb_modifyedByGC.bedGraph --bamfiles $WORK_DIR/align/C2/C2_pr_plasmid1_cutTaiI.sorted.bam $WORK_DIR/align/D1203_E1/D1203_E1_pr_plasmid1_cutTaiI.sorted.bam $WORK_DIR/align/K21/K21_pr_plasmid1_cmv_to_cmv_cutTaiI.sorted.bam $WORK_DIR/align/K21/K21_pr_plasmid1_empty_to_empty_cutTaiI.sorted.bam $WORK_DIR/align/K22/K22_pr_plasmid1_empty_to_empty_cutTaiI.sorted.bam $WORK_DIR/align/K22/K22_pr_plasmid1_cmv_to_cmv_cutTaiI.sorted.bam -o $WORK_DIR/compartments_stat/BamSummary_pr_plasmid1_cutTaiI.tgz
#calculate compartment statistics
python ~/scratch/202208081122polya_data/4c_plasmid/calculate_reads_in_compartments.py $WORK_DIR/compartments_stat/BamSummary_NlaIII_cut_TaiI_100Kb.txt $WORK_DIR/compartments_stat/comp_stat.txt

