Entering edit mode
milton ruser
▴
20
@milton-ruser-3949
Last seen 10.6 years ago
Hi all,
Sorry to forward the message, but I am not sure if it reached the
list.
any hint are very welcome.
cheers
milton
---------- Forwarded message ----------
From: milton ruser <milton.ruser@gmail.com>
Date: Fri, Feb 26, 2010 at 2:33 PM
Subject: landscape genetics analysis
To: bioconductor@stat.math.ethz.ch
Dear all,
I would like to stay in touch with those involved with landscape
genetics.
My interest is mainly to assess how simulated animal movements can
influence
genetic diversity. We are simulating animal movement using different
landscape patterns, and each male-female meeting get a chance of genes
exchange. So, on the beginning of the simulation we define a loci
structure
like: LOCI_struct_start=[ [0,1,0,0,1,1] , [0,1,0,1] ] where we can see
to
locus with different number of alleles (6 and 4). When female meet a
male,
there are a chance of female pass the genes combination to offspring,
like
LOCI_struct_end=[ [1,1,0,1,1,1] , [0,0,0,1] ]. My interest is to
estimate
both the genes diversity for each female/potential offspring, and
for the
whole population (all individual simulated on a specific landscape
condition).
Below you can find a sample of my data-structure. I would be happy if
someone give me some adviser on which package/function to use, or some
book
that explain Fst, H0, He analysis using R/Bioconductor packages.
library(rjson)
myDF<-data.frame(cbind(x=c("[[1, 0, 0], [0, 1]]",
"[[1, 1, 0], [0, 1]]","[[1, 0, 0], [1, 1]]",
"[[0, 0, 1], [0, 1]]")))
myDF
lets = unlist(lapply(fromJSON(as.character(myDF[1,])),length))
lets
rep(LETTERS[1:length(lets)],lets)
sequence(lets)
col_names_letters<-paste(rep(LETTERS[1:length(lets)],lets),sequence(le
ts),sep="")
myDF_new<-NULL
for (i in 1:nrow(myDF))
{
x<-c(as.character(myDF[i,"x"]))
fromJSON(x)
unlist(fromJSON(x))
aux_DF<-data.frame(t(cbind(unlist(fromJSON(x)))))
myDF_new<-data.frame(rbind(myDF_new,aux_DF))
}
colnames(myDF_new)<-col_names_letters
myDF_new
cheers
Milton
[[alternative HTML version deleted]]