ChenfuShi / HiChIP_peaks

A tool to analyse HiChIP data
BSD 3-Clause "New" or "Revised" License
8 stars 4 forks source link

Is this a cluttering issue? #18

Closed vivianschu closed 3 years ago

vivianschu commented 3 years ago

Hi, I'm trying to run HiChIP-peak, but keep running into this error. Is this a cluttering issue?

INFO - Number of read pairs parsed: 0.0
INFO - #######################################
INFO - Extracting pairs for ChIP peaks calling
INFO - Number of reads used in peak calling: 0.0
WARNING - WARNING: number of reads used for peak calling is very low. Consider doing more sequencing
Traceback (most recent call last):
  File "/home/vchu/.local/bin/peak_call", line 8, in <module>
    sys.exit(main())
  File "/home/vchu/.local/lib/python3.8/site-packages/hichip_peaks/main.py", line 130, in main
    smoothed_diagonal, refined_peaks ,quick_peaks, peak_p_vals , peaks_q_vals ,expected_background= sparse_to_peaks.sparse_to_peaks(CSR_mat,frag_index,frag_prop,frag_amount,valid_chroms,chroms_offsets,output_dir,prefix,off_diag,chromX,FDR=FDR,threads=threads,keeptemp=keeptemp)
  File "/home/vchu/.local/lib/python3.8/site-packages/hichip_peaks/sparse_to_peaks.py", line 53, in sparse_to_peaks
    smoothed_diagonal = numpy.rint(moving_integration(diagonal,((off_diag-1)*2)+1)).astype(int) #### changed to 3 smoothing factor, it is one less than the number of off sites
  File "/home/vchu/.local/lib/python3.8/site-packages/hichip_peaks/sparse_to_peaks.py", line 86, in moving_integration
    sma = numpy.convolve(values, weights, 'same')
  File "<__array_function__ internals>", line 5, in convolve
  File "/home/vchu/.local/lib/python3.8/site-packages/numpy/core/numeric.py", line 848, in convolve
    raise ValueError('v cannot be empty')
ValueError: v cannot be empty
ChenfuShi commented 3 years ago

Hi, something is wrong upstream as it seems to not be able to read in any reads.

Can you double check the files that go in the input? Maybe paste the first lines here?

vivianschu commented 3 years ago

Here are the files that go in the input:

sample.validPairs

SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:22210:3733:12481     1       14923   +       2       101619357       +       279     HIC_1_12        HIC_2_239759    32      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:3:23408:21419:7586     1       14933   +       3       195270552       -       213     HIC_1_12        HIC_3_463558    22      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:12111:12700:9646     1       15251   -       9       140016549       -       201     HIC_1_14        HIC_9_296640    32      32
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:4:23606:17889:18470    1       20175   -       5       180685387       -       191     HIC_1_22        HIC_5_426670    30      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:3:22609:22685:8313     1       30963   -       9       13946   -       268     HIC_1_44        HIC_9_11        30      32

sample.REPairs

SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1083:14352     1       84897360        +       1       84897517        -       157     HIC_1_223141    HIC_1_223142    42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1091:15631     7       96511881        +       7       96512112        -       231     HIC_7_232294    HIC_7_232295    42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1095:7879      20      34232144        +       20      34232322        -       178     HIC_20_79511    HIC_20_79512    42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1100:19162     14      53807941        +       14      53808319        -       378     HIC_14_83793    HIC_14_83794    42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1106:4899      12      120405054       +       12      120405389       -       335     HIC_12_295234   HIC_12_295235   24      42

sample.DEPairs

SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1062:7686      17      45884615        +       17      45884825        -       210     HIC_17_123539   HIC_17_123539   42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1067:14496     12      61773204        +       12      61773357        -       153     HIC_12_148312   HIC_12_148312   24      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1079:10361     3       33039354        +       3       33039683        -       329     HIC_3_80010     HIC_3_80010     42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1082:4549      4       688452  +       4       688720  -       268     HIC_4_1736      HIC_4_1736      39      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1084:10889     7       90501541        +       7       90501705        -       164     HIC_7_218226    HIC_7_218226    42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1092:10585     15      58650419        +       15      58650550        -       131     HIC_15_96940    HIC_15_96940    42      42

sample.SCPairs

SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1057:12221     8       72345649        -       8       72345904        +       308     HIC_8_172185    HIC_8_172185    42      40
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1236:15203     19      45311337        -       19      45311959        +       177     HIC_19_126839   HIC_19_126839   42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1329:9972      16      2653607 -       16      2653728 +       301     HIC_16_6656     HIC_16_6656     42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1450:15487     6       31510050        -       6       31510372        +       315     HIC_6_80944     HIC_6_80944     42      42
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1505:15862     11      24839288        -       11      24839577        +       377     HIC_11_60999    HIC_11_60999    42      24
SL-NXC:H2WHLBGX7180722:H2WHLBGX7:1:11101:1531:8197      9       112680266       -       9       112680500       +       198     HIC_9_225671    HIC_9_225671    42      42
ChenfuShi commented 3 years ago

So the problem I think is that your chromosomes are just numbers rather than chr1, chr2 etc. To solve this you can add the annotation file (.sizes) because the software should be able to get the valid chromosomes from there. I suggest you provide the annotation file with only the chromosomes 1-22 + X and remove all the contigs.

(HiCpro chromosome annotation file) is the one that looks like chr1 248956422 chr2 242193529 chr3 198295559 chr4 190214555 chr5 181538259 chr6 170805979 chr7 159345973 chr8 145138636 chr9 138394717 chr10 133797422 chr11 135086622 chr12 133275309 chr13 114364328 chr14 107043718 chr15 101991189 chr16 90338345 chr17 83257441 chr18 80373285 chr19 58617616 chr20 64444167 chr21 46709983 chr22 50818468 chrX 156040895 chrY 57227415 chrM 16569

vivianschu commented 3 years ago

Thanks so much for your help! That worked!