Error in gl2vcf

143 views
Skip to first unread message

Marcelo Rosas

unread,
Nov 28, 2022, 12:26:42 PM11/28/22
to dartR
Hi dartR team, & Luis

with a genlight object created with dartR, I can generate reports, monomorphs, overshoot, reproducibility and callrate filters. I can save as rds and csv . But when I try to export to PLINK and save I get the error
 
Error in names(x) <- value :
  'names' attribute [2] must be the same length as the vector [1]  
 
the same error also occurs when trying to export as vcf with   gl2vcf

thanks

Marcelo Rosas

Elspeth McLennan

unread,
Mar 16, 2023, 11:24:35 PM3/16/23
to dartR
Hi Marcelo, 

I'm having the same problem when trying to convert gl2plink. Did you have any luck getting this one to work?

Thanks, 
Elle

Jose Luis Mijangos

unread,
Mar 16, 2023, 11:30:41 PM3/16/23
to da...@googlegroups.com
Hi Elle,

I think this bug has been fixed and it is available in the beta version of dartR. You can installl this version as shown below:

> library(dartR)
> gl.install.vanilla.dartR(flavour = "dev”)

Than please try again to run the gl2plink function .

Cheers,
Luis

> On 17 Mar 2023, at 2:24 pm, Elspeth McLennan <elle.mc...@gmail.com> wrote:
>
> Elle


Elspeth McLennan

unread,
Mar 19, 2023, 6:25:51 PM3/19/23
to dartR
Hi Luis, 

That worked perfectly, thank you!

Cheers, 
Elle

Elspeth McLennan

unread,
Jul 24, 2024, 12:10:13 AMJul 24
to dartR
Hi Luis, 

Unfortunately I've run into this problem again when trying to convert to a plink format - it works with another one of my datasets so I'm thinking it must be something I'm doing wrong or with my data. I have tried the following from another post but am getting the same result:
# assigning chromosome information
gl_drop$chromosome <- gl_drop$other$loc.metrics$Chrom_Tammar_Chrom_NCBIv1
# assigning position information
gl_drop$position <- test$other$loc.metrics$ChromPos_Tammar_Chrom_NCBIv1
# converting to bed file
gl2plink(gl_drop, outfile = "plink_pw", outpath = "./", bed_file = TRUE)

Then getting this error:
> gl2plink(gl_drop, outfile = "plink_pw", outpath = "./", bed_file = TRUE) Starting gl2plink Processing genlight object with SNP data Chromosome slot is empty. Using 1 as dummy name. Error in names(x) <- value : 'names' attribute [2] must be the same length as the vector [1]

It may be to do with how I'm trying to rename the chromosomes? I wasn't sure where your example came from with the platypus.

Happy to send over my gl_drop.Rdata file if you need.

Thank you for your help in advance!
Elle

Jose Luis Mijangos

unread,
Jul 25, 2024, 11:00:12 PMJul 25
to dartR
Hi Elle,

Can you please try installing the developing version of dartR.base as shown below. Note the change in the name of the parameter "bed.files". Also, the plink executable should be in your working directory. Double click on your plink executable to make sure that it can be run without issues.

#installing the developing version of dartR.base
devtools::install_github("green-striped-gecko/dartR.base@dev")
library(dartRverse)
load("gl_drop.Rdata")

gl2plink(gl_drop,
         outfile = "plink_pw",
         outpath = "./",
         bed.files = TRUE)

Cheers,
Luis 

Elspeth McLennan

unread,
Jul 29, 2024, 8:00:54 PMJul 29
to da...@googlegroups.com
Hi Luis, 

That worked - thank you!

Elle

--
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/kgifqNZN8Xc/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/abf9f9d5-a739-4c89-9680-791791ea5c4an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages