aidenlab / juicer

A One-Click System for Analyzing Loop-Resolution Hi-C Experiments
http://aidenlab.org
MIT License
402 stars 180 forks source link

Chromosome combination error in mega.sh #279

Open kellyliyichen opened 2 years ago

kellyliyichen commented 2 years ago

Hi,

I am encountering an error when running mega.sh to combine contacts from different biological replicates using mega.sh.

Using 1 CPU thread(s) for primary task
Using 10 CPU thread(s) for secondary task
Not including fragment map
Start preprocess
Writing header
Writing body
...........................................................................................................................................................................
.................Error: the chromosome combination 19_21 appears in multiple blocks

Here is the code that I used to run mega.sh:

/$mydir/juicer/scripts/mega.sh \
    -d /$mydir/juicer/work/${sample} \
    -g /$mydir/mm10.chrom.sizes \
    -y /$mydir/juicer/restriction_sites/mm10_MboI.txt \
    -D /$mydir/juicer
    -T 40

Since I am using mm10, I am quite confused why there is a chromosome combination 19_21. One thing I just realize is that when I ran juicer, in my mm10.chrom.sizes file, there are not only chromosomes chr1-19,X,Y,M, but also chr*_random and chrUn which I forgot to remove from the file. Is this the reason why I am getting the chromosome combination error?

As suggested, I also include the code I ran juicer.sh for each biological replicate:

/$mydir/juicer/scripts/juicer.sh \
    -z /$mydir/juicer/references/mm10.fa \
    -p /$mydir/juicer/restriction_sites/mm10.chrom.sizes \
    -y /$mydir/juicer/restriction_sites/mm10_MboI.txt \
    -d /$mydir/juicer/work/${sample}/${replicate} \
    -D /$mydir/juicer

All steps seem to run successfully except juicer_postprocessing.sh because I did not supply the -g argument and I got the error after writing norms:

Calculating norms for zoom BP_2500000
Calculating norms for zoom BP_1000000
Calculating norms for zoom BP_500000
Calculating norms for zoom BP_250000
Calculating norms for zoom BP_100000
Calculating norms for zoom BP_50000
Calculating norms for zoom BP_25000
Calculating norms for zoom BP_10000
Calculating norms for zoom BP_5000
Calculating norms for zoom BP_2000
Calculating norms for zoom BP_1000
Calculating norms for zoom BP_500
Calculating norms for zoom BP_200
Calculating norms for zoom BP_100Finished writing norms

real    116m23.712s
user    530m55.116s
sys     35m43.055s
/mydir/juicer/scripts/common/juicer_postprocessing.sh: option requires an argument -- g
Usage: /mydir/juicer/scripts/common/juicer_postprocessing.sh [-h] -j <juicer_tools_file_path> -i <hic_file_path> -m <bed_file_dir> -g <genome ID>
***! Error! Either inter.hic or inter_30.hic were not created
Either inter.hic or inter_30.hic were not created.  Check  for results

(I guess the last error Either inter.hic or inter_30.hic were not created. Check for results is due to the bug mentioned in #269 and when I checked the output directory /$mydir/juicer/work/${sample}/${replicate}/aligned/, there are inter.hic and inter_30.hic)

Here are some version numbers: Juicer version 2.0; BWA 0.7.17-r1188; 80 threads; openjdk version "11.0.1" 2018-10-16 LTS; Juicer Tools Version 2.13.07

Many thanks for any help!!! Kelly

kanglizhu commented 1 year ago

hi, I also met the same problem. How did you solve this problem?

Many thanks for any help!

kangli

kellyliyichen commented 1 year ago

@kanglizhu Hi, I think perhaps it is due to the sorting problem. You may need to sort each file before running mega.sh. Please refer to this discussion for more details. Hope it helps!