robinweide / GENOVA

GENome Organisation Visual Analytics
GNU General Public License v3.0
69 stars 15 forks source link

The wrong cis_trans on specific regions #205

Closed QianzhaoJ closed 4 years ago

QianzhaoJ commented 4 years ago

Hi, it's a very useful tools for hic analysis ! But when I used cis_trans for intra-arm percentages ,I think I got the wrong result :

cisChrom_out sample cis region WT_P3 22.286326 bed R_P3 34.630944 bed Homo_P3 5.489967 bed WS_P3 23.419586 bed WT_P9 17.021126 bed R_P9 49.582761 bed Homo_P9 46.764163 bed WS_P9 46.695157 bed

I checked the source code about cis_trans ,and I found some problems in :

bedI = bed2idx(IDX = x$IDX, bd[, 1:3])

bedMAT = x$MAT[bedI]

bedI is the Hi-C bin indices, I don't think it can be used to extracted directly from x$MAT as an index. And in my sample “WT_P3 ”,the bedI is

1891 4193 6385 8126 9977 11801 13445 14905 16356 17699 19119 20377 21529 22640 23698 24752 25546 26309 27043 27659 28140 28656 29915

the bedMAT is

V1 V2 V3 1: 8 2743 2.266414 2: 8 11097 4.897233 3: 8 18948 2.042648 4: 8 25077 4.711449 5: 9 329 12.121869 6: 9 3714 3.628276 7: 9 9219 1.876905 8: 9 13905 1.765811 9: 9 18813 1.632356 10: 9 23378 2.041873 11: 9 27100 4.235221 12: 10 305 3.479224 13: 10 2101 3.046903 14: 10 4853 3.001125 15: 10 8051 6.066716 16: 10 11163 1.481751 17: 10 13620 1.403609 18: 10 16302 3.943807 19: 10 18161 1.779066 20: 10 20013 6.778594 21: 10 21413 1.905798 22: 10 23401 2.657068 23: 10 26621 6.910895

At last, my scripts are cisChrom_out <- cis_trans( list(WT_P3_100kb,R_P3_100kb,Homo_P3_100kb,WS_P3_100kb,WT_P9_100kb,R_P9_100kb,Homo_P9_100kb,WS_P9_100kb) , bed = p_arms) and the p_arms is :

chromosome start end 1 chr1 128900000 249250621 2 chr2 96800000 243199373 3 chr3 93900000 198022430 4 chr4 52700000 191154276 5 chr5 50700000 180915260 6 chr6 63300000 171115067 7 chr7 61700000 159138663 8 chr8 48100000 146364022 9 chr9 50700000 141213431 10 chr10 42300000 135534747 11 chr11 55700000 135006516 12 chr12 38200000 133851895 13 chr13 19500000 115169878 14 chr14 19100000 107349540 15 chr15 20700000 102531392 16 chr16 38600000 90354753 17 chr17 25800000 81195210 18 chr18 19000000 78077248 19 chr19 28600000 59128983 20 chr20 29400000 63025520 21 chr21 14300000 48129895 22 chr22 17900000 51304566 23 chrX 63000000 155270560`

Can you give me some suggestions ?

Best wishes Qianzhao

teunbrand commented 4 years ago

Hi Qianzhao,

Thank you for reporting this bug, you are right about the indices. We are working on fixing this and hope to push this to the development branch somewhere this week.

Best wishes, Teun

teunbrand commented 4 years ago

I think this is now fixed in the development branch