Last updated: 2021-09-30
Checks: 2 0
Knit directory: Note/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 312915b. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/PCA.Rmd
) and HTML (docs/PCA.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | 312915b | Yuxin Zou | 2021-09-30 | wflow_publish(“analysis/PCA.Rmd”) |
Let X be a column centered and scaled genotype matrix, X∈Rn×p. Each individual can be thought of as representing a point in p-dimensional space, where each dimension represents a single SNP. The goal of PCA is to find a new set of orthogonal axes (the principal components), each of which is made up from a linear combination of the original axes, such that the projection of the original data onto these new axes leads to an efficient summary of the structure of the data.
X has the following SVD: Xn×p=Un×nΣn×pVp×p⊺ The projection matrix is V. The transformed data matrix is Y_{n \times p} = X_{n \times p} V_{p \times p} = U_{n\times n} \Sigma_{n \times p}. The ith row of Y represents the individual’s position or projection on the ith principal component.
We can find U using eigenvectors of the similarity matrix between individuals, H_{n \times n} = \frac{1}{p} XX^\intercal.