diff --git a/docs/articles/pcadapt.html b/docs/articles/pcadapt.html index 97d666d..4da8531 100644 --- a/docs/articles/pcadapt.html +++ b/docs/articles/pcadapt.html @@ -479,27 +479,25 @@

G. Detecting number of genetic markers). Assume your frequency file is called “foo” and is located in the directory “path_to_directory”, use the following command lines:

-
pool.data <- read.table("path_to_directory/foo")
-filename <- read.pcadapt(pool.data, type = "pool")
+
pool.data <- read.pcadapt("path_to_directory/foo", type = "pool")
+

You can also directly input an R matrix to +read.pcadapt() if you want.

A Pool-seq example is provided in the package, and can be loaded as follows:

-pool.data <- system.file("extdata", "pool3pops", package = "pcadapt")
-filename <- read.pcadapt(pool.data, type = "pool")
+path_to_file <- system.file("extdata", "pool3pops", package = "pcadapt") +pool.data <- read.pcadapt(path_to_file, type = "pool")

With Pool-Seq data, the package computes again a Mahalanobis distance based on PCA loadings.

-

By default, pcadapt function assumes that \(K=n-1\). Smaller values of K -can be provided by using argument K. Computation of -Mahalanobis distances is performed as follows

+

Computation of Mahalanobis distances is performed as follows

-res <- pcadapt(filename)
-#The same as res <- pcadapt(filename,K=2)
+res <- pcadapt(pool.data, K = 3)
 summary(res)
##                 Length Class  Mode   
-## scores             6   -none- numeric
-## singular.values    2   -none- numeric
-## loadings        3000   -none- numeric
-## zscores         3000   -none- numeric
+## scores             9   -none- numeric
+## singular.values    3   -none- numeric
+## loadings        4500   -none- numeric
+## zscores         4500   -none- numeric
 ## af              1500   -none- numeric
 ## maf             1500   -none- numeric
 ## chi2.stat       1500   -none- numeric
@@ -515,7 +513,7 @@ 

G. Detecting and the default value of \(K=n-1\) should be used.

-plot(res,option="screeplot")
+plot(res, option = "screeplot")

A Manhattan plot can be displayed.

@@ -528,13 +526,13 @@ 

G. Detecting alpha <- 0.1 outliers <- which(padj < alpha) length(outliers)

-
## [1] 126
+
## [1] 119

The function get.pcis also available for pooled-seq data (see H.3).

 get.pc(res,1:150)->aux
 print(aux[,2])
-
##   [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+
##   [1] 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 ##  [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 ##  [75] 1 2 2 2 2 2 2 2 2 2 2 2 1 1 2 1 2 1 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2
 ## [112] 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 1 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1
diff --git a/docs/articles/pcadapt_files/figure-html/unnamed-chunk-25-1.png b/docs/articles/pcadapt_files/figure-html/unnamed-chunk-25-1.png
index 28aba0b..c2c7aa5 100644
Binary files a/docs/articles/pcadapt_files/figure-html/unnamed-chunk-25-1.png and b/docs/articles/pcadapt_files/figure-html/unnamed-chunk-25-1.png differ
diff --git a/docs/articles/pcadapt_files/figure-html/unnamed-chunk-26-1.png b/docs/articles/pcadapt_files/figure-html/unnamed-chunk-26-1.png
index 43ccdfd..48c9d41 100644
Binary files a/docs/articles/pcadapt_files/figure-html/unnamed-chunk-26-1.png and b/docs/articles/pcadapt_files/figure-html/unnamed-chunk-26-1.png differ
diff --git a/vignettes/pcadapt.Rmd b/vignettes/pcadapt.Rmd
index 334e85e..4979269 100644
--- a/vignettes/pcadapt.Rmd
+++ b/vignettes/pcadapt.Rmd
@@ -293,24 +293,24 @@ For Pool-seq samples, the package also uses the `read.pcadapt` function.
 We assume that the user provides a matrix of relative frequencies with `n` rows and `L` columns (where `n` is the number of populations and `L` is the number of genetic markers). Assume your frequency file is called "foo" and is located in the directory "path_to_directory", use the following command lines:
 
 ```
-pool.data <- read.table("path_to_directory/foo")
-filename <- read.pcadapt(pool.data, type = "pool")
+pool.data <- read.pcadapt("path_to_directory/foo", type = "pool")
 ```
 
+You can also directly input an R matrix to `read.pcadapt()` if you want.
+
 A Pool-seq example is provided in the package, and can be loaded as follows:
 
 ```{r,  eval = TRUE}
-pool.data <- system.file("extdata", "pool3pops", package = "pcadapt")
-filename <- read.pcadapt(pool.data, type = "pool")
+path_to_file <- system.file("extdata", "pool3pops", package = "pcadapt")
+pool.data <- read.pcadapt(path_to_file, type = "pool")
 ```
 
 With Pool-Seq data, the package computes again a Mahalanobis distance based on PCA loadings. 
 
-By default, `pcadapt` function assumes that $K=n-1$. Smaller values of `K` can be provided by using argument `K`. Computation of Mahalanobis distances is performed as follows
+Computation of Mahalanobis distances is performed as follows
 
 ```{r,  eval = TRUE}
-res <- pcadapt(filename)
-#The same as res <- pcadapt(filename,K=2)
+res <- pcadapt(pool.data, K = 3)
 summary(res)
 ```
 `res' is a list containing the same elements than when using individual genotype data.
@@ -318,7 +318,7 @@ summary(res)
 A scree plot can be obtained and be possibly used to reduce `K`. If the number of populations `n` is too small, it is impossible to use the scree plot to choose `K` and the default value of $K=n-1$ should be used.
 
 ```{r, eval = TRUE}
-plot(res,option="screeplot")
+plot(res, option = "screeplot")
 ```
 
 A Manhattan plot can be displayed.