[adegenet-forum] DNAbin and pop
Rita Castilho
rita.castil at gmail.com
Mon Dec 16 06:02:36 CET 2013
Hi!
I am new to R and I have a lot of trouble in going from a phylip or fasta file to a genind object or fasta2DNAbin containing pop information.
My files are always phylip or fasta files, and sequences have a reference composed of an di-alpha followed by 4 numeric digits (e.g. CD1495). The first two letters determine the population to which the sequence belongs to.
Is there a quick way to do it instead of doing this, as the grouping factor can be easily deduced from the current individual labels, saving the task of read that info R separately?
#reading data
dna<- fasta2DNAbin('data.fas')
# setting pops
data.pop<- as.factor(rep(c('AD', 'CD', 'FR', 'GE', 'RE', 'OT', 'YU', 'AU'), c(17,11,12,12, 25, 14, 13, 20)))
Many thanks
Rita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20131216/0f4c48b9/attachment.html>
More information about the adegenet-forum
mailing list