for track in /datasets/DNA_TW_Loops/sorted/pseudoloops/* /datasets/DNA_TW_Loops/sorted/EncodeTracks/*; do {
	count='';
	count=$( bedtools intersect -a ${track} -b /datasets/DNA_TW_Loops/sorted/hg38.chrom.sizes.bed | bedtools summary -i /dev/stdin -g /datasets/DNA_TW_Loops/sorted/hg38.chrom.sizes | grep all | awk '{ getline; print $2, $3 }'; );
	echo "${track} ${count}" | tee -a /datasets/DNA_TW_Loops/sorted/lengths.csv;
} done
