text: user136: Is there a pedigree viewer that works with PLINK pedigree files? I saw an old post by Pierre, but I don't see the script on his blog.
  
  user373: We use kinship2 R package to visualize pedigree files (.fam plink files). For some reasons, some characters from plink ped aren't supported (like "-9" for unknown genre or affected status).
  Here is the R script we use:  
  args<-commandArgs(TRUE)
  pedPath<-args[1]
  pdfFile<-args[2]
  
  library(kinship2)
  pedfile <- read.table(pedPath,sep="\t")
  pedfile$V5 <- apply(pedfile,1,function(data){if(data[5] == 1 || data[5] ==2){data[5]}else{3}}) 
  pedfile$affected <- apply(pedfile,1,function(data){if(as.numeric(data[6]) == 1){res <- data[6]}else{if(as.numeric(data[6]) == 2){res <- data[6]}else{res <- NA}}})
  
  familyIDs <- as.character(unique(pedfile$V1))
  
  pdf(file=pdfFile)
  for(famID in familyIDs){
      ped <- pedigree(id=as.character(pedfile$V2[pedfile$V1==famID]),dadid=as.character(pedfile$V3[pedfile$V1==famID]),momid=as.character(pedfile$V4[pedfile$V1==famID]),sex=as.numeric(pedfile$V5[pedfile$V1==famID]),affected=as.numeric(pedfile$affected[pedfile$V1==famID]))
      plot.pedigree(ped,cex=0.7,align=TRUE)
      title(famID)
  }
  
  And we call it this way:  
  Rscript <kinshipScript.R> <plink ped file> <pdf output>
  
  
original_text: 136: <p>Is there a pedigree viewer that works with PLINK pedigree files? I saw an old post by <a href="https://www.biostars.org/p/60186/" rel="nofollow noreferrer">Pierre</a>, but I don't see the script on his blog.</p>
   373: <p>We use <code>kinship2</code> R package to visualize pedigree files (.fam plink files). For some reasons, some characters from plink ped aren't supported (like "-9" for unknown genre or affected status).<br>
  Here is the R script we use:  </p>
  
  <pre><code>args&lt;-commandArgs(TRUE)
  pedPath&lt;-args[1]
  pdfFile&lt;-args[2]
  
  library(kinship2)
  pedfile &lt;- read.table(pedPath,sep="\t")
  pedfile$V5 &lt;- apply(pedfile,1,function(data){if(data[5] == 1 || data[5] ==2){data[5]}else{3}}) 
  pedfile$affected &lt;- apply(pedfile,1,function(data){if(as.numeric(data[6]) == 1){res &lt;- data[6]}else{if(as.numeric(data[6]) == 2){res &lt;- data[6]}else{res &lt;- NA}}})
  
  familyIDs &lt;- as.character(unique(pedfile$V1))
  
  pdf(file=pdfFile)
  for(famID in familyIDs){
      ped &lt;- pedigree(id=as.character(pedfile$V2[pedfile$V1==famID]),dadid=as.character(pedfile$V3[pedfile$V1==famID]),momid=as.character(pedfile$V4[pedfile$V1==famID]),sex=as.numeric(pedfile$V5[pedfile$V1==famID]),affected=as.numeric(pedfile$affected[pedfile$V1==famID]))
      plot.pedigree(ped,cex=0.7,align=TRUE)
      title(famID)
  }
  </code></pre>
  
  <p>And we call it this way:  </p>
  
  <pre><code>Rscript &lt;kinshipScript.R&gt; &lt;plink ped file&gt; &lt;pdf output&gt;
  </code></pre>
  