
--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/b0cad310-9fcf-425d-804c-5b9fe80443ab%40googlegroups.com.
Natalia J. Bayona Vásquez
Environ. Health Science | Inst. of Bioinformatics
Postdoctoral Research Associate
150 E Green St
Athens, GA 30602
e: njba...@gmail.com
w: https://njbayona7.wixsite.com/natalia-bayona

You can remove loci according to missing data levels using the function:For example, removing loci with missing values greater than 90%:miss <- obj %>% missingno("loci", cutoff = 0.9) %>% info_table(plot = TRUE)Best,
El mié., 14 ago. 2019 a las 8:30, Rita Castilho (<rita....@gmail.com>) escribió:
Hi,--I have both genind and genlight objects for a dataset of over 5000 loci. I would like to remove loci from which there is no genotypes for a population, for instance loci 3-4 and 7 in the data below.Any idea how to do it?Thanks,Rita
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 po...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/b0cad310-9fcf-425d-804c-5b9fe80443ab%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/ab201b2f-7caf-4d16-ad1e-f57c25f377f3%40googlegroups.com.
all_loci <- locNames(obj) #vector of all loci
removeloc <- c("3", "4", "7") #loci to remove
keeploc <- setdiff(all_loci, removeloc) #loci to keep
obj_new <- obj[loc = keeploc]Nikolaos Tourvas, BSc
MSc Student in Genetics and Plant Breeding
Laboratory of Forest Genetics and Tree Breeding
Aristotle University of Thessaloniki
https://orcid.org/0000-0002-0476-4468If all you want is to remove loci by specifying their names, it is possible to do. For example in order to remove loci 3,4, and 7 the following would work:
all_loci <- locNames(obj) #vector of all loci
removeloc <- c("3", "4", "7)" #loci to remove
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/ab201b2f-7caf-4d16-ad1e-f57c25f377f3%40googlegroups.com.
I think you may want to give a look to this function
If you set the cutoff to 99.9% for each of your populations you will remove loci that are missing in all individuals.
When you run the function, the console will write the name of each locus that satisfy that condition (missing data greater than 99.9%)
pop_obj %>% missingno("loci", cutoff = 0.999) %>% info_table(plot = FALSE)
As, explained before, the function below is creating a new genind object (which I named the same, but below I will name it differently) that has removed the loci with the greater levels of missing data .
In detail:
#Below I am creating a new genind object that has only the desired population from my starting genind object
pop_obj <- popsub(obj, sublist=c("POPNAME-FROM-INTEREST"))
#Below I am removing from the genind object with one population those loci that have missing data in 99.9% percent of individuals
pop_obj_fil <- missingno(pop_obj, type = "loci", cutoff = 0.999, quiet = FALSE, freq = FALSE)
So you have obj: this is a genind object with all your populations and loci
You have pop_obj: this is a genind object with only genotypes from one population
Best,You have pop_obj_fil: this is a genind object with genotyopes from one population and removing loci that have missing data greater than 99.9%
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/9d48336d-5861-4897-b6a4-0b36463cd0ec%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/9d48336d-5861-4897-b6a4-0b36463cd0ec%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/fcee2747-4843-4073-b7fd-503913739b2a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/fcee2747-4843-4073-b7fd-503913739b2a%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/b41e9b45-083d-42e4-b0fa-7425c5bca1a6%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/b41e9b45-083d-42e4-b0fa-7425c5bca1a6%40googlegroups.com.