[adegenet-forum] rupica dataset genind2df error

Jombart, Thibaut t.jombart at imperial.ac.uk
Mon Oct 22 11:30:42 CEST 2012


Hello, 

this is because missing data have been replaced in rupica to simplify its use in examples. If you look at allele profiles you'll see that some values are not 0, 0.5 or 1.

To export the dataset you need to restore the missing data first:
###
x <- rupica
x at tab[!round(x at tab,10) %in% c(0,.5,1)] <- NA

expdat <- genind2df(x, oneColPerAll=TRUE)
...
###

Cheers

Thibaut


________________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Zhian Kamvar [kamvarz at science.oregonstate.edu]
Sent: 21 October 2012 02:26
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] rupica dataset genind2df error

Hello,

I noticed a little error pop up when attempting to convert the rupica dataset to a data frame with each allele in a separate column:

> genind2df(rupica, oneColPerAll=T)
Error in data.frame(Bm1818 = c("272", "272", "272", "272", "272", "280",  :
  arguments imply differing number of rows: 335, 334
In addition: Warning messages:
1: In matrix(unlist(e), ncol = x at ploidy, byrow = TRUE) :
  data length [669] is not a sub-multiple or multiple of the number of rows [335]
2: In matrix(unlist(e), ncol = x at ploidy, byrow = TRUE) :
  data length [667] is not a sub-multiple or multiple of the number of rows [334]

It appears that some genotypes do not list both alleles and do not indicate missing data. From other data sets in adegenet, I gathered that missing data was coded as "NA".

Were these supposed to be indicated as homozygous or are they actually missing, and if they are missing, why are they not coded in the normal fashion?

Cheers,
Zhian Kamvar


More information about the adegenet-forum mailing list