gbradburd / conStruct

method for modeling continuous and discrete population genetic structure
35 stars 14 forks source link

conStruct analysis #27

Closed AnjumanArif closed 4 years ago

AnjumanArif commented 4 years ago

can not understand what is this error while running conStruct."Error in if (any(args[["geoDist"]] < 0)) { : missing value where TRUE/FALSE needed".** I have checked everything is fine. Please help

petrelharp commented 4 years ago

Sorry to hear that you are having difficulties! To help debug your problem, could you please post the code you are running to produce the error, and at least a description of the input files?

AnjumanArif commented 4 years ago

Hi, Thanks for replying. I have 192 genotypes with 12763 loci in construct file. I am using these commands as below for data construction and attaching the longitude and latitude file (coord) and out file (geoDist) in excel fomat after copying from RStudio. : Also attaching a subset of structure text file of all SNPs. x<-as.numeric(c(142.702789,--------------------)) length(x) 192 long<-x x<-as.numeric(c(-20.917574,)) length(x) lati<-x coord<-cbind(long,lati) is.matrix(coord)

alleleFreq matrix----

output file freqs used for analysis as such after structure2conStruct formatting.

geoMatrix

fields::rdist.earth(x1 = coord,x2 = NULL, miles = TRUE, R = NULL) out<- rdist.earth (coord) upper<- col(out)> row( out) hist( out[upper]) geoDist<-out

conStruct analysis----

data(anjumConStruct)

anjumConStruct <- list(freqs=freqs, coord=coord, geoDist=geoDist)

my.run<- conStruct(spatial = TRUE, K = 3, freqs = anjumConStruct$freqs, geoDist = anjumConStruct$geoDist, coords = anjumConStruct$coord, prefix = "spK3", n.chains = 1, n.iter = 1000, make.figs = TRUE, save.files = TRUE)

my.run <- conStruct(spatial = TRUE, K = 3, freqs = anjumconStruct$freqs, geoDist = anjumconStruct$geoDist, coords = anjumconStruct$coord, prefix = "spK") I am recieving this error as below: Error in if (any(args[["geoDist"]] < 0)) { : missing value where TRUE/FALSE needed

I will cordially appreciate your help. Thanks and stay blessed Anjum

On Thu, Oct 31, 2019 at 9:11 PM Peter Ralph notifications@github.com wrote:

Sorry to hear that you are having difficulties! To help debug your problem, could you please post the code you are running to produce the error, and at least a description of the input files?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gbradburd/conStruct/issues/27?email_source=notifications&email_token=AMOFTPBMKSZ4SIRLKGHFPMLQRL7SXA5CNFSM4JHIAKP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECYLE4Y#issuecomment-548450931, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMOFTPFHTCE66YRU7TLJ2MDQRL7SXANCNFSM4JHIAKPQ .

AnjumanArif commented 4 years ago

Hi, I have resolved the issue for this part. If required will get back for assistance.

AnjumanArif commented 4 years ago

thanks a lot.