Running newhybrids on PC through dartR

203 views
Skip to first unread message

Christiana McDonald-Spicer

unread,
Dec 8, 2021, 1:16:37 AM12/8/21
to dartR

This is an outline of what Luis helped me figure out, for general consumption:

*** using the current dev version of dartR (Version 2.3.3)

 1. Download newhybrids from https://github.com/green-striped-gecko/dartR/tree/master/binaries. You will need to download the exe file in the ‘pc’ subfolder

2. Place newhybrids IN your working directory. The process does not work if newhybrids is in a different directory, as newhybrids is trying to look at files that are in the same folder as itself. You can either make lots of copies of newhybrids in your working folders, or change the working directory to where newhybrids is stored. Option two means your newhybrids outputs will be written to this new directory.

3. Run newhybrids via the r code :

m <- gl.nhybrids(testset.gl, outfile='nhyb.txt',

                 p0=NULL, p1=NULL,

                 nhyb.directory=getwd(),

                 BurnIn=100,

                 sweeps=100,

                 verbose=3)

 

Things to note:

 If you have spaces anywhere in your path name it won’t work. Newhybrids does not understand spaces in path names.

 Sometimes firewalls will prevent the exe file running, if this happens you may have to provide permissions through the firewall program

Christine Dudgeon

unread,
Apr 14, 2024, 11:37:02 PM4/14/24
to dartR
Hi
thanks for posting your solution to the newhybrids issue for running through dartR in PC.  Unfortunately I am still getting stuck and can't get this to run.  I have tried numerous solutions but the main problem I keep coming back to is:

Error in gl.nhybrids(gl7, p0 = NULL, p1 = NULL, nhyb.directory = getwd(), : Fatal Error: New Hybrids executable not found in C:\Users\uqcdudge\Documents\R\Nhybridexecutable ; required
I have followed the process recommended here by downloading the newhybrids.exe file from the github and placing in my working directory.  But it doesn't recognise it.  I have placed it in different directories but still the same issue.  I have tried the code recommended by Luis to direct the path to the working directory.  I seem to be missing something but can not figure it out.  any help would be greatly appreciated - thanks!!!

path_to_nhybrids <- "~/R/Nhybridexecutable"
system(paste0("chmod 755 ",path_to_nhybrids))

noparentspec <- gl.nhybrids(gl7, out
                            p0=NULL, p1=NULL,
                           outpath = "~/R/Nhybridexecutable",
                           nhyb.directory = getwd(),
                           method = "AvgPIC",
                           BurnIn = 1000,
                           sweeps = 1000,
                           verbose = 3)
Reply all
Reply to author
Forward
0 new messages