# some paths ## directories results_dir='data/10xgenomics_PBMC_5k_motifs' read_dir="data/10xgenomics_PBMC_5k" seq_dir="data/genomes" ## input file_bed_ctcf=$read_dir'/ctcf_motifs_10e-6_rmsk.bed' file_bed_myc=$read_dir'/myc_motifs_10e-6_rmsk.bed' file_bed=$read_dir'/ctcf_motifs_10e-6_myc_motifs_10e-6_rmsk.bed' file_bam_open="$read_dir/atac_v1_pbmc_5k_possorted_filtered_30-84bp.bam" file_bai_open="$read_dir/atac_v1_pbmc_5k_possorted_filtered_30-84bp.bam.bai" file_bam_nucl="$read_dir/atac_v1_pbmc_5k_possorted_filtered_nucleosomes.bam" file_bai_nucl="$read_dir/atac_v1_pbmc_5k_possorted_filtered_nucleosomes.bam.bai" file_hg19="$seq_dir/hg19.fasta" file_rmsk="$seq_dir/hg19_rmsk.bed" mkdir -p $results_dir # merge 5000 CTCF peaks and 2000 myc peaks touch $file_bed shuf $file_bed_ctcf | head -n 2000 >> $file_bed shuf $file_bed_myc | head -n 2000 >> $file_bed # matrix creation ## sequences and sequenced repeat masked file_mat_seq="$results_dir/ctcf_motifs_10e-6_myc_motifs_10e-6_sequences_rmsk.mat" bin/SequenceMatrixCreator --bed $file_bed --fasta $file_hg19 --from -400 --to 400 > $file_mat_seq ## open chromatin around motifs for method in 'read_atac' do file_mat_open_1="$results_dir/ctcf_motifs_10e-6_myc_motifs_10e-6_open_bin1bp_"$method"_rmsk.mat" bin/CorrelationMatrixCreator --bed $file_bed --bam $file_bam_open --bai $file_bai_open --from -400 --to 400 --binSize 1 --method $method > $file_mat_open_1 done ## all nucleosomes around motifs for method in 'fragment_center' do ### mono nucleosomes file_mat_nucl_1="$results_dir/ctcf_motifs_10e-6_myc_motifs_10e-6_nucleosomes_bin1bp_"$method"_rmsk.mat" bin/CorrelationMatrixCreator --bed $file_bed --bam $file_bam_nucl --bai $file_bai_nucl --from -400 --to 400 --binSize 1 --method $method > $file_mat_nucl_1 done