bcm-uga / pcadapt

Performing highly efficient genome scans for local adaptation with R package pcadapt v4
https://bcm-uga.github.io/pcadapt
37 stars 10 forks source link

Merge SNP position, maf and P-values. #62

Closed Ray569743422 closed 3 years ago

Ray569743422 commented 3 years ago

How can I merge these information into a new dataframe then save it ?

privefl commented 3 years ago

I guess maf and p-values are provided in the result. You can read SNP positions and other variant information from the .bim (using e.g. bigreadr::fread()) file which comes together with the .bed and .fam files.

Ray569743422 commented 3 years ago

Thanks for your fast reply. I still have a question.

Ray569743422 commented 3 years ago

1.Is each line of .bim file corresponding to the line of x$pvalues ?For example, the first line of .bim file is corresponding to the first line of x$pvalue ? 2. Is there a method for selecting best K value or just by the screeplot?

privefl commented 3 years ago
  1. They should be in the same order, yes.

  2. Looking at the screeplot is a good solution (sometimes better to use a log-scale for the y-axis). In addition, looking at PC scores can be useful to see if they actually show any population structure.

Ray569743422 commented 3 years ago

Thanks for your reply!