[adegenet-forum] Fasta input - diploid

Carlos Esteban Lara celarav at gmail.com
Wed May 4 07:08:06 CEST 2016


Hi,

A silly question here.

I am trying to get fast file in a genind form, easy. But the fast file contains 2 sequences per individual (diploid).  I do not know how to set up the ploidy level; hence getting a genind object with two individuals rather than 4 (see below). 

Fasta file looks like:

>ind1-1
GACATGAGCAGCAACCTGCTGCGCCACGATGGAGCTGGCGTGCGGTGCCCGTGGGCTGAG
TCTCTGGCAGAGCTGGACCTGTCCTCCAATCAGTTGGCGGATGCTGTGTTTGAGTGCTTG
CCCGTCAACGTCAAAAAGCTCAGCCTAGAAAACAATCAGATCAGCAACGTGCCCAGGGGG
GTGGCGGAGCTGGAATCCTTGGAAGAGCTGAACCTGGCATCCAACAGGCTGGCTGACCTG
CCGGGGTGCAGCAGCTTTCCGTCCCTGCAGTTCCTGAACGCG
>ind1-2
GACATGAGCAGCAACCTGCTGCGCCACGATGGAGCTGGCGTGCGGTGCCCGTGGGCTGAG
TCTCTGGCAGAGCTGGACCTGTCCTCCAATCAGTTGGCGGATGCTGTGTTTGAGTGCTTG
CCCGTCAACGTCAAAAAGCTCAGCCTAGAAAACAATCAGATCAGCAACGTGCCCAGGGGG
GTGGCGGAGCTGGAATCCTTGGAAGAGCTGAACCTGGCATCGAACAGGCTGGCTGACCTG
CCGGGGTGCAGCAGCTTTCCGGCCCTGCAGTTCCTGAACGCG
>ind2-1
GACATGAGCAGCAACCTGCTGCGCCACGATGGAGCTGGCGTGCGGTGCCCGTGGGCTGAG
TCTCTGGCAGAGCTGGACCTGTCCTCCAATCAGTTGGCGGATGCTGTGTTTGAGTGCTTG
CCCGTCAACGTCAAAAAGCTCAGCCTAGAAAACAATCAGATCAGCAACGTGCCCAGGGGG
GTGGCAGAGCTGGAATCCTTGGAAGAGCTGAACCTGGCATCCAACAGGCTGGCTGACCTG
CCGGGGTGCAGCGGCTTTCCGGCCCTGCAGTTCCTGAACGCG
>ind2-2
GACATGAGCAGCAACCTGCTGCGCCACGATGGAGCTGGCGTGCGGTGCCCGTGGGCTGAG
TCTCTGGCAGAGCTGGACCTGTCCTCCAATCAGTTGGCGGATGCTGTGTTTGAGTGCTTG
CCCGTCAACGTCAAAAAGCTCAGCCTAGAAAACAATCAGATCAGCAACGTGCCCAGGGGG
GTGGCGGAGCTGGAATCCTTGGAAGAGCTGAACCTGGCATCCAA

Input as follow:

A <- read.dna(“A.fas", format="fasta")
A <- DNAbin2genind(A)
A

/// GENIND OBJECT /////////

 // 4 individuals; 4 loci; 8 alleles; size: 5.6 Kb

 // Basic content
   @tab:  4 x 8 matrix of allele counts
   @loc.n.all: number of alleles per locus (range: 2-2)
   @loc.fac: locus factor for the 8 columns of @tab
   @all.names: list of allele names for each locus
   @ploidy: ploidy of each individual  (range: 1-1)
   @type:  codom
   @call: DNAbin2genind(x = tlr)

 // Optional content
   - empty -


Cheers,

Carlos Lara
Dept of Zoology
University of Otago
New Zealand
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20160504/7f40d9d5/attachment.html>


More information about the adegenet-forum mailing list