On Feb 12, 2018, at 04:47 , Yu NING <ningy...@qq.com
<http://qq.com/>> wrote:
Now I have found one way to work it out:
|
popslot_Kob<-pop(Kob_snpclo)
Blygl_dis<-bitwise.dist(Bly_gl,percent=FALSE)
Bly_amova<-pegas::amova(Blygl_dis~popslot,data=strata(Bly_gl),is.squared=TRUE)
|
Just add one line to extract the pop information. But I still
wonder why error showed when I use:
|
Bly_amova<-pegas::amova(Blygl_dis~pop,data=strata(Bly_gl),is.squared=TRUE)
|
It's a little wired....
在 2018年2月11日星期日 UTC+8上午11:26:11,Yu NING写道:
Hello,
Thanks for your help. But other problems showed up:
|
> Blygl_dis<- bitwise.dist(Bly_gl, percent = FALSE)
> Bly_amova<- pegas::amova(Blygl_dis ~ pop, data =
strata(Bly_gl), is.squared = TRUE)
Error in FUN(X[[i]], ...) : 'bin' must be numeric or a factor
In addition: Warning message:
In pegas::amova(Blygl_dis ~ pop, data = strata(Bly_gl),
is.squared = TRUE) :
elements in the rhs of the formula are not all factors
|
Is there something wrong in my data organization? This is the
data info:
|
> Bly_gl
/// GENLIGHT OBJECT /////////
// 39 genotypes, 7,227 binary SNPs, size: 969.5 Kb
11255 (3.99 %) missing data
// Basic content
@gen: list of 39 SNPbin
@ploidy: ploidy of each individual (range: 2-2)
// Optional content
@ind.names: 39 individual labels
@loc.names: 7227 locus labels
@chromosome: factor storing chromosomes of the SNPs
@position: integer storing positions of the SNPs
@pop: population of each individual (group size range: 2-3)
@other: a list containing: elements without names
|
在 2018年1月23日星期二 UTC+8下午11:38:39,Zhian Kamvar写道:
Hello,
I have browsed the manual but I couldn't find how to
calculate metrics of differentiation in/ poppr/ , and
/poppr.amova()/ is also not applicable for snpclone
object. Is there a way to solve it ?
Unfortunately, calculating AMOVA on genlight objects is
not currently possible in poppr [1]. I would recommend to
use the pegas implementation like so:
library("pegas")
myDist <- bitwise.dist(myGenlight, percent = FALSE)
res <- pegas::amova(myDist ~ pop/subpop, data =
strata(myGenlight), is.squared = TRUE)
Replace "myGenlight" with the name of your data and
"pop/subpop" with the hierarchy present in your strata slot.
Moreover, If I want to export my snpclone object which
is MLG filtered, how should I code?
If you want to export the object for use in another
Rscript, I would recommend using saveRDS() to save the
object to a file and then readRDS() to read that file in
a new session*. If you only need the MLG assignments,
then he underlying genetic data does not change when you
filter MLGs, so you can export the assignments as a CSV
file along with your individual names and population data.
I hope that helps.
Zhian
[1]: https://github.com/grunwaldlab/poppr/issues/72
<https://github.com/grunwaldlab/poppr/issues/72>. This is
not a simple problem and may still take a bit longer to
implement as I am now only working on poppr in my spare time.
* If you defined your MLGs using a matrix, then you must
also save that matrix and reload it with the same name.
-----
Zhian N. Kamvar, Ph. D.
Postdoctoral Researcher (Everhart Lab)
Department of Plant Pathology
University of Nebraska-Lincoln
ORCID: 0000-0003-1458-7108
On Jan 23, 2018, at 08:51 , Yu NING <ningy...@qq.com
<http://qq.com/>> wrote:
Hi~
I have browsed the manual but I couldn't find how to
calculate metrics of differentiation in/poppr/ ,
and/poppr.amova()/is also not applicable for snpclone
object. Is there a way to solve it ? Moreover, If I
want to export my snpclone object which is MLG filtered,
how should I code? Thanks very much
--
You received this message because you are subscribed to
the Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails
from it, send an email topoppr+un...@googlegroups.
<http://googlegroups.com/>com <http://googlegroups.com/>.
To post to this group, send email
topo...@googlegroups.com <http://googlegroups.com/>.
To view this discussion on the web
visithttps://groups.google.com/d/msgid/poppr/56affc46-45a0-49ab-9511-f38f29b908f3%40googlegroups.com
<https://groups.google.com/d/msgid/poppr/56affc46-45a0-49ab-9511-f38f29b908f3%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options,
visithttps://groups.google.com/d/optout
<https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the
Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails from it,
send an email topoppr+un...@googlegroups.com
<http://googlegroups.com/>.
To post to this group, send email topo...@googlegroups.com
<http://googlegroups.com/>.
To view this discussion on the web
visithttps://groups.google.com/d/msgid/poppr/135db219-5a16-45ed-b32f-487adf73ed41%40googlegroups.com
<https://groups.google.com/d/msgid/poppr/135db219-5a16-45ed-b32f-487adf73ed41%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visithttps://groups.google.com/d/optout
<https://groups.google.com/d/optout>.