gl.plot.structure problem / missing data?

72 views
Skip to first unread message

Nicole Mihelich

unread,
Dec 29, 2022, 11:19:45 PM12/29/22
to dartR
Hello,

I have run structure on my dataset and seem to have the appropriate output, except that I get the following warning messages upon completion of gl.run.structure:

1: Removed 5 rows containing missing values (geom_segment).
2: Removed 5 rows containing missing values (geom_segment).
3: Removed 5 rows containing missing values (geom_segment).

Is this something to be concerned about? I have pretty heavily filtered my dataset, and here are the stats: 186 genotypes,  570 binary SNPs, 11.67 % missing data

I then tried to proceed with gl.plot.structure(), but I get the error message:

Error in h(simpleError(msg, call)) :
  error in evaluating the argument 'x' in selecting a method for function 'as.matrix': non-numeric matrix extent

What does this error mean? Does it have something to do with missing data/the warning messages I received during gl.run.structure? How do I resolve this problem for my data? 

I tried run, plot, and map structure with the bandicoot.gl[1:100] data, and it worked fine. 

Thank you very much for your help!

Best,

Nicole

Bernd.Gruber

unread,
Dec 30, 2022, 5:32:21 AM12/30/22
to da...@googlegroups.com

Hi Nicole,

just a guess, but it might be that your coordinates are not valid for all individuals.

you should not have missing coordinates for any individuals.

as a quick check you can use

summary(gl@other$latlon)

and there should only be lat lon’s and no NAs or coordinates such as zero etc.

you can check also via

gl.map.interactive if you get a warning using this command (it is quicker than running the structure procedure).

Cheers, Bernd

————————————————————————————————————

Bernd Gruber

Professor Spatial and Ecological Modelling

Institute for Applied Ecology 

P 02 62063804  E bernd....@canberra.edu.au

appliedecology.edu.au

University of Canberra, ACT 2617

NOTICE & DISCLAIMER: This email and any files transmitted with it may contain confidential or copyright materials and are for the attention of the addressee only. If you have received this email in error please notify us by email reply and delete it from your system. The University of Canberra accepts no liability for any damage caused by any virus transmitted by this email.Australian Government Higher Education (CRICOS)Registered Provider number: #00212K
————————————————————————————————————

On 30 Dec 2022, at 15:19, 'Nicole Mihelich' via dartR <da...@googlegroups.com> wrote:

Hello,
--
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/5982668e-8d94-4880-bcbc-fff7e81f5827n%40googlegroups.com.

Jose Luis Mijangos

unread,
Jan 3, 2023, 11:10:50 PM1/3/23
to dartR
Hi Nicole,

Structure truncates individual names at 11 characters. The function will fail if the names of individuals are not unique after truncation. To avoid this possible problem, a number sequence, as  shown in the code below, might be used instead of individual names.

> indNames(gl) <- as.character(1:length(indNames(gl)))

I have added this point in the function documentation and it's available in the developing version of dartR which can be installed as below:

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

Cheers,
Luis

Nicole Mihelich

unread,
Jan 6, 2023, 6:04:35 AM1/6/23
to dartR
Hi Luis,

Thanks so much; it is indeed working now! No errors or warnings. I greatly appreciate your help!

Best,

Nicole

Brianna Coulter

unread,
Mar 20, 2023, 10:43:58 PM3/20/23
to dartR
Hi Luis and Bernard,

I appear to be having this same issue. I've trialled renaming the individuals with a number sequence but I still get the same error when I run gl.plot.structure(). I do not have lat/longs for any of the individuals. Is this my problem?

Many thanks,
Brianna.

Jose Luis Mijangos

unread,
Mar 22, 2023, 12:23:47 AM3/22/23
to dartR
Hi Brianna,

I did not get any error using the subset of the data you sent me.

library(dartR)
bc <- gl.load("test.rds")
sr <- gl.run.structure(bc, k.range = 2:5, num.k.rep = 3, exec = './structure')
ev <- gl.evanno(sr)
qmat <- gl.plot.structure(sr, K=3)

Could you try installing the beta version of dartR, see below, and then try again running the function?

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

Cheers,
Luis 

Brianna Coulter

unread,
Mar 23, 2023, 7:40:36 AM3/23/23
to dartR
Hi Luis,

Thanks for the suggestion. I had trialled reinstalling vanilla dartR before to no avail.

I have however solved the problem. I was running gl.run.structure() without num.k.rep but had numreps. Including num.k.rep appears to have solved this problem.

Thank you very much for your help.

Cheers,
Brianna.
Reply all
Reply to author
Forward
0 new messages