Hello,

I'm trying to create a genind object of an SNP dataset from Whelk to examine allelic richness between sites for some COI_16S sequences (combined sequences from the same individual).

My dataframe is in long format with individual SNPs coded as nucleotides(A, T, C, or G) and uninformative sites coded as "NA". There were two columns in the initial dataframe identifying specimens and populations that were selected out as a character vector "ind" and factor "popchar", respectively, and removed from the dataframe prior to converting. An additional character vector indicating loci names was also created, "locichar." The final dataframe contained the SNPs alone and was called "Whelk_SNP_file_dataonly".

Here is the code for the function df2genind():

df2genind(Whelk_SNP_file_dataonly, sep=" ", ploidy=1, ncode=1, ind.names=ind, loc.names=locichar, NA.char="NA", pop=popchar)

Each time I do this and look at the object using head(), I get this:

// 1 individual; 33 loci; 66 alleles; size: 15 Kb // Basic content @tab: 1 x 66 matrix of allele counts @loc.n.all: number of alleles per locus (range: 2-2) @loc.fac: locus factor for the 66 columns of @tab @all.names: list of allele names for each locus @ploidy: ploidy of each individual (range: 1-1) @type: codom @call: .local(x = x, i = i, j = j, drop = drop) // Optional content @pop: population of each individual (group size range: 1-1)

The file includes data from 242 individuals, not one. I cannot figure out why the function is reading my data as one individual. Does anyone have an idea of why adegenet is doing this and how I might fix it?

More Matthew Penney's questions See All
Similar questions and discussions