Introduction
Welcome to cLoops2! This is a comprehensive analysis tool for 3D genomic interaction data, building upon our previous work cLoops.
cLoops2 has evolved from simple loop-calling based on assumption-free clustering to a full suite of analysis tools for 3D genomic interaction data. It has been specifically optimized for data types such as Hi-TrAC/Trac-looping/ChIA-PET/HiChIP, where interactions are enriched over the genome through experimental steps. cLoops2 also supports Hi-C-like data. The improvements from cLoops to cLoops2 are designed to address challenges in achieving higher resolutions with next-generation genome architecture mapping technologies.
cLoops2 is designed with reference to bedtools and Samtools for command-line style programming. If you have experience with these tools, you will find cLoops2 easy and efficient to use, and you can seamlessly combine commands and integrate them as steps in your processing pipeline.
Please refer to our Hi-TrAC method manuscript bioRxiv official version, Hi-TrAC domain-centric analysis manuscript bioRxiv official version, and cLoops2 manuscript bioRxiv official version for what cLoops2 can do and show.
Table of Contents
Citation
If you use cLoops2 in your research (the idea, the algorithm, the analysis scripts or the supplemental data), please give us a star on the GitHub repo page and cite our paper as follows:
Install
1. Easy way through pip for stable version
Python3 is required.
pip install cLoops2
2. Install from source with test data for latest version
cLoops2 is written purely in Python3 (cLoops was written in Python2). If you are familiar with conda, cLoops2 can be installed easily with the following Linux shell commands (also tested well in win10 ubuntu subsystem, MacOS).
# for most updated code, or download the release version
git clone --depth=1 https://github.com/YaqiangCao/cLoops2
cd cLoops2
conda create --name cLoops2 --file cLoops2_env.yaml
conda activate cLoops2
python3 setup.py install
Necessary Python3 third-party packages are listed below, all of which can be installed through conda. If you like to install cLoops2 through the old school way python setup.py install, please install the 3rd dependencies first.
tqdm
numpy
scipy
pandas
scikit-learn
seaborn
pyBigWig
matplotlib
joblib
networkx
After installation, whenever you want to run cLoops2, just activate the environment with conda: conda activate cLoops2.
Happy peak/loop-calling and have fun exploring all the other kinds of analyses.
Basic Usage and Quick Guide
Example data background introduction
Example data for testing is available at cLoops2/example/data. The BEDPE files were from Hi-TrAC experiments mapped to hg38 for chromosome 21 in GM12878 and K562 cell lines, two biological replicates for each cell line. Only intra-chromosomal PETs were kept. Raw FASTQ reads were processed by tracPre2.py.
For other kinds of 3D genomic interaction data such as ChIA-PET, Hi-C, and HiChIP, cLoops2 can also start with provided BEDPE files.
The following example command lines were also recorded in cLoops2/example/test_run/run.sh, which can be used to test the main programs of cLoops2 after installation.
cLoops2 qc -f ../data/GM_Trac1_hg38_chr21_partaa.bedpe.gz,../data/GM_Trac1_hg38_chr21_partab.bedpe.gz -o test -p 2
Please note, in cLoops2, multiple files/directories can be assigned as input with the separation of the comma, please do not leave blanks between names. The majority of cLoops2 analysis modules can be run in a parallel way with the option of -p. Most of them will generate a cLoops2.log file recording the program parameters and important messages for later review.
The informative output is a .txt file with annotation of information as follows.
| Sample |
TotalPETs |
UniquePETs |
Redundancy |
IntraChromosomalPETs(cis) |
cisRatio |
InterChromosomalPETs(trans) |
transRatio |
meanDistance |
closePETs(distance<=1kb) |
closeRatio |
middlePETs(1kb<distance<=10kb) |
middleRatio |
distalPETs(distance>10kb) |
distalRatio |
| GM_HiTrac_bio1 |
906506 |
901589 |
0.005424123 |
655640 |
0.727204968 |
245949 |
0.272795032 |
522978.0929 |
138201 |
0.210787932 |
274800 |
0.419132451 |
242639 |
0.370079617 |
| GM_HiTrac_bio2 |
665759 |
662197 |
0.005350284 |
506058 |
0.76421065 |
156139 |
0.23578935 |
501104.2879 |
104360 |
0.206221421 |
216640 |
0.428093223 |
185058 |
0.365685356 |
| K562_HiTrac_bio1 |
596886 |
591215 |
0.009500977 |
474746 |
0.8030006 |
116469 |
0.1969994 |
314420.4126 |
115360 |
0.242993095 |
226568 |
0.477240461 |
132818 |
0.279766444 |
| K562_HiTrac_bio2 |
413818 |
410415 |
0.008223422 |
326743 |
0.796128309 |
83672 |
0.203871691 |
327855.2136 |
68571 |
0.209862185 |
162132 |
0.496206499 |
96040 |
0.293931316 |
Routine analysis step 2: pre-process BEDPE file(s) into cLoops2 data
#get directory seperately for GM12878, only target chromosome chr21
cLoops2 pre -f ../data/GM_HiTrac_bio1.bedpe.gz -o gm_bio1 -c chr21
cLoops2 pre -f ../data/GM_HiTrac_bio2.bedpe.gz -o gm_bio2 -c chr21
#get the combined data for GM12878
cLoops2 pre -f ../data/GM_HiTrac_bio1.bedpe.gz,../data/GM_HiTrac_bio2.bedpe.gz -o gm -c chr21
#get the directory seperately for K562 first
cLoops2 pre -f ../data/K562_HiTrac_bio1.bedpe.gz -o k562_bio1 -c chr21
cLoops2 pre -f ../data/K562_HiTrac_bio2.bedpe.gz -o k562_bio2 -c chr21
#then combine the data, only keep 1 PET for the same position, default the same to cLoops2 pre
cLoops2 combine -ds k562_bio1,k562_bio2 -o k562 -keep 1
The output directory contains one .json file for the basic PET statistics and .ixy files, which are used to call peaks, loops, or any analysis implemented in cLoops2.
For data backup/sharing purposes, the directory can be saved as a .tar.gz file through tar command.
If you move the directory or change the files in the directory, please run cLoops2 update to update the information of petMeta.json, as all ixy files were recorded as absolute paths.
cLoops2 estRes -d gm -o gm -bs 5000,1000,200 -p 10
cLoops2 estRes -d k562 -o k562 -bs 5000,1000,200 -p 10
This step is not needed for peak-calling 1D data such as ChIP-seq or ChIC-seq.
We prefer to use the highest resolution with >=50% PETs (solid lines) for filtering singletons, visualization, or calling loops. Dash lines show the bins with only singleton PETs, evenly distributed so increased stably, higher possibilities of noises.
The main output is a figure as follows.
Routine analysis step 4: estimate significant interaction distance limitation
cLoops2 estDis -d gm -o gm -bs 1000 -p 10 -plot
The main output is a figure as follows. The plot indicates Hi-TrAC data may detect significant interactions within 1MB.
Routine analysis step 5: estimate similarities/consistency among replicates
cLoops2 estSim -ds gm_bio1,gm_bio2,gm,k562_bio1,k562_bio2,k562 -bs 1000 -plot -p 6 -o test_step4
Routine analysis step 6: call peaks
Call peaks can be run on raw data or filtered data (through cLoops2 filterPETs), only using PETs within 1kb. Smaller eps, sharper peaks. Run as PETs or split PETs as single-end reads.
cLoops2 callPeaks -d gm -o gm -eps 50,100 -minPts 10 -mcut 1000 -split
The main output is a _peaks.txt file, which contains all important information for peaks.
Routine analysis step 7: show aggregated peaks
Check global peaks width and enrichment through aggregation plot. For Hi-TrAC data, we expect high enrichment of signals at peaks.
cLoops2 agg -d gm -peaks gm_peaks.bed -o gm -peak_ext 2500 -peak_bins 200 -peak_norm -skipZeros
Routine analysis step 8: call intra-chromosomal loops
Call loops can be run on raw data or filtered data.
#call intra-chromosomal loops, filtered PETs can be used to show clear view of loops, or futhur to call loops
cLoops2 callLoops -d gm -o gm -eps 200,500,1000 -minPts 10 -w -j
The main output is a _loops.txt file, which contains all important information for loops.
We implemented a trans-chromosomal-loops-caller in cLoops callLoops with a parameter of -trans. However, we do not recommend running with this option for Hi-TrAC data.
With the options of -w -j, loops can be output as the input of the washU genome browser and juicebox.
If too many close loops are called, with the option of -max_cut, the maximal distance cutoff for self-ligation PETs vs inter-ligation PETs will be used to filter loops. Also, with the option of -cut, only long-distance PETs will be used to call loops.
With the option of -hic, callLoops will not check the peak-like feature for anchors, more compatible for Hi-C like data.
Because in cLoops2 the backend clustering algorithm is different from that of cLoops, so even the same parameter may have different results.
Routine analysis step 9: show aggregated loops
cLoops2 agg -d gm -o gm -loops gm_loops.txt -bws ../data/GM12878_ATAC_chr21.bw,../data/GM12878_CTCF_chr21.bw -1D -loop_norm
For Hi-TrAC, we expect the aggregated loops pattern as above:
- highly enriched signal at the center for loop regions;
- relative higher signal from the two anchors, as for Hi-TrAC, anchors are expected to be peaks in the 1D.
Routine analysis step 10: call domains
cLoops2 callDomains -d gm -o gm -bs 5000 -ws 100000,250000
The main output is a _domains.txt file.
For Hi-TrAC, called domains are all activate domains. There is a -hic option for Hi-C like data.
Routine analysis step 11: show aggregated domains
#convert the output segregation score from bedGraph file to bigWig
bedGraphToBigWig gm_domains_SS_binSize5.0k_winSize100.0k.bdg ../../data/hg38.chrom.sizes gm_domains_SS_bs5k_ws100k.bw
bedGraphToBigWig gm_domains_SS_binSize5.0k_winSize250.0k.bdg ../../data/hg38.chrom.sizes gm_domains_SS_bs5k_ws250k.bw
cLoops2 agg -d gm -o gm -domains gm_domains.bed -bws ../data/GM12878_CTCF_chr21.bw,gm_domains_SS_bs5k_ws100k.bw,gm_domains_SS_bs5k_ws250k.bw -1D
For Hi-TrAC, we expect the aggregated domains pattern as above (maybe better clear if there are more domains):
- clear segregation from up-and down-stream;
- enriched CTCF/Cohesin bindings at boundaries;
- higher 1D signal than nearby regions;
- small domains.
Routine analysis step 12: visualization
cLoops2 plot can show the interaction contact matrix (observed, observed/expected, correlation) at any resolution, with genes (-gtf option), 1D annotations (-bws option), domains (-dominas option), loops (-loops option).
a.show big regions such as domains
cLoops2 plot -f ./gm/chr21-chr21.ixy -o gm_domain_example -bs 5000 -start 35830000 -end 36950000 -domains gm_domains.bed -log -bws ../data/GM12878_CTCF_chr21.bw -1D -corr
b.show small regions such as peaks and loops
#show enhancer-promoter loops
cLoops2 plot -f gm/chr21-chr21.ixy -o gm_example -bs 500 -start 38752604 -end 38839334 -triu -bw ../data/GM12878_ATAC_chr21.bw,../data/GM12878_CTCF_chr21.bw -1D -loops gm_loops.txt -beds ../data/GM12878_RoadMap_hg38_Enh_chr21.bed,../data/GM12878_RoadMap_hg38_Tss_chr21.bed,gm_peaks.bed -m obs -log -gtf ../data/gencode_v30_chr21.gtf -vmax 1
The raw data can be further filtered by loops (or peaks) to show much better view.
cLoops2 filterPETs -d gm -loops gm_loops.txt -o gm_filtered
cLoops2 plot -f gm_filtered/chr21-chr21.ixy -o gm_filtered_example -bs 500 -start 38752604 -end 38839334 -triu -loops gm_loops.txt -log -1D
For close loops, we also recommend to use -arch mode, to show raw PETs as arches for called loops. Better for checking the anchor locations and interaction densities compared to nearby backgroud.
cLoops2 plot -f gm_filtered/chr21-chr21.ixy -o gm_example -start 46228500 -end 46290000 -1D -loops gm_loops.txt -arch -aw 0.05
Routine analysis step 13: call differential enriched loops for two conditions
#a. sampling PETs to same/similar depth to call loops with same parameters
cLoops2 samplePETs -d gm -o gm_samp -tot 780000
cLoops2 samplePETs -d k562 -o k562_samp -tot 780000
#b. call loops with same parameters
cLoops2 callLoops -d gm_samp -o gm_samp -eps 200,500,1000 -minPts 10 -w -j
cLoops2 callLoops -d k562_samp -o k562_samp -eps 200,500,1000 -minPts 10 -w -j
#c. call differentially enriched loops
cLoops2 callDiffLoops -tloop gm_samp_loops.txt -td gm_samp -cloop k562_samp_loops.txt -cd k562_samp -o gm_vs_k562 -j -w
The main output is a _dloops.txt file with three figures. The most import figure shows the aggregated features of called common and specific loops.
Routine analysis step 14: convert cLoops2 data to others
More formats will be added if actually needed.
1. to BED file
cLoops2 dump -d gm -o gm -bed
2. to BEDPE file
cLoops2 dump -d gm -o gm -bedpe
3. interaction data to bedGraph file
cLoops2 dump -d gm -o gm -bdg
4. ChIP-seq -like data to bedGraph file
cLoops2 dump -d gm -o gm -bdg_pe
5. to washU genome browser long-range interaction track
cLoops2 dump -d gm -o gm -washU
cLoops2 dump -d gm -o gm -hic -hic_org hg38 -hic_res 200000,25000,5000
cLoops2 dump -d gm -mat -o gm -mat_res 10000 -mat_chrom chr21-chr21 -mat_start 36000000 -mat_end 40000000 -log -norm -corr
Routine analysis step 15: quantify features from cLoops2 data
1. quantify GM12878 peaks in K562 data
cLoops2 quant -d k562 -peaks gm_peaks.bed -o k562_gm
2. quantify GM12878 loops in K562 data
cLoops2 quant -d k562 -loops gm_loops.txt -o k562_gm
3. quantify GM12878 domains in K562 data
#key parameteres of -bs and -ws from cLoops2 callDomains needed
cLoops2 quant -d k562 -domains gm_domains.txt -o k562_gm -domain_bs 5000 -domain_ws 100000
Routine analysis step 16: montage analysis of interactions among distal genomic regions
cLoops2 montage -f ./gm_samp/chr21-chr21.ixy -bed ../data/runx1.bed -o gm_runx1_all -ext 2 -simple -ppmw 0.05 -vmax 500
cLoops2 montage -f ./k562_samp/chr21-chr21.ixy -bed ../data/runx1.bed -o k562_runx1_all -ext 2 -simple -ppmw 0.05 -vmax 500
| GM12878 |
K562 |
 |
 |
cLoops2 montage -f ./gm_samp/chr21-chr21.ixy -bed ../data/runx1.bed -o gm_runx1_vp -ext 2 -simple -ppmw 0.05 -vmax 500 -vp Promoter,E19
cLoops2 montage -f ./k562_samp/chr21-chr21.ixy -bed ../data/runx1.bed -o k562_runx1_vp -ext 2 -simple -ppmw 0.05 -vmax 500 -vp Promoter,E19
| GM12878 |
K562 |
 |
 |
Routine analysis step 17: annotate loops to genes and find a gene’s all interacting enhancers
cLoops2 anaLoops -loop gm_loops.txt -o gm_loops -gtf ../data/gencode_v30_chr21.gtf -net
There will be 5 files for the -gtf -net option as following.
- _LoopsGtfAno.txt file for main annotations. Loop anchors were assigned to gene promoters and enhancers based on distance. If only run with -gtf option, this file is the only result.
- _mergedAnchors.txt file for merged anchors. There will also be a _mergedAnchors.bed file converted as bed file for convenience loading to genome browser.
- _loop2anchors.txt file for loops to merged anchors.
- _targets.txt file for every promoter’s interacting enhancer and promoter. If there are >=2 enhancers/promoters linked, HITS algorithm will be used to find the hubs. Montage analysis can be followed to show interactions for a specific promoter.
- _ep_net.sif: SIF file for interactions networks of annotated enhancers and promoters, can be loaded in Cytoscape for visualization. Can be further used to analyze the topological structures of enhancers and promoters.
For example, visualization of the largest connected components for annotated enhancers and promoters.
#just use to show network example, not very pretty one.
#Can be further imporoved, for example, node size can show the accessibility level.
python plotNetExample.py
cLoops2 Main Functions
Run cLoops2 or cLoops2 -h can show the main functions of cLoops2 with short descriptions and examples.
An enhanced, accurate and flexible peak/domain/loop-calling and analysis tool
for 3D genomic interaction data.
Use cLoops2 sub-command -h to see detail options and examples for sub-commands.
Available sub-commands are:
qc: quality control of BEDPE files before analysis.
pre: preprocess input BEDPE files into cLoops2 data.
update: update cLoops2 data files locations.
combine: combine multiple cLoops2 data directories.
dump: convert cLoops2 data files to others (BEDPE, HIC, washU, bedGraph and
contact matrix)
estEps: estimate eps using Gaussian mixture models or k-distance plot.
estRes: estimate reasonable contact matrix resolution based on signal
enrichment.
estDis: estimate significant interactions distance range.
estSat: estimate sequencing saturation based on contact matrix.
estSim: estimate similarities among samples based on contact matrix.
filterPETs: filter PETs based on peaks, loops, singleton mode or knn mode.
samplePETs: sample PETs according to specific target size.
callPeaks: call peaks for ChIP-seq, ATAC-seq, ChIC-seq and CUT&Tag or the
3D genomic data such as Trac-looping, Hi-TrAC, HiChIP and more.
callLoops: call loops for 3D genomic data.
callDiffLoops: call differentially enriched loops for two datasets.
callDomains: call domains for 3D genomic data.
plot: plot the interaction matrix, genes, view point plot, 1D tracks,
peaks, loops and domains for a specific region.
montage: analysis of specific regions, producing Westworld Season 3 -like
Rehoboam plot.
agg: aggregated feature analysis and plots, features can be peaks, view
points, loops and domains.
quant: quantify peaks, loops and domains.
anaLoops: annotate loops for target genes.
findTargets: find target genes of genomic regions through networks from
anaLoops.
Examples:
cLoops2 qc -f trac_rep1.bedpe.gz,trac_rep2.bedpe,trac_rep3.bedpe.gz \
-o trac_stat -p 3
cLoops2 pre -f ../test_GM12878_chr21_trac.bedpe -o trac
cLoops2 update -d ./trac
cLoops2 combine -ds ./trac1,./trac2,./trac3 -o trac_combined -keep 1
cLoops2 dump -d ./trac -o trac -hic
cLoops2 estEps -d trac -o trac_estEps_gmm -p 10 -method gmm
cLoops2 estRes -d trac -o trac_estRes -p 10 -bs 25000,5000,1000,200
cLoops2 estDis -d trac -o trac -plot -bs 1000
cLoops2 estSim -ds Trac1,Trac2 -o trac_sim -p 10 -bs 2000 -m pcc -plot
cLoops2 filterPETs -d trac -peaks trac_peaks.bed -o trac_peaksFiltered -p 10
cLoops2 samplePETs -d trac -o trac_sampled -t 5000000 -p 10
cLoops2 callPeaks -d H3K4me3_ChIC -bgd IgG_ChIC -o H3K4me3_cLoops2 -eps 150 \
-minPts 10
cLoops2 callLoops -d Trac -eps 200,500,1000 -minPts 3 -filter -o Trac -w -j \
-cut 2000
cLoops2 callLoops -d HiC -eps 1000,5000,10000 -minPts 10,20,50,100 -w -j \
-trans -o HiC_trans
cLoops2 callDiffLoops -tloop target_loop.txt -cloop control_loop.txt \
-td ./target -cd ./control -o target_diff
cLoops2 callDomains -d trac -o trac -bs 10000 -ws 200000
cLoops2 plot -f test/chr21-chr21.ixy -o test -bs 500 -start 34840000 \
-end 34895000 -triu -1D -loop test_loops.txt -log \
-gtf hg38.gtf -bws ctcf.bw -beds enhancer.bed
cLoops2 montage -f test/chr21-chr21.ixy -o test -bed test.bed
cLoops2 agg -d trac -loops trac.loop -peaks trac_peaks.bed \
-domains hic_domains.bed -bws CTCF.bw,ATAC.bw -p 20 -o trac
cLoops2 quant -d trac -peaks trac_peaks.bed -loops trac.loop \
-domains trac_domain.txt -p 20 -o trac
cLoops2 anaLoops -loops test_loop.txt -gtf gene.gtf -net -o test
cLoops2 findTargets -net test_ep_net.sif -tg test_targets.txt \
-bed GWAS.bed -o test
More usages and examples are shown when run with cLoops2 sub-command -h.
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
Bug reports are welcome and can be put as issue at github repo or sent to
[email protected] or [email protected]. Thank you.
1. Quality control for BEDPE files
Run cLoops2 qc -h to see details.
Get the basic quality control statistical information from interaction BEDPE
files.
Example:
cLoops2 qc -f trac_rep1.bedpe.gz,trac_rep2.bedpe,trac_rep3.bedpe.gz -p 3 \
-o trac_stat
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-f FNIN Input BEDPE file(s), .bedpe and .bedpe.gz are both suitable. Multiple
samples can be assigned as -f A.bedpe.gz,B.bedpe.gz,C.bedpe.gz.
2. Pre-process BEDPE into cLoops2 data
Run cLoops2 pre -h to see details.
Preprocess mapped PETs into cLoops2 data files.
Support input file formats:
BEDPE: https://bedtools.readthedocs.io/en/latest/content/general-usage.html
PAIRS: https://pairtools.readthedocs.io/en/latest/formats.html#pairs
The output directory contains one .json file for the basic statistics of PETs
information and .ixy files which are coordinates for every PET. The coordinate
files will be used to call peaks, loops or any other analyses implemented in
cLoops2. For data backup/sharing purposes, the directory can be saved as
.tar.gz file through tar. If changed and moved location, run
***cLoops2 update -d*** to update.
Examples:
1. keep high quality PETs of chromosome chr21
cLoops2 pre -f trac_rep1.bepee.gz,trac_rep2.bedpe.gz -o trac -c chr21
2. keep all cis PETs that have distance > 1kb
cLoops2 pre -f trac_rep1.bedpe.gz,trac_rep2.bedpe.gz -o trac -mapq 0
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-f FNIN Input BEDPE or PAIR file(s), .bedpe and .bedpe.gz are both suitable.
Replicates or multiple samples can be assigned as -f A.bedpe.gz,
B.bedpe.gz,C.bedpe.gz to get merged PETs.
-c CHROMS Argument to process limited set of chromosomes, specify it as chr1,
chr2,chr3. Use this option to filter reads from such as
chr22_KI270876v1. The default setting is to use the entire set of
chromosomes from the data.
-trans Whether to parse trans- (inter-chromosomal) PETs. The default is to
ignore trans-PETs. Set this flag to pre-process all PETs.
-mapq MAPQ MAPQ cutoff to filter raw PETs, default is >=10. This option is not
valid when input is .pairs file.
-format {bedpe,pairs}
cLoops2 currently supports BEDPE and PAIRs file format. Default is bedpe.
3. Update cLoops2 data directory
Run cLoops2 update -h to see details.
Update cLoops2 data files generated by **cLoops2 pre**.
In the **cLoops2 pre** output directory, there is a .json file annotated with
the .ixy **absolute paths** and other information. So if the directory is
moved, or some .ixy files are removed or changed, this command is needed to
update the paths, otherwise the other analysis modules will not work.
Example:
cLoops2 update -d ./Trac
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
4. Convert cLoops2 data to others
Run cLoops2 dump -h to see details.
Convert cLoops2 data files to other types. Currently supports BED file,BEDPE
file, HIC file, washU long-range track, 1D signal bedGraph file, matrix txt
file and virtual 4C signal bedGraph file.
Converting cLoops2 data to .hic file needs "juicer_tools pre" in the command
line enviroment.
Converting cLoops2 data to legacy washU browser long-range track needs bgzip
and tabix. Format reference: http://wiki.wubrowse.org/Long-range.
Converting cLoops2 data to UCSC bigInteract track needs bedToBigBed. Format
reference: https://genome.ucsc.edu/goldenPath/help/interact.html.
Converting cLoops2 data to bedGraph track will normalize value as RPM
(reads per million). Run with -bdg_pe flag for 1D data such as ChIC-seq,
ChIP-seq and ATAC-seq.
Converting cLoops2 data to matrix txt file will need specific resolution.
The output txt file can be loaded in TreeView for visualization or further
analysis.
Converting cLoops2 data to virtual 4C signal will need the region of view point
such as a specific promoter or enhancer. The output .bdg file can be loaded in
IGV or other genome browser for visualization.
Examples:
1. convert cLoops2 data to single-end .bed file fo usage of BEDtools or
MACS2 for peak-calling with close PETs
cLoops2 dump -d trac -o trac -bed -mcut 1000
2. convert cLoops2 data to .bedpe file for usage of BEDtools, only keep
PETs distance >1kb and < 1Mb
cLoops2 dump -d trac -o trac -bedpe -bedpe_ext -cut 1000 -mcut 1000000
3. convert cLoops2 data to .hic file to load in juicebox
cLoops2 dump -d trac -o trac -hic -hic_org hg38 \
-hic_res 200000,20000,5000
4. convert cLoops2 data to washU long-range track file, only keep PETs
distance > 1kb
cLoops2 dump -d trac -o trac -washU -washU_ext 50 -cut 1000
5. convert cLoops2 data to UCSC bigInteract track file
cLoops2 dump -d trac -o trac -ucsc -ucsc_cs ./hg38.chrom.sizes
6. convert interacting cLoops2 data to bedGraph file with all PETs
cLoops2 dump -d trac -o trac -bdg -bdg_ext 100
7. convert 1D cLoops2 data (such as ChIC-seq/ChIP-seq/ATAC-seq) to bedGraph
file
cLoops2 dump -d trac -o trac -bdg -pe
8. convert 3D cLoops2 data (such as Trac-looping) to bedGraph file for peaks
cLoops2 dump -d trac -o trac -bdg -mcut 1000
9. convert one region in chr21 to contact matrix correlation matrix txt file
cLoops2 dump -d test -mat -o test -mat_res 10000 \
-mat_chrom chr21-chr21 -mat_start 36000000 \
-mat_end 40000000 -log -corr
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-bed Convert data to single-end BED file.
-bed_ext BED_EXT Extension from the center of the read to both ends for BED file.
Default is 50.
-bedpe Convert data to BEDPE file.
-bedpe_ext BEDPE_EXT Extension from the center of the PET to both ends for BEDPE file.
Default is 50.
-hic Convert data to .hic file.
-hic_org HIC_ORG Organism required to generate .hic file,default is hg38. If the
organism is not available, assign a chrom.size file.
-hic_res HIC_RES Resolutions used to generate .hic file. Default is 1000,5000,25000,
50000,100000,200000.
-washU Convert data to legacy washU browser long-range track.
-washU_ext WASHU_EXT Extension from the center of the PET to both ends for washU track.
Default is 50.
-ucsc Convert data to UCSC bigInteract file track.
-ucsc_ext UCSC_EXT Extension from the center of the PET to both ends for ucsc
track. Default is 50.
-ucsc_cs UCSC_CS A chrom.sizes file. Can be obtained through fetchChromSizese.
Required for -ucsc option.
-bdg Convert data to 1D bedGraph track file.
-bdg_ext BDG_EXT Extension from the center of the PET to both ends for
bedGraph track. Default is 50.
-bdg_pe When converting to bedGraph, argument determines whether to treat PETs
as ChIP-seq, ChIC-seq or ATAC-seq paired-end libraries. Default is not.
PETs are treated as single-end library for interacting data.
-mat Convert data to matrix txt file with required resolution.
-mat_res MAT_RES Bin size/matrix resolution (bp) to generate the contact matrix.
Default is 5000 bp.
-mat_chrom CHROM The chrom-chrom set will be processed. Specify it as chr1-chr1.
-mat_start START Start genomic coordinate for the target region. Default will be the
smallest coordinate from specified chrom-chrom set.
-mat_end END End genomic coordinate for the target region. Default will be the
largest coordinate from specified chrom-chrom set.
-log Whether to log transform the matrix. Default is not.
-m {obs,obs/exp} The type of matrix, observed matrix or observed/expected matrix,
expected matrix will be generated by shuffling PETs. Default is
observed.
-corr Whether to get the correlation matrix. Default is not.
-norm Whether to normalize the matrix with z-score. Default is not.
-virtual4C Convert data to virtual 4C signal for a specific view point.
-virtual4C_chrom VIRTUAL4C_CHROM
The chrom-chrom set for -virtual4C. Specify it as chr1-chr1.
-virtual4C_start VIRTUAL4C_START
Start genomic coordinate for the target region for -virtual4C. Default
will be the smallest coordinate from specified chrom-chrom set.
-virtual4C_end VIRTUAL4C_END
End genomic coordinate for the target region for -virtual4C. Default
will be the biggest coordinate from specified chrom-chrom set.
-virtual4C_viewStart VIRTUAL4C_VIEWSTART
Start genomic coordinate for the view point start region, only valid
when -vitrutal4C is set, should >=start and <=end.
-virtual4C_viewEnd VIRTUAL4C_VIEWEND
End genomic coordinate for the view point end region, only valid
when -vitrutal4C is set, should >=start and <=end.
5. Estimate eps
Run cLoops2 estEps -h to see details.
Estimate key parameter eps.
Two methods are implemented: 1) unsupervised Gaussian mixture model (gmm), and
2) k-distance plot (k-dis,-k needed). Gmm is based on the assumption that PETs
can be classified into self-ligation (peaks) and inter-ligation (loops). K-dis
is based on the k-nearest neighbors distance distribution to find the "knee",
which is where the distance (eps) between neighbors has a sharp increase along
the k-distance curve. K-dis is the traditional approach literatures, but it is
much more time consuming than gmm, and maybe only fit to small cases. If both
methods do not give nice plots, please turn to the empirical parameters you
like, such as 100,200 for ChIP-seq -like data, 5000,1000 for Hi-C and etc.
Examples:
1. estimate eps with Gaussian mixture model
cLoops2 estEps -d trac -o trac_estEps_gmm -p 10 -method gmm
2. estimate eps with k-nearest neighbors distance distribution
cLoops2 estEps -d trac -o trac_estEps_kdis -p 10 -method k-dis -k 5
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-fixy FIXY Assign the .ixy file to estimate eps inside of the whole directory
generated by cLoops2 pre. For very large data, especially Hi-C, this
option is recommended for chr1 (or the smaller one) to save time.
-k KNN The k-nearest neighbors used to draw the k-distance plot. Default is 0
(not running), set this when -method k-dis. Suggested 5 for
ChIA-PET/Trac-looping data, 20 or 30 for Hi-C like data.
-method {gmm,k-dis} Two methods can be chosen to estimate eps. Default is Gmm. See above
for difference of the methods.
Run cLoops2 estRes -h to see details.
Estimate reasonable genome-wide contact matrix resolution based on signal
enrichment.
PETs will be assigned to contact matrix bins according to input resolution. A
bin is marked as [nx,ny], and a PET is assigned to a bin by nx = int((x-s)/bs),
ny = int((y-s)/bs), where s is the minimal coordinate for all PETs and bs is
the bin size. Self-interaction bins (nx=ny) will be ignored. The bins only
containing singleton PETs are assumed as noise.
The output is a PDF plot, for each resolution, a line is separated into two
parts: 1) dash line indicated linear increased trend of singleton PETs/bins; 2)
solid thicker line indicated non-linear increased trend of higher potential
signal PETs/bins. The higher the ratio of signal PETs/bins, the easier it it to
find loops in that resolution. The closer to the random line, the higher the
possibility to observe evenly distributed signals.
We expect the highest resolution with >=50% PETs are not singletons.
Example:
cLoops2 estRes -d trac -o trac -bs 10000,5000,1000 -p 20
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-bs BINSIZE Candidate contact matrix resolution (bin size) to estimate signal
enrichment. A series of comma-separated values or a single value can
be used as input. For example,-bs 1000,5000,10000. Default is 5000.
7. Estimate significant interaction distance range
Run cLoops2 estDis -h to see details.
Estimate the significant interaction distance limitation by getting the observed
and expected random background of the genomic distance vs interaction frequency.
Example:
cLoops2 estDis -d trac -o trac -bs 5000 -p 20 -plot
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-c CHROMS Whether to process limited chroms, specify it as chr1,chr2,chr3,
default is not. Use this to save time for quite big data.
-bs BINSIZE Bin size / contact matrix resolution (bp) to generate the contact
matrix for estimation, default is 5000 bp.
-r REPEATS The reapet times to shuffle PETs to get the mean expected background,
default is 10.
-plot Set to plot the result.
8. Filter PETs
Run cLoops2 filterPETs -h to see details
Filter PETs according to peaks/domains/loops/singletons/KNNs.
If any end of the PETs overlap with features such as peaks or loops, the PET
will be kept. Filtering can be done before or after peak/loop-calling. Input
can be peaks or loops, but should not be be mixed. The -singleton mode is based
on a specified contact matrix resolution, if there is only one PET in the bin,
the singleton PETs will be filtered. The -knn is based on noise removing step
of blockDBSCAN.
Examples:
1. keep PETs overlapping with peaks
cLoops2 filterPETs -d trac -peaks peaks.bed -o trac_filtered
2. keep PETs that do not overlap with any blacklist regions
cLoops2 filterPETs -d trac -peaks bg.bed -o trac_filtered -iv
3. keep PETs that overlap with loop anchors
cLoops2 filterPETs -d trac -loops test_loops.txt -o trac_filtered
4. keep PETs that both ends overlap with loop anchors
cLoops2 filterPETs -d trac -loops test_loops.txt -o trac_filtered -both
5. keep non-singleton PETs based on 1kb contact matrix
cLoops2 filterPETs -d trac -o trac_filtered -singleton -bs 1000
6. filter PETs based on blockDBSCAN knn noise removing
cLoops2 filterPETs -d trac -o trac_filtered -knn -eps 1000 -minPts 5
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-peaks FBED BED file of genomic features (such as promoters, enhancers, ChIP-seq,
ATAC-seq peaks,TADs) to filter PETs.
-loops FLOOP The loop.txt file generated by cLoops2, can be loops or domains, to
filter PETs.
-gap GAP If the distance between two genomic features is <=gap, the two regions
will be combined. Default is 1. Set to >=1.
-singleton Whether to use singleton mode to filter PETs. Contact matrix
resolution with -bs is required. Singleton PETs in contact matrix bins
will be filtered.
-bs BINSIZE The contact matrix bin size for -singleton mode filtering. Default is
5000.
-knn Whether to use noise removing method in blockDBSCAN to filter PETs,
-eps and -minPts are required.
-eps EPS Same to callPeaks and callLoops, only used to filter PETs for -knn
mode. Default is 1000. Only one value is supported.
-minPts MINPTS Same to callPeaks and callLoops, only used to filter PETs for -knn
mode. Default is 5. Only one value is supported.
-iv Whether to only keep PETs not in the assigned regions, behaves like
grep -v.
-both Whether to only keep PETs that both ends overlap with loop anchors.
Default is not.
9. Sampling PETs
Run cLoops2 samplePETs -h to see details.
Sampling PETs to target total size.
If there are multiple sample libraries and the total sequencing depths vary a
lot, and you want to compare the data fairly, it's better to sample them to
similar total PETs (either down-sampling or up-sampling), then call peaks/loops
with the same parameters.
Example:
cLoops2 samplePETs -d trac -o trac_sampled -tot 5000000 -p 10
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-tot TOT Target total number of PETs.
10. Call peaks for 1D or 3D data
Run cLoops2 callPeaks -h to see details.
Call peaks based on clustering.
Well tested work for ChIP-seq, ChIC-seq, ATAC-seq, CUT&RUN -like or the 3D
genomic data such as Hi-TrAC/Trac-looping, ChIA-PET and HiChIP.
There are three steps in the algorithm: 1) cluster the PETs to find
self-ligation clusters, which are candidate peaks; 2) estimate the significance
of candidate peaks with local background; 3) if given control data, further
compare candidate peaks to control data. If running multiple clusterings with
separated parameters, the clusters will be combined and callPeaks will output
the most significant one based on overlaps.
Key parameters are -eps and -minPts, both are key parameters in the clustering
algorithm blockDBSCAN. Eps indicates the distance that define two points (PETs)
being neighbors, while minPts indicatess the minial number of points required
for a cluster to form. For sharp-peak like data (ATAC-seq, TF ChIC-seq), set
-eps small such as 100 or 150. For broad-peak like data, such as H3K27me3
ChIP-seq and ChIC-seq, set -eps large as 500 or 1000.
Eps will affect more than minPts for sensitivity.
Examples:
1. call peaks for Trac-looping
cLoops2 callPeaks -d trac -eps 100 -minPts 10 -o trac -p 10
2. call peaks for sharp-peak like ChIC-seq without control data
cLoops2 callPeaks -d ctcf_chic -o ctcf_chic -p 10
3. call peaks for broad-peak like ChIC-seq with IgG as control
cLoops2 callPeaks -d H3K27me3 -bgd IgG -eps 500,1000 -minPts 10 \
-o H3K27me3
4. call peaks for sharp-peak ChIC-seq with linear fitting scaled control
data
cLoops2 callPeaks -d ctcf -bgd IgG -eps 150 -minPts 10 -o ctcf -p 10\
-bgm lf
5. call peaks with sentitive mode to get comprehensive peaks for CUT&TAG
cLoops2 callPeaks -d H3K27ac -bgd IgG -sen -p 10
6. filter PETs first and then call peaks for H3K27ac HiChIP, resulting much
much accurate peaks
cLoops2 filterPETs -d h3k27ac_hichip -o h3k27ac_hichip_filtered -knn \
-eps 500 -minPts 5
cLoops2 callPeaks -d h3k27ac_hichip_filtered -eps 200,500 -minPts 10 \
-p 10
7. call peaks for interaction data as single-end data
cLoops2 callPeaks -d h3k27ac -o h3k27ac -split -eps 200,500 -minPts 10 \
-p 10
8. call differential peaks between WT and KO condition
cLoops2 callPeaks -d MLL4_WT -bgd MLL4_KO -o MLL4_WTvsKO -p 10
cLoops2 callPeaks -d MLL4_KO -bgd MLL4_WT -o MLL4_KOvsWT -p 10
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-eps EPS Distance that defines two points (PETs) being neighbors, eps in
blockDBSCAN as key parameter, multiple eps can be assigned such as
100,200,300 to run multiple clusterings, the results will be combined.
For callPeaks, the default is 100,200. If the data show much more broad
feature such as H3K27me3 and H3K4me1, increase it to 500,1000 or larger.
If expecting both narrow and broad peaks in the data, set -eps 100,200,
500,1000.
-minPts MINPTS Points required in a cluster, minPts in blockDBSCAN, key parameter,
multiple minPts can be assigned such as 3,5 to run multiple
clusterings, the results will be combined. For callPeaks, the default
is 5. If the data have many reads, increasing minPts such as 10,20.
-pcut PCUT Bonferroni corrected poisson p-value cutoff to determine significant
peaks. Default is 1e-2.
-bgd BGD Assign control data (IgG, Input) directory generated by cLoops2 pre to
carry out analysis. Default is no background.
-bgm {ratio,lf} How to scale the target data with control data. Available options are
'ratio' and 'lf'. 'ratio' is based on library size and 'lf' means
linear fitting for control and target candidate peaks nearby regions.
Default is 'lf'. The scaling factor estimated by lf usually is a little
larger than ratio. In other words, the higher the scaling factor, the
less sensitive the results.
-pseudo PSEUDO Pseudo counts for local background or control data to estimate the
significance of peaks if no PETs/reads in the background. Default is
1. Set it larger for noisy data, 0 is recommend for very clean data
such as well prepared CUT&Tag.
-sen Whether to use sensitive mode to call peaks. Default is not. If only a
few peaks were called, while a lot more can be observed
from visualization, try this option. Adjust -pcut or filter by
yourself to select significant ones.
-split Whether to split paired-end as single end data to call peaks. Sometimes
works well for Trac-looping and HiChIP.
-splitExt SPLITEXT When run with -split, the extension to upstraem and downstream,
default is 50.
In the cLoops2 manuscript, we presented comparisons of cLoops2 callPeaks with other state-of-the-art methods such as MACS2, HOMER, SICER, and SEACR for CUT&Tag-like data, showing the accuracy and sensitivity. Here are some examples.
11. Call loops
Run cLoops2 callLoops -h to see details.
Call loops based on clustering.
Well tested work for Hi-TrAC/TrAC-looping, HiCHiP, ChIA-PET and Hi-C.
Similar to call peaks, there are three main steps in the algorithm: 1) cluster
the PETs to find inter-ligation clusters, which are candidate loops; 2)
estimate the significance of candidate loops with permutated local background.
3) If -hic option not selected, the loop anchors will be checked for peak-like
features, only peak-like anchors are kept. If running multiple clusterings,
the clusters will be combined and callLoops will output the most significant
one based on overlaps.
Similar to callPeaks, keys parameters are -eps and -minPts. For sharp-peak like
interaction data, set -eps small such as 500,1000. For broad-peak like data,
such as H3K27ac HiChIP, set -eps big as 1000,2000. For Hi-C and HiChIP data,
bigger -minPts is also needed, such as 20,50.
Please note that the blockDBSCAN implementation in cLoops2 is much more
sensitive than cDBSCAN in cLoops, so the same parameters can generate quite
different results. With -hic option, cDBSCAN will be used.
Examples:
1. call loops for Hi-TrAC/Trac-looping
cLoops2 callLoops -d trac -o trac -eps 200,500,1000,2000 -minPts 5 -w -j
2. call loops for Hi-TrAC/Trac-looping with filtering short distance PETs
and using maximal estimated distance cutoff
cLoops2 callLoops -d trac -o trac -eps 200,500,1000,2000 -minPts 5 \
-cut 1000 -max_cut -w -j
3. call loops for Hi-TrAC/Trac-looping and get the PETs with any end
overlapping loop anchors
cLoops2 callLoops -d trac -o trac -eps 200,500,1000,2000 -minPts 5 -w \
-j -filterPETs
4. call loops for high-resolution Hi-C like data
cLoops2 callLoops -d hic -o hic -eps 2000,5000,10000 -minPts 20,50 -w -j
5. call inter-chromosomal loops (for most data, there will be no significant
inter-chromosomal loops)
cLoops2 callLoops -d HiC -eps 5000 -minPts 10,20,50,100,200 -w -j -trans\
-o HiC_trans
optional arguments:
-h, --help show this help message and exit
-d PREDIR Assign data directory generated by cLoops2 pre to carry out analysis.
-o FNOUT Output data directory / file name prefix, default is cLoops2_output.
-p CPU CPUs used to run the job, default is 1, set -1 to use all CPUs
available. Too many CPU could cause out-of-memory problem if there are
too many PETs.
-cut CUT Distance cutoff to filter cis PETs, only keep PETs with distance
>=cut. Default is 0, no filtering.
-mcut MCUT Keep the PETs with distance <=mcut. Default is -1, no filtering.
-v Show cLoops2 version number and exit.
--- Following are sub-commands specific options. This option just show
version of cLoops2.
-eps EPS Distance that defines two points (PETs) being neighbors, eps in
blockDBSCAN as key parameter, multiple eps can be assigned such as
200,500,1000,2000 to run multiple clusterings, the results will be
combined. No default value, please give the input.
-minPts MINPTS Points required in a cluster. minPts in blockDBSCAN is a key parameter.
Empirically 5 is good for TFs and histone modification ChIA-PET data
and Trac-looping. For data like HiChIP and Hi-C, set it larger, like
>=20. The input can be a series, and the final loops will have the
PETs>= max(minPts).
-plot Whether to plot estimated inter-ligation and self-ligation PETs
distance distribution. Default is not to generate a plot.
-i Whether to convert loops to UCSC Interact track to visualize in UCSC.
Default is not, set this flag to save.
-j Whether to convert loops to 2D feature annotations to visualize in
Juicebox. Default is not, set this flag to save.
-w Whether to save tracks of loops to visualize in legacy and new washU.
Default is not, set this flag to save two files.
-max_cut When running cLoops with multiple eps or minPts, multiple distance
cutoffs for self-ligation and inter-ligation PETs will be estimated
based on the overlaps of anchors. Default option is the minimal one
will be used to filter PETs for candidate loop significance test.
Set this flag to use maximal one, will speed up for significance test.
-hic Whether to use statistical cutoffs for Hi-C to output significant loops.
Default is not, set this option to enable. Additionally, with -hic
option, there is no check for anchors requiring they looking like peaks.
-filter Whether to filter raw PETs according to called loops. The filtered
PETs can show clear view of interactions or be used to call loops again.
-trans Whether to call trans- (inter-chromosomal) loops. Default is not, set
this flag to call. For most common cases, not recommended, only for
data there are obvious visible trans loops.
-emPair By default eps and minPts combinations will be used to run clustering.
With this option, for example eps=500,1000 and minPts=5,10, only (500,5)
and (1000,10) as parameters of clustering will be run. Input number of
eps and minPts should be same.
12. Call differentially enriched intra-chromosomal loops
Run cLoops2 callDiffLoops -h to see details.
Call differentially enriched intra-chromosomal loops between two conditions.
Similar to calling peaks with control data, calling differentially enriched
loops is based on scaled PETs and the Poisson test. There are three main steps
in the algorithm: 1) merge the overlapped loops, quantify them and their
permutated local background regions; 2) fit the linear transformation of
background target interaction density to control background data based on
MANorm2; therefore, if there are more than than two samples, others can be
scaled to the reference sample for quantitative comparison; 3) estimate the
fold change (M) cutoff and average (A) cutoff using the background data with
the control of FDR, assuming there should no differentially
> README 内容过长,已截取部分内容。完整内容请前往 GitHub 仓库查看。
评论