knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
PeptidePCA contains a small suite of functions that can be used to recreate PCA figures from Hilton et al. (2017). HLA peptide sequences can be transformed into new features using an amino acid conversion matrix and then plotted using PCA. The packages ggplot2 and FactoMineR are required.
You can install PeptidePCA in R with the following command
library(devtools) devtools::install_github("ParhamLab/PeptidePCA")
This is a small vignette to display what PeptidePCA can do
library(PeptidePCA) ## load in example datasets # conversion matrix using 4 physicochemical properties and amino acid identities data(convmat.24, package= "PeptidePCA") colnames(convmat.24) ## convert in ligand files (already done in this example) # "testdata" is a folder that contains .txt files representing one HLA each, # with one ligand per line and nothing else. # ligands.4A= read.ligands("C:/Users/Alex/Documents/testdata") ## load in the preconverted data for this example data(ligands.4A, package= "PeptidePCA") summary(ligands.4A) # create features from example dataset features.4A= conv.features.list(ligands.4A, convmat.24, 9) # perform PCA features.4A.pca= pep.pca(features.4A) # colors for plotting, taken from http://jfly.iam.u-tokyo.ac.jp/color/ colors= c( "#E69F00", "#0072B2", "#CC79A7", "#009E73") # plot PCA pep.pca.plot(pca= features.4A.pca, type= "density", colors= colors)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.