[adegenet-forum] (no subject)

Axel Hille axel.hille at gmx.net
Thu May 14 13:51:21 CEST 2009


Dear adegent-users, dear Thibaut,
it maybe naive but i have problems with the genind2df function. what i want to do is - after reading in successfully a structure file - to generate a barebone data.frame without column names only rows x 2 columns for individuals x genotypes in 2 colums which can be used as input to the Geneland package. The problem: The dataframe generated by the genind2df function produces columns like "198 204" (STR genotypes and column names "RECALQ". What i need is 2 separate columns "198" "204" with column names for example RECALQ.a1 and RECALQ.a2 or no column names at all. I have no idea to generate this output. I really appreciate your help.
Following piece of code relates to my problem:

bf.geno.str <- read.structure("c:\\Dokumente und Einstellungen\\Axel Hille\\Desktop\\davidbeiaxel\\david_structure_example\\brownfrogs_3digit_122.str",
n.ind=122, n.loc=5, onerowperind=F, col.lab=T, col.pop=1, col.others=NULL, row.marknames=1, missing=-9, pop=NULL,quiet=T,ask=F)
##
   #####################
   ### Genind object ### 
   #####################
- genotypes of individuals - 
S4 class:  genind
@call: .local(x = x, i = i, j = j, drop = drop)
@tab:  1 x 29 matrix of genotypes
@ind.names: vector of  1 individual names
@loc.names: vector of  5 locus names
@loc.nall: number of alleles per locus
@loc.fac: locus factor for the  29 columns of @tab
@all.names: list of  5 components yielding allele names for each locus
@ploidy:  2
@type:  codom
Optionnal contents: 
@pop:  factor giving the population of each individual
@pop.names:  factor giving the population of each individual
@other: a list containing: elements without names 
##
#?genind2df
bf.geno.df.2 <- genind2df(bf.geno.str,sep=" ")
bf.geno.df.2[1:5,1:5]
##
        pop  RECALQ  RNTYR2  RC0608  RCIDLL
TAB7   TAB7 198 204 623 623 176 176 128 130
TAB8   TAB8 198 204 608 644 166 180 128 130
TAB9   TAB9 198 204 608 644 166 174 130 130
TAB10 TAB10 204 204 608 608 174 182 128 130
TAB11 TAB11 198 198 608 644 176 180 128 130
##
names(bf.geno.df.2)
##
[1] "pop"    "RECALQ" "RNTYR2" "RC0608" "RCIDLL" "RAI022"
##
....


Best regards
Axel Hille

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a


More information about the adegenet-forum mailing list