Learn R Programming

==> Platypus and PlatypusDB homepage

Platypus

Platypus is an R toolkit designed to facilitate the data analysis of single-cell immune repertoire sequencing experiments. The manuscript corresponding to Platypus v2 can be found here at Yermanos et al NARGAB 2021 https://doi.org/10.1093/nargab/lqab023 and the updated manuscript concerning the v3 Platypus ecosystem can be found here: https://www.biorxiv.org/content/10.1101/2022.09.28.509709v1

Ongoing updates in the Platypus pipeline (v3)

Due to the recent changes of the default clonotyping strategy in Cellranger (version 5 and version 6) and annotation of the framework and CDR regions (version 7) we have rebuild Platypus to revolve around the VDJ_build function. This function creates a dataframe of the repertoire data. The function VGM_build integrates the repertoire and transcriptome information (Seurat object) and will serve as the input to all secondary functions in future iterations of the package. The advantage of this is having all repertoire and transcriptome information at a per-cell level.

Furthermore we developed PlatypusDB, a publicly available database that facilitates the download, integration, and analysis of hundred thousands of single-cells that contain GEX information, VDJ information or both. With a single line of code, PlatypusDB allows users to either download and explore available datasets or integrate existing experiments with their own datasets. Collectively, PlatypusDB serves as a database for the scientific community interested in exploration of single cell immune repertoire sequencing experiments from mouse and human.

Stay tuned for updates https://twitter.com/alexyermanos?lang=en

Architecture

System requirements

Platypus has been successfully installed on MacOS X (v10.14.6) and Windows 10 Pro (v1909), and used on R versions 4.4.0, 4.0.0 and 3.6.1

Installation

Platypus can easily be installed from CRAN or Github. As changes and bugfixes are made regularly, the Github version may be more recent.

Please scroll down for instructions on how to install the necessary dependencies.


### Removing any previous versions of the package
# First we will ensure that there is no previous version installed locally
#detach("package:Platypus", unload=TRUE)
#remove.packages("Platypus")

### Downloading and installing Platypus from CRAN

install.packages("Platypus")

### Downloading and installing Platypus from Github

# First we need to download the most recent version from the master branch at https://github.com/alexyermanos/Platypus we can install the package using the following command.
# WARNING: This needs to be replaced with your own directory where the downloaded package is found
# For MacOS users it may look like this
install.packages("~/Downloads/Platypus_3.6.0.tar.gz", repos = NULL, type="source")
# For windows it will likely look something like this.
# WARNING: You will need to replace 'YourPCName' with your user name for the windows account in the directory.
install.packages("C:/Users/YourPCName/Downloads/Platypus_3.6.0.tar.gz", repos = NULL, type="source")

# The individual R functions can additionally be found on the github in the Functions branch. Within this branch, there is a folder "R" which contains the individual functions. This can similarly be downloaded and loaded into the R environment incase not all functions are desired. Similarly, these functions are actively updated and may include more features than the in current CRAN version.

Platypus uses a number of different R packages, some of which need prior installation. These can be installed either from CRAN, Bioconductor:

CRAN

Code to install the packages from CRAN:

#Essential packages
install.packages("tidyverse")
install.packages("Seurat")
install.packages("utils")

#Optional packages needed for some individual functions
install.packages("ape")
install.packages("circlize")
install.packages("do")
install.packages("dplyr")
install.packages("ggplot2")
install.packages("ggseqlogo")
install.packages("igraph")
install.packages("jsonlite")
install.packages("phytools")
install.packages("reshape2")
install.packages("seqinr")
install.packages("stringdist")

GitHub

Harmony (but not required if not using the Harmony integration method)

Code for installing harmony:

install.packages("devtools")
library(devtools)
install_github("immunogenomics/harmony")

##Bioconductor Code for installing the packages from Bioconductor:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("Biostrings")
BiocManager::install("org.Mm.eg.db")
BiocManager::install("edgeR")
BiocManager::install("fgsea")
BiocManager::install("msa")
BiocManager::install("ggtree")

Please post any questions or issues in the respecitve github section: https://github.com/alexyermanos/Platypus/issues Please reach out to us with any questions or if you would like to contribute.

Copy Link

Version

Install

install.packages('Platypus')

Monthly Downloads

351

Version

3.6.0

License

GPL-2

Maintainer

Alexander Yermanos

Last Published

October 18th, 2024

Functions in Platypus (3.6.0)

GEX_volcano

Flexible wrapper for GEX volcano plots
VDJ_GEX_clonotype_clusters_circos

Makes a Circos plot from the VDJ_GEX_integrate output. Connects the clonotypes with the corresponding clusters.
VDJ_alpha_beta_Vgene_circos

Produces a Circos plot from the VDJ_analyze output. Connects the V-alpha with the corresponding V-beta gene for each clonotype.
VDJ_GEX_overlay_clones

Overlay clones on GEX projection
VDJ_GEX_matrix

VDJ GEX processing and integration wrapper
VDJ_Vgene_usage_barplot

V(D)J gene usage barplots
VDJ_Vgene_usage_stacked_barplot

V(D)J gene usage stacked barplots
VDJ_Vgene_usage

V(D)J gene usage stacked barplots
VDJ_abundances

Calculate abundances/counts of specific features for a VDJ dataframe
VDJ_antigen_integrate

Integrates antigen-specific information into the VDJ/VDJ.GEX.matrix[[1]] object
VDJ_GEX_stats

Standalone VDJ and GEX statistics.
VDJ_VJ_usage_circos

Makes a Circos plot from the VDJ_analyze output. Connects the V gene with the corresponding J gene for each clonotype.
VDJ_clonal_expansion

Flexible wrapper for clonal expansion barplots by isotype, GEX cluster etc.
VDJ_clonotype

Platypus V3 clonotyping wrapper
VDJ_contigs_to_vgm

Formats "VDJ_contigs_annotations.csv" files from cell ranger to match the VDJ_GEX_matrix output using only cells with 1VDJ and 1VJ chain
VDJ_clonal_barplot

Function to create stacked barplots to visualize clonal expansion per repertoire directly from a VDJ matrix (either from the minimal_VDJ() or VDJ_GEX_matrix())
VDJ_assemble_for_PnP

Ab sequence assembly for recombinant PnP expression
VDJ_build

Minimal Version of the VDJ Building Part from VDJ_GEX_matrix() Function
VDJ_clonotype_v3_w_enclone

Updated clonotyping function based on implications for cells with different chain numbers than 1 VDJ 1 VJ chains.
VDJ_clonal_donut

Circular VDJ expansion plots
VDJ_call_enclone

(Re)clonotype a VDJ object using cellranger's enclone tool
VDJ_circos

Plots a Circos diagram from an adjacency matrix. Uses the Circlize chordDiagram function. Is called by VDJ_clonotype_clusters_circos(), VDJ_alpha_beta_Vgene_circos() and VDJ_VJ_usage_circos() functions or works on its own when supplied with an adjacency matrix.
VDJ_kmers

Calculates and plots kmers distributions and frequencies.
VDJ_germline

Infer germline from the desired software/caller
VDJ_logoplot_vector

Flexible logoplot wrapper
VDJ_expand_aberrants

Expand the aberrant cells in a VDJ dataframe by converting them into additional rows
VDJ_ordination

Performs ordination/dimensionality reduction for a species incidence matrix, depending on the species selected in the feature.columns parameter.
VDJ_extract_germline_consensus_ref

Making the trimmed reference and concatenating fr1-fr4
VDJ_network

Similarity networks based on CDR3 regions
VDJ_diversity

Calculates and plots common diversity and overlap measures for repertoires and alike. Requires the vegan package
VDJ_db_annotate

Wrapper function of VDJ_antigen_integrate function
VDJ_dynamics

Tracks a specific VDJ column across multiple samples/timepoints.
VGM_build

Function to obtain the VGM object by integrating the VDJ and GEX/Seurat objects
VDJ_variants_per_clone

Wrapper for variant analysis by clone
VGM_expand_featurebarcodes

Utility for feature barcode assignment including clonal information
VGM_expanded_clones

VDJ utility for T/F column for clonal expansion
VDJ_db_load

Load and preprocess a list of antigen-specific databases
VDJ_overlap_heatmap

Wrapper to determine and plot overlap between VDJ features across groups
small_vdj

Small VDJ dataframe for function testing purposes
VDJ_phylogenetic_trees

Creates phylogenetic trees from a VDJ dataframe
VGM_integrate

Utility for VDJ GEX matrix to integrated VDJ and GEX objects after addition of data to either
VDJ_plot_SHM

Plotting of somatic hypermutation counts
VDJ_phylogenetic_trees_plot

Phylogenetic tree plotting
small_vgm

Small VDJ GEX matrix (VGM) for function testing purposes
VDJ_get_public

Function to get shared/public elements across multiple repertoires
VDJ_public

Function to get shared/public elements across multiple repertoires
VDJ_rarefaction

Plots rarefaction curves for species denoted in the feature.columns parameter across groups determined by grouping.columns
GEX_gene_visualization

Visualization of marker expression in a data set or of predefined genes (B cells, CD4 T cells and CD8 T cells).
GEX_heatmap

Flexible GEX heatmap wrapper
GEX_DEgenes

Wrapper for differential gene expression analysis and plotting
GEX_dottile_plot

GEX Dottile plots
GEX_GSEA

GEX Gene Set Enrichment Analysis and plotting
GEX_lineage_trajectories

This is a function to infer single cell trajectories and identifying lineage structures on clustered cells. Using the slingshot library
GEX_coexpression_coefficient

Coexpression of selected genes
GEX_cluster_genes_heatmap

Heatmap of cluster defining genes
GEX_cluster_membership

Cluster membership plots by sample
GEX_cluster_genes

Differentially expressed genes between clusters or data subsets
GEX_pairwise_DEGs

Wrapper for calculating pairwise differentially expressed genes
GEX_phenotype

Assignment of cells to phenotypes based on selected markers
GEX_phenotype_per_clone

Plotting of GEX phenotype by VDJ clone
GEX_proportions_barplot

Plots proportions of a group of cells within a secondary group of cells. E.g. The proportions of samples in seurat clusters, or the proportions of samples in defined cell subtypes
PlatypusDB_AIRR_to_VGM

AIRR to Platypus V3 VGM compatibility function
PlatypusDB_VGM_to_AIRR

Platypus V3 VGM to AIRR compatibility function
GEX_scatter_coexpression

Scatter plot for coexpression of two selected genes
PlatypusDB_load_from_disk

PlatypusDB utility for import of local datasets