<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>
<!--
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif}
a:link, span.MsoHyperlink
{color:#0563C1;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:#954F72;
text-decoration:underline}
span.EmailStyle17
{font-family:"Calibri",sans-serif;
color:windowtext}
.MsoChpDefault
{font-family:"Calibri",sans-serif}
@page WordSection1
{margin:1.0in 1.0in 1.0in 1.0in}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" lang="EN-US" link="#0563C1" vlink="#954F72">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi there,
<br>
<br>
you should be using NA.char="NA", but it does not work in this example. Issue posted there:<br>
<a href="https://github.com/thibautjombart/adegenet/issues/108" target="_blank">https://github.com/thibautjombart/adegenet/issues/108</a><br>
<br>
I'll look into it soon. BTW posting issues on github is the best way to discuss suspected bugs - much easier for the users and developers to keep track of things and solve issues.<br>
<br>
Cheers<br>
Thibaut<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div class="BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="PlainText"> <br>
==============================<br>
Dr Thibaut Jombart<br>
MRC Centre for Outbreak Analysis and Modelling<br>
Department of Infectious Disease Epidemiology<br>
Imperial College - School of Public Health<br>
Norfolk Place, London W2 1PG, UK<br>
Tel. : 0044 (0)20 7594 3658<br>
http://sites.google.com/site/thibautjombart/<br>
http://sites.google.com/site/therepiproject/<br>
http://adegenet.r-forge.r-project.org/<br>
Twitter: @thibautjombart<br>
<br>
<br>
</div>
</span></font></div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF229285"><font color="#000000" face="Tahoma" size="2"><b>From:</b> adegenet-forum-bounces@lists.r-forge.r-project.org [adegenet-forum-bounces@lists.r-forge.r-project.org] on behalf of Doyle, Jacqueline R M [jmdoyle@purdue.edu]<br>
<b>Sent:</b> 16 November 2015 21:24<br>
<b>To:</b> adegenet-forum@lists.r-forge.r-project.org<br>
<b>Subject:</b> [adegenet-forum] trouble with NAs<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal">Hi!</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I am trying to use R to reformat the output from Fluidigm genotyping software into a data frame that can then be used by df2genind. I’ve attached my starting file, which has 95 individuals + 1 negative control genotyped at 96 loci (biallelic
SNPs). I’ve processed the file as follows: </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>data <- read.csv("run4_set1.csv", header =T, skip=15)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>keeps <- c("Assay","Name","Converted")</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>data2 <- data[keeps]</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>data2$Converted <- gsub('No Call','NA',data2$Converted)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>data2 <- data2[- grep("NTC",data2$Converted),]</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>data2$Converted <- gsub('A','1',data2$Converted)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>data2$Converted <- gsub('C','2',data2$Converted)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>data2$Converted <- gsub('G','3',data2$Converted)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>data2$Converted <- gsub('T','4',data2$Converted)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>data2$Converted <- gsub('N1','NA:NA',data2$Converted)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>library(reshape)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>data3 <- cast(data2,Name~Assay)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>obj <- df2genind(data3,ploidy=2,sep=":")</b></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">When I then call “obj” in R I get:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>/// GENIND OBJECT /////////</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>// 95 individuals; 96 loci; 255 alleles; size: 162.5 Kb</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>// Basic content</b></p>
<p class="MsoNormal"><b> @tab: 95 x 255 matrix of allele counts</b></p>
<p class="MsoNormal"><b> @loc.n.all: number of alleles per locus (range: 1-3)</b></p>
<p class="MsoNormal"><b> @loc.fac: locus factor for the 255 columns of @tab</b></p>
<p class="MsoNormal"><b> @all.names: list of allele names for each locus</b></p>
<p class="MsoNormal"><b> @ploidy: ploidy of each individual (range: 2-2)</b></p>
<p class="MsoNormal"><b> @type: codom</b></p>
<p class="MsoNormal"><b> @call: df2genind(X = data3, sep = ":", ploidy = 2)</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>// Optional content</b></p>
<p class="MsoNormal"><b> - empty –</b></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">It looks to me like my “NA” is being read as a third allele (as my loc.n.all range should be 1-2, not 1-3, correct?). I’ve also tried:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>obj <- df2genind(data3,ploidy=2,missing=NA,sep=":")</b></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">But I end up with the same results + the following error:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>Error in df2genind(data3, ploidy = 2, missing = NA, sep = ":") :
</b></p>
<p class="MsoNormal"><b> unused argument (missing = NA)</b></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Could anyone give me some feedback regarding whether or not my NA is actually being recognized as missing data? If not, any suggestions as to how to fix the problem?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Many thanks,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Jackie</p>
</div>
</div>
</div>
</div>
</body>
</html>