我有一个相关性的 r 值文件。我想将 r 值拆分为 bin 并计算每个 bin 中有多少 CNV。有没有办法在没有重复的情况下做到这一点?
GeneChr SNP SNP_Position CNV start end r-value
1 rs7520551 100716167 1:101161140-101161459 100161140 102161459 0.950231679
1 rs6702766 100997635 1:101161140-101161459 100161140 102161459 0.376573375
1 rs11588568 101426960 1:101161140-101161459 100161140 102161459 0.252772248
1 rs4332900 10236894 1:10405137-10406094 9405137 11406094 0.171113128
1 rs11678947 10307395 1:10405137-10406094 9405137 11406094 0.334359684
1 rs2357468 10341468 1:10405137-10406094 9405137 11406094 0.30932652
1 rs1918705 10693478 1:10405137-10406094 9405137 11406094 0.822784876
1 rs7570190 101528047 1:101161140-101161459 100161140 102161459 0.391963719
1 rs643841 110832827 1:110028467-110029625 109028467 111029625 0.070643341
1 rs7514102 110998854 1:110028467-110029625 109028467 111029625 0.548219745
1 rs4676225 109609765 1:110028467-110029625 109028467 111029625 0.035118621
1 rs7608232 101699063 1:101161140-101161459 100161140 102161459 0.951958567
1 rs1449308 100708996 1:101161140-101161459 100161140 102161459 0.703308687
我有这条线来分割数据,只需要计算CNV而不重复计数。
xNew <- table(cut(CorTestMatrix$test, breaks=c(0,0.1,0.2, 0.3, 0.4, 0.5,1)))
我只想知道每个 bin 中有多少个 CNV。