dear Arthur and Bernd,
I want to use NewHybrids and found your function gl.nhybrids to produce the input files.
However, I get errors both with the example code as well as with my own data:
d.gl2
/// GENLIGHT OBJECT /////////
// 119 genotypes, 6,855 binary SNPs, size: 2.5 Mb
26295 (3.22 %) missing data
// Basic content
@gen: list of 119 SNPbin
// Optional content
@ind.names: 119 individual labels
@loc.names: 6855 locus labels
@chromosome: factor storing chromosomes of the SNPs
@position: integer storing positions of the SNPs
@pop: population of each individual (group size range: 5-12)
@other: a list containing: loc.metrics loc.metrics.flags verbose
> gl.nhybrids(
+ d.gl2,
+ outfile = "nhyb.txt",
+ #outpath = tempdir(),
+ p0 = c("OS"),# NULL,
+ p1 = c("CA","MA","PA","SA"),
+ threshold = 0,
+ method = "random",#"AvgPIC"
+ plot = TRUE,
+ pprob = 0.95,
+ nhyb.directory = NULL,
+ BurnIn = 10000,
+ sweeps = 10000,
+ GtypFile = "TwoGensGtypFreq.txt",
+ AFPriorFile = NULL,
+ PiPrior = "Jeffreys",
+ ThetaPrior = "Jeffreys",
+ verbose = NULL
+ )
Error in gl.nhybrids(d.gl2, outfile = "nhyb.txt", p0 = c("OS"), p1 = c("CA", :
unused arguments (threshold = 0, plot = TRUE, pprob = 0.95, verbose = NULL)
> m <- gl.nhybrids(testset.gl, outfile="nhyb.txt", c("Pop1", "Pop4"), c("Pop7", "Pop9"), t=0, method="random")
Starting gl.nhybrids: Assigning individual to hybrid categories
Only one parental population specified
Selecting ca 200 random loci
Subsampling at random, approximately 200 loci from genlight object
No. of loci retained = 128
Note: SNP metadata discarded
Converting data to NewHybrids format
Adding sequential number and flagging parental stock
Writing the NewHybrids input file Pop1/nhyb.txt Pop4/nhyb.txt
NumIndivs 250
NumLoci 128
Digits 1
Format Lumped
Error in file(file, if (append) "a" else "w") :
invalid 'description' argument
So it is difficult for me to check where my error is.
Could you have a look, please?
Best regards
Walter