file.path <- system.file("extdata", "TCRB_sequencing", package = "LymphoSeq")
file.list <- readImmunoSeq(path = file.path)
productive.aa <- productiveSeq(file.list = file.list, aggregate = "aminoAcid")
top.freq <- topFreq(productive.aa = productive.aa, percent = 0.1)
sequence.matrix <- seqMatrix(productive.aa = productive.aa, sequences = top.freq$aminoAcid)
# Track clones without mapping or tracking specific sequences
cloneTrack(sequence.matrix = sequence.matrix)
# Track top 20 clones mapping to the CD4 and CD8 samples
cloneTrack(sequence.matrix = sequence.matrix, productive.aa = productive.aa,
map = c("TCRB_Day949_CD4", "TCRB_Day949_CD8"), label = c("CD4", "CD8"),
track = top.freq$aminoAcid[1:20], unassigned = TRUE)
# Track the top 10 clones from top.freq
cloneTrack(sequence.matrix = sequence.matrix, productive.aa = productive.aa,
track = top.freq$aminoAcid[1:10], unassigned = FALSE)
# Track clones mapping to the CD4 and CD8 samples while ignoring all others
cloneTrack(sequence.matrix = sequence.matrix, productive.aa = productive.aa,
map = c("TCRB_Day949_CD4", "TCRB_Day949_CD8"), label = c("CD4", "CD8"),
unassigned = FALSE)
# Track clones mapping to the CD4 and CD8 samples and track 2 specific sequences
cloneTrack(sequence.matrix = sequence.matrix, productive.aa = productive.aa,
map = c("TCRB_Day949_CD4", "TCRB_Day949_CD8"), label = c("CD4", "CD8"),
track = c("CASSPPTGERDTQYF", "CASSQDRTGQYGYTF"), unassigned = FALSE)
# Reorder the x axis, change the axis labels, convert to log scale, and add title
x.limits <- c("TCRB_Day0_Unsorted", "TCRB_Day32_Unsorted",
"TCRB_Day83_Unsorted", "TCRB_Day949_Unsorted", "TCRB_Day1320_Unsorted")
sequence.matrix <- sequence.matrix[ ,c("aminoAcid", x.limits)]
clone.track <- cloneTrack(sequence.matrix = sequence.matrix,
productive.aa = productive.aa, track = top.freq$aminoAcid[1:10], unassigned = FALSE)
x.labels <- c("Day 0", "Day 32", "Day 83", "Day 949", "Day 1320")
clone.track +
ggplot2::scale_x_discrete(expand = c(0,0), labels = x.labels) +
ggplot2::scale_y_log10() + ggplot2::annotation_logticks(sides = "l") +
ggplot2::ggtitle("Figure Title")
Run the code above in your browser using DataLab