Skip to content

Running CRUSH

JRowleyLab edited this page Dec 22, 2023 · 2 revisions

Required files

HIC

This can be either a .hic file (from juicer) or a .mcool file (from cooler).

SIZEFILE

This is a two-column tab-delimited file with chromosome names and sizes.

ABED

This file sets the initialization A states and can be any bed file with at least 3 tab-separated columns. We typically use genes, but use your imagination. For example, ChIP-seq peaks for an active mark should work well also.

BBED

This file sets the initialization B states. It can be a bed file or it can be a fasta file. It should simply correspond to something that correlates with the inactive compartment. If you specify a fasta file, we will use gc content to calculate. Feel free to save the gc content for future runs to avoid having to recalculate this.

PLEASE ENSURE THAT THE CHROMOSOME NAMES MATCH BETWEEN ALL OF YOUR FILES.

Example usage

CRUSH_v1.0 -i Myfile.hic -g hg38.sizes -a hg38_genes.bed -b hg38.fasta -r 1000 -cpu 23 -o output_prefix

In the above example, we specified the following
The input hic file with the -i option.
The chromosome size file with -g option.
The initialA file (in this case: gene annotations) with the -a option.
The initialB file (in this case: we will calculate gc content from the fasta file) with the -b option.
The finest resolution desired (e.g. 1000 bp) with the -r option.
The number of threads to use (e.g. 23) with the -cpu option.
How to name the output files with the -o option. 

CRUSH has other optional parameters. We do not recommend that you change these unless you are confident in what they do.

Help menu

CRUSH_v1.0 --help

usage : CRUSH_vX.X -i HIC  -g SIZEFILE -a ABED -b BBED | FASTA -r FINERESOLUTION [-cpu CPU] [-w WINDOW] [-h]
Use option -h|--help for more information

CRUSH will create a temporary folder in your current directory, so make sure you have write access to your current directory.

-----------------------------------------
OPTIONS:
-h|--help                :  Display this help menu

--------------------------REQUIRED PARAMETERS------------------
-i|--hic                 :  Input .hic/.cooler/.mcool file by specifying the path. (e.g., '/path/to/ file.hic or file.mcool or file.cooler)
-g|--genomesize              :  Specify path to a chromosome size file with two columns corresponding to chromosome and size respectively.
-a|--initialA                :  Specify path to a bed file with the regions for initializing A. For example, gene annotations e.g. hg19genes.bed.
-b|--initialB                :  Specify path to either a fasta file or to a bed file for initializing B. If you specify a fasta file, we will calculate intialB from gc content.
-r|--res                 :  Resolution desired.
---------------

--------------------------OPTIONAL PARAMETERS------------------
-o|--outpre              :  Set this if you want to specify a prefix for the output files
-c|--cpu               :  Set the value for cpu number of threads to use. Default is 1.
-n|--no-merge            :  Set this option to 1 to keep each resolution as a separate output file. Default is to merge in a way that provides maximum resolution.
-A|--adjustment          :  Set this option to 1 to include a adjustment of CRUSH values at the end. This adjustment shifts values based on any internal skewing of the data. Do not set this if using CRUSH to compare between two Hi-C maps.
-d|--distance            :  Using this option will filter out the distance next to the diagonal. Default is 0 which considers everything.
-u|--upperlim            :  The upperlimit of the distance away from the diagonal to consider. Default is 0 so that it considers the whole chromosome.
-t|--trackline           :  Set to 0 if you want to disable printing a bedgraph trackline header.
-T|--threshold           :  Distance normalized threshold to filter out extreme outliers.
-k|--keeptracks          :  Set to 1 in order to keep separate A and B tracks for the probability of interacting with bed file vs other regions.
-l|--lowerthresh         :  Set the value for lowerthresh.
-w|--window              :  Set to perform a sliding window average of the scores at individual resolutions. Default is to calculate the appropriate window based on sequencing depth. Set to 1 to remove sliding window.
-v|--verbose             :  Set to 1 to enable verbose mode showing extensive messages.
-S|--switch              :  Set this option to 0 for bypassing re-initialization. Default is 1.
-C|--cleanup             :  Set the value to 0 to keep the temporary files. Default is 1.
-E|--endZ                :  Set the value for endZ. 
-x|--exclbed             :  Set the value for exclbed.
-q|--qvalue              :  Set the qvalue threshold. default 0.05. Set to 0 to not perform qvalue filtering. The qvalues will be reported as a separate track regardless.
-u|--use                 :  Whether to use of overwrite existing GI tracks previously calculated at individual resolutions. Set this option to u to use previous calculations. Default is to recalculate. This option is useful for merging resolutions.
-f|--tmpfolder         :  Set this if you want to name the temporary folder yourself. Make sure it doesn't already exist in your current working directory. Default is to name it CRUSHtmp with a random number.
-m|--maxres             : Set this to the coarsest resolution you want to consider. Default is to check every resolution present in the .hic or .mcool file between 2500000 and your desired resolution to inform each other.

Explanation of optional parameters

Use -o to specify the naming scheme for the output files.
Use -c to specify the number of threads to use. We recommend 1 per chromosome.
Use -n if you don't want one resolution to inform the next. We highly recommend to not change this from the default option.
Use -A if you want to adjust the final values to have equal A and B. We highly recommend to not change this from the default option (don't shift).
Use -d if you want to ignore short-range interactions. Thanks to our distance normalization scheme, we find it useful to keep them.
Use -u if you want to ignore long-range interactions. This can be useful for some maps if you notice excessive noise or absence of compartments at long distances.
Use -t if you want to output a bedgraph without any automatic coloring. 
Use -T to set an upper distance-normalized contact threshold. This can be useful to throwout outliers.
Use -k to keep separate tracks for each resolution (coming soon...)
Use -l if you want to remove contacts below a certain threshold.
Use -w to set a sliding window when using one resolution to inform the next.
Use -v to print more messages during the calculation.
Use -S to bypass reinitializing the coarsest bin. By default, CRUSH will run the coarsest bin twice so that it can recalculate scores after correcting the initialization states.
Use -C to keep the temporary directory. E.g. set -C 0 to not cleanup.
Use -E if you want to z-score the final calls. E.g. set -E 1 to enable.
Use -x if you want to provide a bed file with regions to ignore. E.g. -x blacklistregions.bed.
Use -q if you want to choose a different q-value threshold.
Use -u if you saved the temporary directory and simply want to redo the calculation at a different resolution (not recommended).
Use -f if you want to specify the name of the temporary directory.
Use -m if you want to change the coarsest resolution that CRUSH examines.




Clone this wiki locally