You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, samp.ia and win.ia don't take into account chromosome. This is especially important for win.ia because the positions might be relative to chromosome, screwing up the windowing. The process should be:
detect if there is positional data
detect if there is chromosomal data
detect if the positions are relative to chromosome
reassign positions if 3 is true.
Here's some example code assuming x is a genlight object:
if (is.null(position(x))){
position(x) <- seq(nLoc(x))
}
pos<- position(x)
if (!is.null(chromosome(x))){
# Each chromosome has it's own position.# In this case, get large round number for each chromosome break.maxp<-10^ceiling(log(max(pos), 10))
if (length(unique(pmin(pos))) < nLoc(x)){
pos<- split(pos, chromosome(x))
for (pin seq(pos)){
if (p!=1){
pos[[p]] <-pos[[p]] + (maxp*(p-1))
}
}
pos<- unlist(pos, use.names=FALSE)
}
}
This will set up the positions for windowing.
The text was updated successfully, but these errors were encountered:
This will address #117.
Briefly, this update allows win.ia to parameterize
the window based on chromosome coordinates. It
solves an issue that appears when positions are
specified relative to the chromosome where the
positions are taken together and incorrectly
summarized.
Currently, samp.ia and win.ia don't take into account chromosome. This is especially important for win.ia because the positions might be relative to chromosome, screwing up the windowing. The process should be:
Here's some example code assuming x is a genlight object:
This will set up the positions for windowing.
The text was updated successfully, but these errors were encountered: