Off topic:How to get this done in R? Combine rows with the same position.
0
0
Entering edit mode
8.9 years ago
MAPK ★ 2.1k

Hi Guys,

I have a huge table like the one shown below with repeated snp positions. I want to combine all the rows with same position and get the nucleotide counts for each position as shown in the result. Thank you for your help!

df1

     seqnames      pos nucleotide count
  1:    chr11  1643082          A  1
  2:    chr11  1643082          C  3
  3:    chr11  1643082          T 18
  4:    chr11 47663948          C 27
  5:    chr11 47663948          T  2

result

chr11:1643082   T:18,C:3,A:1
chr11 47663948  C:27,T:2
R • 3.4k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2662 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6