Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Correct load data for Run mmod #15

@OrsonMM

Description

@OrsonMM

Dear team mmod:

I can check that different libraries for load data to genind object can alter results of mmod functions

I am used adegenet library for previous analysis and create a DNAbin object.

obj_4 <- fasta2DNAbin("/media/737_alp_llam_end.fa", chunk=10)

 Converting FASTA alignment into a DNAbin object... 


 Finding the size of a single genome... 


 genome size is: 468 nucleotides 

( 2  lines per genome )

 Importing sequences... 
 Forming final object... 

...done.
obj_4
737 DNA sequences in binary format stored in a matrix.

All sequences of same length: 468 

Labels:
B2-A135
E1-A130
F1-A131
B10-A235
B9-A216
C2-A136
...

Base composition:
    a     c     g     t 
0.283 0.283 0.164 0.271 
(Total: 344.92 kb)

Adegenet library have a function to pass DNAbin object to genind object. And Give these result 28 Loci

adegent_library <- DNAbin2genind(obj_4, pop = Pop)
/// GENIND OBJECT /////////

 // 737 individuals; 28 loci; 58 alleles; size: 238.4 Kb

 // Basic content
   @tab:  737 x 58 matrix of allele counts
   @loc.n.all: number of alleles per locus (range: 2-3)
   @loc.fac: locus factor for the 58 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 = obj_4, pop = Pop)

 // Optional content
   @pop: population of each individual (group size range: 48-314)

But using convert function of mmod these give me 1 locus

mmod_library <-  as.genind.DNAbin(obj_4, pop = Pop)
/// GENIND OBJECT /////////

 // 737 individuals; 1 locus; 57 alleles; size: 228.3 Kb

 // Basic content
   @tab:  737 x 57 matrix of allele counts
   @loc.n.all: number of alleles per locus (range: 57-57)
   @loc.fac: locus factor for the 57 columns of @tab
   @all.names: list of allele names for each locus
   @ploidy: ploidy of each individual  (range: 1-1)
   @type:  codom
   @call: .local(.Object = .Object, tab = ..1, pop = ..2, ploidy = 1)

 // Optional content
   @pop: population of each individual (group size range: 48-314)

If I run Phi_st_Meirmans function of mmod the results are differents

Phi_st_Meirmans(adegent_library)
$per.locus
          6          15          19          30          31          32          34          35          36          38 
 -1.9153758  -2.1545447  -1.9942762 -26.8815757  -1.9547215   8.6540814  -0.8085354  73.8280912  47.8747794  -0.6461673 
         39          55          59          61          67          69          73          91         126         192 
 -0.6579821  -1.8710735  -1.9347715  -1.9347715   8.7029927  -2.0180501  -1.9347715  -0.5389611   7.0012439  -1.2773257 
        212         218         219         230         231         259         271         284 
  6.1651727  -2.9712335  -2.9370603   9.4423593  -1.9347715  -3.1745577 -14.9206610   7.8309535 

$global
[1] 29.40818
 Phi_st_Meirmans(mmod_library)
$per.locus
       L1 
0.8883799 

$global
[1] 0.8883799

I apreciated your feed back,

PD: For my research actually I am using the as.genind.DNAbin function for run mmod.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions