knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Workflow

  1. Data type
  2. Genotype data: Hapmap-format
  3. phenotype data:
    • Continuous,
    • Binary,
    • Multiclass (but each category should have at least 10~20 observations)
  4. Preprocessing
  5. Quality Control
    • Minor Allele Frequency
    • Hardy-Weinberg Equilibrium
    • Heterozygosity
    • Missing Call Rate
  6. Imputation
  7. Population Structure
  8. Gap statistic
    • Estimating the number of subpopulations
    • Cluster analysis
  9. fastSTRUCTURE (pending)
  10. PCoA
  11. Selection Procedure
  12. Selectino probaility with regularization
    • Lasso
    • Elastic-net
    • Multiresponse elastic-net (pending)
    • Unified elastic-net (pending)
    • Unified elastic-net with df-normalization (pending)
  13. Empirical Threshold
  14. Output
  15. QC results
  16. Data files before/after QC steps
  17. Selection probabilities
  18. Empirical thresholds
  19. Visualization
    • A plot for population assignment by fastSTRUCTURE (pending)
    • LD plot (pending)
    • Gap statistic plot (pending)
    • PCoA plot (pending)
    • tSNE plot (pending)
    • Manhattan plot

Example Data

Load the genotype data with several phenotypes

  genotype <- sp.gwas::genotype
  phenotype <- sp.gwas::phenotype

Data format

Note that the first 11 columns of genotype are biological information of SNPs and the remaining columns are ID of each individual.

head(colnames(genotype), 15)

Also, note that genotype has column names in its first row, and that phenotype has a column of ID in its first column matched by the ID in genotype.

genotype[1:5, 1:15]
head(phenotype)

Therefore, you can see that there are 1000 individuals and 100 SNPs in genotype, and that there are columns for ID and 3 continuous outcomes in phenotype.

dim(genotype)
dim(phenotype)

Vignette Info

Vignette Info

Vignettes are long form documentation commonly included in packages. Because they are part of the distribution of the package, they need to be as compact as possible. The html_vignette output type provides a custom style sheet (and tweaks some options) to ensure that the resulting html is as small as possible. The html_vignette format:

Vignette Info

Note the various macros within the vignette section of the metadata block above. These are required in order to instruct R how to build the vignette. Note that you should change the title field and the \VignetteIndexEntry to match the title of your vignette.

Styles

The html_vignette template includes a basic CSS theme. To override this theme you can specify your own CSS in the document metadata as follows:

output: 
  rmarkdown::html_vignette:
    css: mystyles.css

Figures

The figure sizes have been customised so that you can easily put two images side-by-side.

plot(1:10)
plot(10:1)

You can enable figure captions by fig_caption: yes in YAML:

output:
  rmarkdown::html_vignette:
    fig_caption: yes

Then you can use the chunk option fig.cap = "Your figure caption." in knitr.

More Examples

You can write math expressions, e.g. $Y = X\beta + \epsilon$, footnotes^[A footnote here.], and tables, e.g. using knitr::kable().

knitr::kable(head(mtcars, 10))

Also a quote using >:

"He who gives up [code] safety for [code] speed deserves neither." (via)



statpng/sp.gwas documentation built on Dec. 17, 2020, 5:55 a.m.