[adegenet-forum] Reading in data from Stacks output files

Roman Luštrik roman.lustrik at biolitika.si
Fri Nov 17 10:31:24 CET 2017


Can you also share the files? It's hard to guess by code alone and I (we?) don't like hard.

Cheers,
Roman

----
In god we trust, all others bring data.
> Zahtevaj IJZ na https://kurc.biolitika.si

----- Original Message -----
From: "Harriet Hunt" <hvh22 at cam.ac.uk>
To: adegenet-forum at lists.r-forge.r-project.org
Sent: Thursday, November 16, 2017 6:21:09 PM
Subject: [adegenet-forum] Reading in data from Stacks output files

Hi Thibault et al,

I am trying to read in a SNP data set outputted from Julian Catchen's 
Stacks program for downstream multivariate analyses (PCAs, genetic 
distance measures, etc.) I have tried converting both the Structure file 
format and vcf format but they don't seem to be giving the same genind 
results - there are 2136 alleles (1068 loci, diploid) in the genind 
converted from the structure file but 3592 alleles in the genind 
converted from the vcf file.

Some of this is done using the package SNPstats rather than adegenet but 
maybe someone can answer the question anyway? I would like to know if 
there is an error in my code which means I get these conflicting 
results. Or is it just the way data is coded in vcf?


My code is:

matrix98str <- read.structure("98percent.str", n.ind=371, n.loc=1068, 
onerowperind = FALSE, col.lab=1, col.pop=2, row.marknames=1, NA.char=0)
vcf <- readVcf("98percent.vcf")
library("snpStats")
matrix98vcf <- genotypeToSnpMatrix(vcf)
matrix98vcfSNPs <- df2genind(matrix98vcf$genotypes, ploidy=2, sep="/", 
ind.names=rownames(matrix98vcf$genotypes), 
loc.names=colnames(matrix98vcf$genotypes), NA.char=NA)

and then I am comparing the 2 genind objects matrix98str and 
matrix98vcfSNPs.

Thanks for any help! Harriet



-- 
Dr Harriet Hunt
Research Associate
McDonald Institute for Archaeological Research
University of Cambridge
Downing Street
Cambridge CB2 3ER
UK

Tel: +44 (0)1223 339330
e-mail: hvh22 at cam.ac.uk
_______________________________________________
adegenet-forum mailing list
adegenet-forum at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum


More information about the adegenet-forum mailing list