Formatting data in GenAlEx Format
0
1
Entering edit mode
7.1 years ago
aberry814 ▴ 80

I am trying to format my diploid SNP data to GenAlEx format for downstream analysis using PoppR, but as is often the case, the GenAlEx addon for MSExcel won't work because I have far too many columns. With my small bit of R knowledge I've managed to get this far:

"SNP_ID" "Population" "Locus_1" "Locus_2" Sample_1 1 AG TG Sample_2 1 AT TT

but I need to split the SNPS (AG) into separate columns (A G) where the G is moved to a new column without a header, which will be interpreted by the program as still belonging to locus 1, like so:

"SNP_ID" "Population" "Locus_1" "Locus_2"
Sample_1 1 A G T G Sample_2 1 A T T T

The way I'd like to do it would be to 1) make new columns after each existing locus and then 2) move the second allele from each pair into the new, empty cell to its right. This should double the number of columns (minus the first 2 ID columns), but the number of loci (and column labels) will remain the same.

Thanks!

Alex

sequencing SNP • 2.8k views
ADD COMMENT

Login before adding your answer.

Traffic: 1508 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