inst/doc/clonotypeR.R

## ----load_package-------------------------------------------------------------
library(clonotypeR)

## ----load_data----------------------------------------------------------------
clonotypes <- read_clonotypes(system.file('extdata', 'clonotypes.txt.gz', package = "clonotypeR"))
summary(clonotypes)

## ----clonotype_table----------------------------------------------------------
head(clonotype_table(levels(clonotypes$lib), data=clonotypes))
head(clonotype_table(levels(clonotypes$lib), "V", data=clonotypes))
head(clonotype_table(levels(clonotypes$lib), "J", data=clonotypes))

## ----yassai_identifier--------------------------------------------------------
# Unique identifier
head(yassai_identifier(clonotypes))

## ----other_functions----------------------------------------------------------
clonotypes <- clonotype_table(levels(clonotypes$lib), data=clonotypes)

# First six clonotypes of library C
head(unique_clonotypes("C", data=clonotypes))
# Count clonotypes found in library A, and B or C.
length(common_clonotypes(group1="A", group2=c("B","C"), data=clonotypes))
# Matrix of numbers of common clonotypes
common_clonotypes(data=clonotypes)

## ----load_data2---------------------------------------------------------------
clonotypes <- read_clonotypes(system.file("extdata", "clonotypes2.tsv.xz", package = "clonotypeR"))

## ----summary_2----------------------------------------------------------------
summary(clonotypes)

## ----explore_data2------------------------------------------------------------
abc <- clonotype_table(c('A','B','C'), data=clonotypes)
head(abc)
summary(abc)

## ----explore_data2b-----------------------------------------------------------
abc[abc$C == 124, ]

## ----explore_data2v-----------------------------------------------------------
clonotype_table(c('A','B','C'), "V", data=clonotypes)
head(clonotype_table(c('A','B','C'), c("V","J"), data=clonotypes))

Try the clonotypeR package in your browser

Any scripts or data that you put into this service are public.

clonotypeR documentation built on Nov. 8, 2020, 6:51 p.m.