<div dir="ltr"><div>Sorry for the late reply. You should use</div><div><br></div><div>ploidy(SNPs_Ploidy) <- c(4, 2, 4, 4, 4, 4, 2, 4, 4, 4)</div><div><br></div><div>The error you were getting was due to the fact that you were passing a single character to the ploidy function. It expects a numeric or integer vector. <br>
</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 7, 2023 at 3:00 AM <<a href="mailto:adegenet-forum-request@lists.r-forge.r-project.org">adegenet-forum-request@lists.r-forge.r-project.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[This email originated from outside of OSU. Use caution with links and attachments.]<br>
<br>
Send adegenet-forum mailing list submissions to<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.r-forge.r-project.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fadegenet-forum&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bG8Wst5oV9ydVbOSht3bk9xkGVL30URVN4SYetZxVKM%3D&reserved=0" rel="noreferrer" target="_blank">https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.r-forge.r-project.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fadegenet-forum&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bG8Wst5oV9ydVbOSht3bk9xkGVL30URVN4SYetZxVKM%3D&reserved=0</a><br>
<br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:adegenet-forum-request@lists.r-forge.r-project.org" target="_blank">adegenet-forum-request@lists.r-forge.r-project.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:adegenet-forum-owner@lists.r-forge.r-project.org" target="_blank">adegenet-forum-owner@lists.r-forge.r-project.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of adegenet-forum digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Changing Ploidy (Swati...)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 6 Feb 2023 13:06:12 +0100<br>
From: "Swati..." <<a href="mailto:swatipuraanik@gmail.com" target="_blank">swatipuraanik@gmail.com</a>><br>
To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
Subject: [adegenet-forum] Changing Ploidy<br>
Message-ID:<br>
<CAD-12nFrXh1F7DdP=<a href="mailto:b34T0q5q8QqLToyLaANQOQ2W591HjLMmQ@mail.gmail.com" target="_blank">b34T0q5q8QqLToyLaANQOQ2W591HjLMmQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello,<br>
<br>
I have a Genlight object as below:<br>
<br>
> SNPs_Ploidy /// GENLIGHT OBJECT /////////<br>
<br>
// 78 genotypes, 8,368 binary SNPs, size: 33.2 Mb<br>
23935 (3.67 %) missing data<br>
<br>
// Basic content<br>
@gen: list of 78 SNPbin<br>
*@ploidy: ploidy of each individual (range: 2-2)*<br>
<br>
// Optional content<br>
@ind.names: 78 individual labels<br>
@loc.names: 8368 locus labels<br>
@loc.all: 8368 alleles<br>
@position: integer storing positions of the SNPs<br>
@pop: population of each individual (group size range: 3-50)<br>
@other: a list containing: loc.metrics ind.metrics<br>
loc.metrics.flags verbose history<br>
<br>
<br>
As you can see @ploidy: ploidy of each individual (range: 2-2). However the<br>
78 individuals in my dataset have all different ploidies ranging from 2X to<br>
6X. I tried using these commands:<br>
<br>
> head(ploidy(SNPs_Ploidy), 10)<br>
<br>
Ac-3 Ac-359 Ac-25 Ac-75 Ac-182 Ac-210 Ac-272 Ac-317 Ac-333 Ac-344<br>
<br>
2 2 2 2 2 2 2 2 2 2<br>
<br>
<br>
<br>
> ploidy(SNPs_Ploidy) <- paste("4", "2", "4", "4", "4", "4", "2", "4", "4",<br>
"4", sep=" ")<br>
<br>
<br>
But I get this error message:<br>
<br>
Error in `ploidy<-`(`*tmp*`, value = "4 2 4 4 4 4 2 4 4 4") :<br>
(converted from warning) NAs introduced by coercion<br>
<br>
Is it possible to change the ploidy and what could be the appropriate<br>
commands?<br>
<br>
Best Regards<br>
Swati<br>
--------------------------------------------------------------- _<br>
---------- ----------------------<br>
*SWATI PURANIK , Ph.D., MSCA Fellow*<br>
Junior Researcher<br>
Global Change Research Institute (CzechGlobe), Czech Academy of Sciences<br>
Bělidla 986/4a, 603 00 Brno; Czech Republic<br>
E-mail: s <<a href="mailto:manoj_prasad@nipgr.ac.in" target="_blank">manoj_prasad@nipgr.ac.in</a>><a href="mailto:watipuraanik@gmail.com" target="_blank">watipuraanik@gmail.com</a><br>
Google Scholar<br>
<<a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fscholar.google.cz%2Fcitations%3Fhl%3Den%26user%3DQTwp1YMAAAAJ%26view_op%3Dlist_works%26gmla%3DAJsN-F4LFxJUHZv94qOgQg1ss_nyV9cNg6V6j_dF1gJ583sGeqPI69W6l7-SoBBTETQnD57xSf7SBGngfv45kzo-m7yqUWmTLP2FKlR5zx6LQ6ANEkrQ5wo&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dph0kFoO%2BP32bALC%2Fba24gbrsn%2Fy%2B5NJPS7eVHruYwg%3D&reserved=0" rel="noreferrer" target="_blank">https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fscholar.google.cz%2Fcitations%3Fhl%3Den%26user%3DQTwp1YMAAAAJ%26view_op%3Dlist_works%26gmla%3DAJsN-F4LFxJUHZv94qOgQg1ss_nyV9cNg6V6j_dF1gJ583sGeqPI69W6l7-SoBBTETQnD57xSf7SBGngfv45kzo-m7yqUWmTLP2FKlR5zx6LQ6ANEkrQ5wo&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dph0kFoO%2BP32bALC%2Fba24gbrsn%2Fy%2B5NJPS7eVHruYwg%3D&reserved=0</a>><br>
| ResearchGate <<a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.researchgate.net%2Fprofile%2FSwati_Puranik&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=r2FvcpfdjCWZS1kB46fVVvX5%2FTdELgKGjOdIuFR8UPw%3D&reserved=0" rel="noreferrer" target="_blank">https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.researchgate.net%2Fprofile%2FSwati_Puranik&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=r2FvcpfdjCWZS1kB46fVVvX5%2FTdELgKGjOdIuFR8UPw%3D&reserved=0</a>><br>
ORCID ID: *<a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Forcid.org%2F0000-0003-1787-1550&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7XutS2%2BtWAJPl%2FaS3wCSRxBEcdL1pv6WLJPnqosDghI%3D&reserved=0" rel="noreferrer" target="_blank">https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Forcid.org%2F0000-0003-1787-1550&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7XutS2%2BtWAJPl%2FaS3wCSRxBEcdL1pv6WLJPnqosDghI%3D&reserved=0</a><br>
<<a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Forcid.org%2F0000-0003-1787-1550&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7XutS2%2BtWAJPl%2FaS3wCSRxBEcdL1pv6WLJPnqosDghI%3D&reserved=0" rel="noreferrer" target="_blank">https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Forcid.org%2F0000-0003-1787-1550&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7XutS2%2BtWAJPl%2FaS3wCSRxBEcdL1pv6WLJPnqosDghI%3D&reserved=0</a>>*<br>
----------------------------------------------------------------------------------<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.r-forge.r-project.org%2Fpipermail%2Fadegenet-forum%2Fattachments%2F20230206%2F5ffac6fe%2Fattachment-0001.html&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=vB2hNspTUtHHWpnGnPVu4VhBxNFNFhmTtDwzX2rgS94%3D&reserved=0" rel="noreferrer" target="_blank">https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.r-forge.r-project.org%2Fpipermail%2Fadegenet-forum%2Fattachments%2F20230206%2F5ffac6fe%2Fattachment-0001.html&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=vB2hNspTUtHHWpnGnPVu4VhBxNFNFhmTtDwzX2rgS94%3D&reserved=0</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.r-forge.r-project.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fadegenet-forum&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bG8Wst5oV9ydVbOSht3bk9xkGVL30URVN4SYetZxVKM%3D&reserved=0" rel="noreferrer" target="_blank">https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.r-forge.r-project.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fadegenet-forum&data=05%7C01%7Ckamvarz%40science.oregonstate.edu%7Ccee51a0028bb4d8abe4908db08fa78ac%7Cce6d05e13c5e4d6287a84c4a2713c113%7C0%7C0%7C638113644094436648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bG8Wst5oV9ydVbOSht3bk9xkGVL30URVN4SYetZxVKM%3D&reserved=0</a><br>
<br>
------------------------------<br>
<br>
End of adegenet-forum Digest, Vol 152, Issue 1<br>
**********************************************<br>
</blockquote></div>