Issue with gl.read.dart() throwing indNames(NULL) despite clean metadata

14 views
Skip to first unread message

Hakan Aydogan

unread,
May 5, 2025, 9:11:30 PMMay 5
to dartR

Hello dartR community,

I’m encountering a persistent error when trying to import my DArT data and attach sample metadata in one step with gl.read.dart(..., ind.metafile=...). Below is a concise summary of what happened and what I’ve tried so far.

```{r}
#Extract my Final plate
library(dartR.base)
library(dartR.data)
final <- gl.read.dart(filename = "D:/Final_plates/dartR/All_plates_edited/Report_DCot24-9524_4_moreOrders_SNP_3.csv", ind.metafile = "D:/Final_plates/dartR/All_plates_edited/cleaned_metadata.csv")
```

Ids for individual metadata (at least a subset of) are matching! Found 318 matching ids out of 318 ids provided in the ind.metadata file.

Error: unable to find an inherited method for function ‘indNames’ for signature ‘x = "NULL"’

I made sure no white spaces or duplicates in the metadata file. The id names and genotypes exactly matches in both files. 

Then, I tried an alternative method:

```{r}
gl <- gl.read.dart("D:/Final_plates/dartR/All_plates_edited/Report_DCot24-9524_4_moreOrders_SNP_3.csv")

gl <- gl.add.indmetrics(
        gl,
        ind.metafile = "D:/Final_plates/dartR/All_plates_edited/cleaned_metadata.csv")

```

This time it seems like it worked successfully but maybe there is an error I couldn't notice. I wanted to ask your opinion in regards to why I got the error in my first attempt. I couldn't find this error in the forum search.

Jose Luis Mijangos

unread,
May 5, 2025, 10:34:52 PMMay 5
to dartR
Hi Hakan,

Thank you for reporting that bug. The issue has been solved, and it is available in the developing version of dartR.base, which can be installed as shown below:

devtools::install_github("green-striped-gecko/dartR.base@dev")
library(dartRverse)
final <- gl.read.dart(filename = "Report_DCot24-9524_4_moreOrders_SNP_3.csv",
                      ind.metafile = "cleaned_metadata.csv")

Cheers,
Luis

Reply all
Reply to author
Forward
0 new messages