Unable to run gl.read.dart

255 views
Skip to first unread message

Kate Cornelsen

unread,
Jun 17, 2022, 10:00:44 PM6/17/22
to dartR
Hi everyone,

Hoping someone may be able to assist me with an error I am encountering with the dartR package. 

I recently had to reinstall dartR and since reinstalling the package, the gl.read.dart function is no longer able to read the data file. The code and data inputted has not changed (which worked fine previously) and so I am assuming it's something to do with reinstalling dartR. 

This is what I entered:

test.gl <- gl.read.dart(filename = "Report_DMarc21-6505_3_SNP_data.csv", ind.metafile = "animal_metadata.csv")

Which produces the following:

Starting gl.read.dart
Starting utils.read.dart
Topskip not provided.
Setting topskip to 6 .
Reading in the SNP data
Detected 1 row format.
Added the following locus metrics:
AlleleID CloneID AlleleSequence TrimmedSequence SNP SnpPosition CallRate OneRatioRef OneRatioSnp FreqHomRef FreqHomSnp FreqHets PICRef PICSnp AvgPIC AvgCountRef AvgCountSnp RepAvg .
Number of rows per clone (should be only 1 s): 1
Number of rows per clone (should be only 1 s): 2

Error in if (nrows != as.numeric(names(tt)))
{ : the condition has length > 1

Which then stops the function from proceeding.

I have tried running the code on both a MacOS (10.13) and WindowsOS and with the latest version of R (4.2.0) with the same result.

I have followed the dartR installation steps in the tutorial provided and so I am confident that I have installed the package correctly. I also tried installing older versions of the package with the same result. 

Is there something else I can try to fix this problem? Any advice would be greatly appreciated!

Many thanks,

Kate

Berry, Olly (NCMI, IOMRC Crawley)

unread,
Jun 17, 2022, 10:33:21 PM6/17/22
to da...@googlegroups.com
Hi Kate,
Is you input data indeed one row format?
I’m just wondering whether there is some minor variation in that file that is tripping up the function.
I recently reinstalled a newer version of dartR and it imported my data fine.
Cheers,
Olly

—-
Director, CSIRO Environomics Future Science Platform

From: da...@googlegroups.com <da...@googlegroups.com> on behalf of Kate Cornelsen <cornels...@gmail.com>
Sent: Saturday, June 18, 2022 10:00:44 AM
To: dartR <da...@googlegroups.com>
Subject: [dartR] Unable to run gl.read.dart
 
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/dartr/c0cce324-7908-411b-81a0-107e2b138ff8n%40googlegroups.com.

Kate Cornelsen

unread,
Jun 19, 2022, 8:11:35 PM6/19/22
to dartR
Screen Shot 2022-06-20 at 9.36.01 am.png

Hi Olly,

Thank you for replying.

The data is the same. Are you able to explain what you mean by one row format?

Not sure if this helps, but I have attached a screenshot of the column format of my SNP data that I am inputting into R.

Many thanks,
Kate 


Jose Luis Mijangos

unread,
Jun 19, 2022, 9:09:34 PM6/19/22
to dartR
Hi Kate,

Please send me your dataset to my e-mail (luis.m...@gmail.com), so I can help you solve your problem.

Cheers,
Luis

Jose Luis Mijangos

unread,
Jun 19, 2022, 10:08:39 PM6/19/22
to dartR
Hi Kate,

The problem is that in your DArT report there are two SNPs with the same clone ID:
1. Clone ID 22611271 in rows 1848 and 18148
2. Clone ID 22611730 in rows 16542 and 18367

To fix this problem I would recommend deleting these four rows and then trying again to read your DArT report.

I will contact DArT bioinformaticians to check the source of the problem.

Regards,
Luis

Kate Cornelsen

unread,
Jun 19, 2022, 10:55:30 PM6/19/22
to dartR
Hi Luis,

Thanks so much! 

I just deleted all the rows with the duplicate Clone IDs, as you suggested. I found a third row (20296) with the Clone ID 22611271 as well, which I also deleted. The function seems to run without any errors now. I'm not sure why the same data seemed to run fine previously without removing the duplicates, but I am glad it is working again! 

If you are able to check with DArT, that would be great. 

Thanks again,
Kate

Reply all
Reply to author
Forward
0 new messages