Skip to contents

Bulk TIRTLseq data

Data loading and wrangling

add_metadata()
Add missing metadata to a TIRTLseqData object.
filter_dataset()
Subset a TIRTLseqData object to only the requested samples
load_tirtlseq()
Load paired-TCR and pseudo-bulk data from TIRTLseq experiments into a TIRTLseqData object
reorder_samples()
Change the order of samples in a TIRTLseqData object

Data processing and cleaning

TIRTL_process()
Run the other data processing functions in a sequence (add_single_chain_data, clean_pairs, and identify_paired)
add_single_chain_data()
Add alpha- and beta-chain read counts and read fractions to the paired TCR data
clean_pairs()
Clean paired TCR data, keeping at most one beta-chain partner for each individual alpha-chain and at most two alpha-chain partners for each individual beta-chain
identify_non_functional_seqs()
Identify TCRs that contain non-functional CDR3 sequences, i.e. those that contain stop codons (*) or frame shifts (_)
identify_paired()
Identify which alpha and beta chains were able to be paired and which were not paired
prep_for_tcrdist()
Prepares paired TCRs for TCRdist calculation, adding alleles to V-segments (i.e. "*01") if they are missing and removing TCRs with unrecognized V-segments or non-functional CDR3 sequences
remove_duplicates()
Removes duplicate paired TCRs (by default, paired TCRs are listed twice if they were called by both pairing algorithms)

TCR repertoire analysis

TCRdist()
GPU implementation of TCRdist, a distance/similarity metric for pairs of TCRs
TCRdist_cpp()
Parallelized C++ implementation of TCRdist (no GPU required)
calculate_diversity() diversity()
Calculate TCR repertoire diversity metrics (Shannon diversity index, Simpson diversity index, etc.)
cluster_tcrs()
Cluster TCRs (using the Leiden algorithm) based on their pairwise TCRdist values
get_all_div_metrics()
Returns all diversity metric options for `calculate_diversity()`
get_all_tcrs()
Returns all of the paired TCRs from all samples in a dataset
get_pair_stats()
Count the number of alpha chains and beta chains that were paired by each pairing algorithm
get_paired_by_read_fraction_range()
Calculates the number and fraction of single chains that were paired within different read fraction ranges for each sample.
summarize_data()
Creates a summary table with number of reads and unique alpha/beta chains observed for each sample

Plotting

plot_clone_size_across_samples()
Line plot of clone read fraction across multiple samples
plot_clonotype_indices()
Stacked bar chart with fractions of reads attributed to the most frequent clonotypes
plot_clusters()
Plot clusters of similar TCRs
plot_diversity()
Bar plot of clonal diversity metrics
plot_n_reads()
Bar plot of the number of single-chain reads for each sample
plot_num_partners()
Stacked bar plot of the fraction of single-chains with different numbers of partners for each sample
plot_paired()
Stacked bar plot of the number alpha/beta chains paired by each pairing algorithm
plot_paired_by_read_fraction_range()
Bar plot of the fraction of single chains that were paired within different read fraction ranges for each sample.
plot_paired_vs_rank()
Line plot of the number of unpaired single-chains for the N most frequent single-chains
plot_pairs_with_eachother()
Point plot of read fraction vs. rank for the N most frequent alpha (left, mirrored) and beta (right) chains with lines between alpha and beta chains indicating a pair and a cross indicating an unpaired single-chain
plot_ranks() rank_plot()
Line plot of clonotype rank vs. read fraction for each sample
plot_read_fraction_vs_pair_status()
Alternative point plot of read fraction vs. rank for the N most frequent alpha and beta chains, with a cross indicating an unpaired single-chain
plot_sample_overlap() sample_overlap()
Plot the overlap/agreement between samples (in terms of most frequent clones)
plot_sample_vs_sample()
Scatterplot of TCR clone read fraction of clones between two samples

Export for external tools

create_thimble_df()
Convert paired TCRs to a "thimble" data frame for stitching together TCR nucleotide coding sequences with the Stitchr Python package
write_stitchr_tsv()
Write a tab-separated "thimble" text file for use with Stitchr

Well-level data functions

filter_well_data()
Remove rare clones from well-level TIRTLseq data
get_well_subset()
Get well names from numerical rows and columns
get_wells_from_edges()
Get well names from top left and bottom right wells
load_well_data()
Load well-level TIRTLseq data

Download datasets

download_dataset()
Download TIRTLseq datasets

Data

params
Table of permissible amino acids and V-segments for TCRdist
submat
Substitution penalty matrix for TCRdist amino acids and V-segments

Single-cell TIRTLseq data

clean_scTIRTLseq()
Imputes missing alpha and beta chains where possible for single-cell TIRTLseq data
summarize_scTIRTLseq()
Returns a summary of single-cell TIRTLseq data, printing the total number of wells with data, number of wells missing an alpha/beta chain, number of wells with a second alpha chain, etc.