
You need to download four supplemental files from GEO:
	1) scK27_4lanes_rc_at_25951_bipeaks.txt
	2) scK27_4lanes_rc_at_79100peaks_width10k.txt
	3) scK4_rc_at_25951_bipeaks.txt
	4) scH3K4me3_7798_cell_counts_at_WBCpeaks.txt

In terminal download them and put them to predata, then gunzip the .gz files:

	wget ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE139nnn/GSE139857/suppl/GSE139857%5FscH3K4me3%5F7798%5Fcell%5Fcounts%5Fat%5FWBCpeaks%2Etxt%2Egz
	wget ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE139nnn/GSE139857/suppl/GSE139857%5FscK27%5F4lanes%5Frc%5Fat%5F25951%5Fbipeaks%2Etxt%2Egz
	wget ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE139nnn/GSE139857/suppl/GSE139857%5FscK27%5F4lanes%5Frc%5Fat%5F79100peaks%5Fwidth10k%2Etxt%2Egz
	wget ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE139nnn/GSE139857/suppl/GSE139857%5FscK4%5Frc%5Fat%5F25951%5Fbipeaks%2Etxt%2Egz


files in  predata/:
	bivalent_domain25951_annot_gene.txt  ## 25951 bivalent domains with gene annotation
	bulk21_H3K27me3_at_bipeaks_counts.txt ## H3K27me3 ChIP-seq readcount at	25951 bivalent domains
	bulk72_H3K4me3_at_25951_bipeaks_counts.txt ## H3K4me3 ChIP-seq readcount at 25951 bivalent domains
	bulk_wbc_file_name.txt ## H3K4me3 ChIP-seq filename
	bulk_wbc_rc_52798_72_mat.txt ## H3K4me3 ChIP-seq readcount at 52798 H3K4me3 peaks
	combined_sicer_E100_peaks.sort.merge.txt ## 79100 H3K27me3 peaks
	Encode_wbcK27_rc_at_79100peaks_width10k.txt ## H3K27me3 ChIP-seq readcount at 79100 H3K27me3 peaks
	H3K4me3_peakname3_2.txt ## 52798 H3K4me3 peaks with filtering outrange peaks
	H3K4me3_peakname3.txt ## 52798 H3K4me3 peaks
	K4_K27_bivalent_domain.txt ##25951 bivalent domains
	scH3K4me3_7798_cell_counts_at_WBCpeaks.txt ##H3K4me3 single cell readcount at 52798 H3K4me3 peaks
	scK27_4lanes_rc_at_25951_bipeaks.txt ##H3K27me3 single cell readcount at 25951 bivalent domains
	scK27_4lanes_rc_at_79100peaks_width10k.txt ## H3K27me3 single cell readcount at 79100 H3K27me3 peaks
	scK4_rc_at_25951_bipeaks.txt ##H3K4me3 single cell readcount at 25951 bivalent domains
	wc_bulk21.bed.txt  ## H3K27me3 ChIP-seq depth
	wc_encode_uniq.txt  ## H3K4me3 ChIP-seq depth
	wc_K27_uniq.txt ## H3K27me3 single cell depth 
	wc_K4_uniq.txt ## H3K4me3 single cell depth
    	barcode_96.txt ## 96 barcodes


script and matlab files:
	1) open terminal, in terminal
	2) Type "script_donwload_fastq" to download data from GEO
	3) Type "sh script_rename_H3K4me3_fastq" to rename the fastq file
	4) Type "sh script_rename_H3K27me3_fastq" to rename the fastq file
	5) Type "sh script_mkdir_H3K4me3" to create H3K4me3 data directory
	6) Type "sh script_mkdir_H3K27me3" to create H3K27me3 data directory
	7) Type "sh script_mkdir_H3K27me3" to create H3K27me3 data directory
	8) Type "sh script_relocate_data" to re-locate the fastq data 
	9) Type "sh script_map" to map the H3K4me3 and H3K27me3 to hg18 (Note that Bowtie2, Samtools,
	 and Reference genome is required. You will need to change the path in the file 
	 where genome is located)
	10) Follow instructions in iscChIC_mapping_H3K4me3.m and run it to identify H3K4me3 single cells
	11) Follow instructions in iscChIC_mapping_H3K27me3.m and run it to identify H3K27me3 single cells
	12) Type "sh script_get_bivalent" to generate the bivalent domain files in predata/.
	13) You can run "iscChiC_seq_generate_rc_files_for_sc.r" in R to generate readcount files. 
	Or you can download the files from GEO using the links above.
	14)Run isChIC_seq_K4_and_K27_clustering_comparison.m for obtaining the plots of
		1) K4 single cell clustering and annotation
		2) K27 single cell clustering and annotation
		3) Matching between K4 and K27 clusters
		4) heatmap showing correlation between K4 CV and K27 CV

Acknowledgment:

AdvancedColormap.m is downloaded from https://www.mathworks.com/matlabcentral/fileexchange/41583-advancedcolormap created by Andriy Nych 
