Error with gl.drop.ind / gl.keep.ind

33 views
Skip to first unread message

Molly Garrett

unread,
Apr 13, 2023, 5:58:42 PM4/13/23
to dartR
Hello!

I have a genlight object with 80 genotypes and 3,575 SNPs. I successfully used gl.keep.loci to make a new genlight object with only 305 of the loci with the following code: 

RAD_305 <- gl.keep.loc(RADgenlight, loc.list=c(x))
x is a list of the 305 loci. 

I would now like to remove individuals from RAD_305. Here is the code I'm using: 

RAD_305 <- gl.drop.ind(RAD_305, ind.list = c('004','LZ19','LZ79','LZD9','MZ29','MZ99','MZQ9','NZE9','NZF9','UZZJ','VZ7J','WZ1J'))

But I receive this error: 
Error in `$<-.data.frame`(`*tmp*`, "AvgPIC", value = c(NA, NA, NA, NA,  :
  replacement has 305 rows, data has 1

I've tried using gl.keep.ind with the list of samples I want to keep, but I get the same error as the one above. I've confirmed that all the samples are present in RAD_305. 

Session info: 
R version 4.2.3 (2023-03-15)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.2.1
dartR_2.7.2  

Thank you! 

Jose Luis Mijangos

unread,
Apr 14, 2023, 12:09:03 AM4/14/23
to dartR
Hi,

It seems to be a problem with the implementation of our new object "dartR". Can you please try installing the developing version of dartR as follows:

> library(devtools)
> install_github("green-striped-gecko/dartR@dev")

And then try again running the function. 

Cheers,
Luis 

Molly Garrett

unread,
Apr 17, 2023, 3:24:10 PM4/17/23
to da...@googlegroups.com
Hello,

Thank you for the quick response! Unfortunately, after installing the developing version, neither “gl.drop.ind” or “gl.keep.loc” are can be found. I have switched between both the system’s version and development version of dartR and still can’t use “gl.drop.ind”.

Molly Garrett (she/her)
PhD Candidate
Department of Fish and Wildlife Sciences
University of Idaho


-- 
You received this message because you are subscribed to a topic in the Google Groups "dartR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dartr/ZGRHTRl9EyU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dartr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dartr/2723dace-e186-4361-959b-3c7a58c9659dn%40googlegroups.com.

Peter Kriesner

unread,
Apr 26, 2023, 2:02:36 AM4/26/23
to da...@googlegroups.com
Hi folks,

I've just updated my version of R to 4.3 and am now having problems with running various dartR functions.

For instance when I try to run gl.report.secondaries(gl) I get the following:
The column 'TrimmedSequence' was not found in loc.metrics
 Mean tag length assumed to be 69
Error in p1/p2 : non-numeric argument to binary operator

My current dataset has "TrimmedSequenceRef" and "TrimmedSequenceSnp" columns, but if I delete the second column and rename the first to "TrimmedSequence" before reading the file in, I still get the warning and the error.

I did not previously have this problem with this data set. I'm also now getting the same error for various other dartR functions, even with the test data sets. I've tried this with both the current CRAN version of dartR (v2.7.2) and with the developmental version (v2.9.4).

Cheers,
Peter



--
You received this message because you are subscribed to the Google Groups "dartR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dartr+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages