calculate genetic diversity parametres using R software/ triploide plant /SSR markrs

133 views
Skip to first unread message

mina boutagayout

unread,
Aug 15, 2018, 7:55:43 AM8/15/18
to poppr
Hi, please can someone help me 
i want to import genAlex format(attached file)  to poppr package because i have a triploide plante so the only package i can use is the R poppr package.
i use read.genalex fonction to import but it gives me error
that's what i use to do
gen <- read.genalex('testgenal.csv', ploidy = 3)
but it give me that :

Error in if (nrow(gena) != ninds) { : 
  missing value where TRUE/FALSE needed
In addition: Warning message:
In read.genalex("testgenal.csv", ploidy = 3) : NAs introduced by coercion
testgenal.csv

mina boutagayout

unread,
Aug 15, 2018, 8:52:45 AM8/15/18
to poppr

--
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 to poppr+unsubscribe@googlegroups.com.
To post to this group, send email to po...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/15054f0a-5cbc-4cd6-b089-59ae20e7fbba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

safran

Zhian Kamvar

unread,
Aug 15, 2018, 9:22:57 AM8/15/18
to poppr
There are a couple of problems here; one is easy to solve, and the other one takes a bit of work.

1. Your csv file is separated with semicolons (;) instead of commas. Use sep = ";" in the read.genalex() command to fix this.

However, this will not solve your issue yet as you will then get this error:
 
  Something went wrong. Please ensure that your data is formatted correctly:                                                                                                           
                                                                                                                                                                                       
 Is the ploidy flag set to the maximum ploidy of your data?                                                                                                                            
 If you have geographic coordinates: did you set the flag?                                                                                                                             
 If you have regional data: did you set the flag?                                                                                                                                      
                                                                                                                                                                                       
 Otherwise, the problem may lie within the data structure itself.                                                                                                                      
  - Inspect your data; if it looks fine then                                                                                                                                           
  - search the poppr forum for the error message; if you still can't find a solution:                                                                                                  
    1. Make a minimum working example of your error (see http://stackoverflow.com/a/5963610)                                                                                           
    2. Use the 'reprex' package to reproduce the error (see https://github.com/jennybc/reprex#readme)                                                                                  
    3. Create a new issue on https://github.com/grunwaldlab/poppr/issues 

This is because the majority of loci in your file (loc4, loc12, loc13, loc19, loc20, loc22, loc32) have only two columns. All of your loci must have the same number of columns as the ploidy. To fix this, add a column after each of these filled with zeros. An example of such can be found here: http://grunwaldlab.github.io/Population_Genetics_in_R/Data_Preparation.html#polyploids

Hope that helps,
Zhian
Reply all
Reply to author
Forward
0 new messages