How to get this done in R? Combine rows with the same position.
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
• 3,518 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Duplicate How to do coverage counting for each genomic position in R ?.
Specific output is not bioinformatics problem (just read data.table reference manual).
Sorry, Thanks!
Hello MAPK!
Questions similar to yours can already be found at:
We have closed your question to allow us to keep similar content in the same thread.
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
Cheers!
PS: duplicated post, as noted by Pgibas.