[adegenet-forum] supplementary individuals

Jombart, Thibaut t.jombart at imperial.ac.uk
Fri Jun 19 14:47:00 CEST 2015


Hi there,

(please keep the forum posted)

Easiest way is to subset the individuals you want to keep. genind objects can be subsetted like matrices, i.e. x[i,] where 'x' is your repooled genind and 'i' indicates individuals to keep.

Cheers
Thibaut


________________________________
From: Mark Coulson [Mark.Coulson.ic at uhi.ac.uk]
Sent: 19 June 2015 12:51
To: Jombart, Thibaut
Subject: RE: supplementary individuals

Ok, so I did repool(A,B) and got a matrix with the correct dimensions. How do I extract the, say last 7 populations? I’ve used seppop on the combined dataframe now but obviously repool from here for the supplementary individuals will simply reverse the last action and still give me the wrong locus count.

I have also tried the popsub from the poppr package but same result

Mark

From: Jombart, Thibaut [mailto:t.jombart at imperial.ac.uk]
Sent: 19 June 2015 11:47
To: Mark Coulson; adegenet-forum at lists.r-forge.r-project.org
Subject: RE: supplementary individuals


There is a function 'repool' to do what you need (see ?repool). If A and B are two geninds with different alleles, then it merges the datasets together to have matching alleles and dimensions.

Dropping the locus is possible here indeed, but that's a potentially big loss of information if it is informative in the training set - this locus alone could define the most likely group assignment.

Cheers
Thibaut

________________________________
From: Mark Coulson [Mark.Coulson.ic at uhi.ac.uk]
Sent: 19 June 2015 11:43
To: Jombart, Thibaut
Subject: RE: supplementary individuals
Thanks Thibault!

Not sure what you mean about the repool. All individuals in the supplementary are fixed ‘0202’. My initial reaction was to simply drop this locus from both datasets and re-run the DAPC – what’s the easiest way to tell adegenet to omit a locus?

Best,
Mark


From: Jombart, Thibaut [mailto:t.jombart at imperial.ac.uk]
Sent: 19 June 2015 11:41
To: Mark Coulson; adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org>
Subject: RE: supplementary individuals

Hi Mark

I think you identified the problem. genind object keep only polymorphic sites.

You would need to 'repool' your supplementary individuals to make sure loci/alleles match, and then just extract the relevant individuals for the prediction.

Makes sense?

Best
Thibaut


==============================
Dr Thibaut Jombart
MRC Centre for Outbreak Analysis and Modelling
Department of Infectious Disease Epidemiology
Imperial College - School of Public Health
Norfolk Place, London W2 1PG, UK
Tel. : 0044 (0)20 7594 3658
http://sites.google.com/site/thibautjombart/
http://sites.google.com/site/therepiproject/
http://adegenet.r-forge.r-project.org/
Twitter: @thibautjombart
________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org<mailto:adegenet-forum-bounces at lists.r-forge.r-project.org> [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Mark Coulson [Mark.Coulson.ic at uhi.ac.uk]
Sent: 19 June 2015 11:23
To: adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org>
Subject: [adegenet-forum] supplementary individuals
Hi Thibault,

I am trying to use the pred.sup function to assign ‘test’ individuals against my baseline data. Both baseline and supplementary individuals files load fine in adegenet but when I run the pred.sup function I get the following:

Error in predict.dapc(dapc1, newdata=sup):
                Number of variables in newdata does not match original data.


Looking at the dataframes, the baseline says it’s a matrix of 1800 x 70 (which I expect), however the supplementary says 69 for the latter(?). I have found that when  interrogating @loc.fac for the supplementary file, locus27 is only listed once, while all others are listed 2x. Perhaps a coincidence but this locus is the only one that is monomorphic  in the supplementary individuals but it is polymorphic in the baseline – would this have any effect?

Suggestions?

Thanks,
Mark
Inverness College UHI, a partner in the University of the Highlands and Islands www.inverness.uhi.ac.uk<http://www.inverness.uhi.ac.uk> Board of Management of Inverness College (known as Inverness College UHI), Scottish Charity No SC021197.
Inverness College UHI, a partner in the University of the Highlands and Islands www.inverness.uhi.ac.uk<http://www.inverness.uhi.ac.uk> Board of Management of Inverness College (known as Inverness College UHI), Scottish Charity No SC021197.
Inverness College UHI, a partner in the University of the Highlands and Islands www.inverness.uhi.ac.uk Board of Management of Inverness College (known as Inverness College UHI), Scottish Charity No SC021197.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20150619/ac210c53/attachment.html>


More information about the adegenet-forum mailing list