I have the following Dataframe:
id coord_id val1 val2 record val3
0 snp chr15_1-1000 1.0 0.9 xx12 2
1 snv chr15_1-1000 1.0 0.7 yy12 -4
2 ins chr15_1-1000 0.01 0.7 jj12 -4
3 ins chr15_1-1000 1.0 1.5 zzy1 -5
4 ins chr15_1-1000 1.0 1.5 zzy1 -5
5 del chr10_2000-4000 0.1 1.2 j112 12
6 del chr10_2000-4000 0.4 1.1 jh12 15
I am trying to count the number of times each coord_id appears by each id but keeping the val1 column in the resulting table but only to include a range of the value in that column so for instance, I am trying accomplish the following result:
id snp snv ins del total val1
chr15_1-1000 1 1 3 0 5 0.01-1.0
chr10_2000-4000 0 0 0 2 2 0.1-0.4
I want to sort it in ascending order by the column total.
So much appreciate it in advance.