Error in gl.read.dart

201 views
Skip to first unread message

Nadya

unread,
Apr 8, 2022, 4:39:01 AM4/8/22
to dartR
Hi everyone,

Since downloading the newest dartR version I am getting an error when trying to load the genlight object (csv file) containing SNP data:

gl <-gl.read.dart("Cotter Data.csv", topskip=6, covfilename = "Cotter Covariante.csv")
Starting gl.read.dart
Starting utils.read.dart
  Reading in the SNP data
Error in utils.read.dart(filename = filename, nas = nas, topskip = topskip,  :
  object 'tdummy' not found

I wasn't able to fix this error even with running the source code for utils.read.dart from https://rdrr.io/cran/dartR/src/R/utils.read.dart.r  before.

Would very much appreciate some help :)
thanks,
Nadya




Jose Luis Mijangos

unread,
Apr 10, 2022, 8:54:39 PM4/10/22
to dartR
Hi Nadya,

Can you try the following without the parameter topskip and instead of covfilename use ind.metafile, as follows:

dartfile <- system.file('extdata','testset_SNPs_2Row.csv', package='dartR')
metadata <- system.file('extdata','testset_metadata.csv', package='dartR')
gl <- gl.read.dart(dartfile, ind.metafile = metadata)

Cheers,
Luis
Message has been deleted

Blanche D'Anastasi

unread,
Apr 10, 2022, 10:23:43 PM4/10/22
to dartR
Hi Luis,

Could you please help me to trouble shoot?

> gl <- gl.read.dart(filename = "SNP1row_All_Aipysurus_for_analysis5.csv", topskip = 3, ind.metafile = "ind_metrics5.csv")

Starting gl.read.dart
Starting utils.read.dart
  Reading in the SNP data
Error in utils.read.dart(filename = filename, nas = nas, topskip = topskip,  :
  object 'tdummy' not found

I am getting a similar error to Nadya on files that worked in the previous version of DArTR.
I have tried reformatting the data files in every way I can think of and they just won't run (EOL conversion; deleting the extra line that Notepad++ adds; deleting excessive columns relating to genomes and just leaving one in; deleting the number of rows at the top so that is has the critical data and the same number of rows as the test data set). 
The function works fine on the test data; and the code you gave to Nadya runs just fine.
I have updated to the latest version of R and R Studio, and made sure that all packages are up to date.

Thanks so much,
Blanche

Jose Luis Mijangos

unread,
Apr 10, 2022, 10:27:53 PM4/10/22
to dartR

Hi Blanche,

Can you try, not using the parameter (topskip):

> my_gl <- gl.read.dart(filename = "SNP1row_All_Aipysurus_for_analysis5.csv", ind.metafile = "ind_metrics5.csv")

NB Try not using the variable "gl" because it is a function in base R.

Cheers,
Luis

Blanche D'Anastasi

unread,
Apr 10, 2022, 10:35:49 PM4/10/22
to dartR
Thanks - I just tried your suggestion without topskip, and with topskip and received the following errors:

> my_gl <- gl.read.dart(filename = "SNP1row_All_Aipysurus_for_analysis5.csv", ind.metafile = "ind_metrics5.csv")
Starting gl.read.dart
Starting utils.read.dart
  Topskip not provided.
 Setting topskip to 2 .

  Reading in the SNP data
Error in utils.read.dart(filename = filename, nas = nas, topskip = topskip,  :
  Could not determine number of data columns based on RepAvg !

> my_gl <- gl.read.dart(filename = "SNP1row_All_Aipysurus_for_analysis5.csv", topskip = 3, ind.metafile = "ind_metrics5.csv")

Starting gl.read.dart
Starting utils.read.dart
  Reading in the SNP data
Error in utils.read.dart(filename = filename, nas = nas, topskip = topskip,  :
  object 'tdummy' not found
Reply all
Reply to author
Forward
0 new messages