Inferring B cell clonal relationships

Introduction

A key step to higher-level quantitative analysis of Adaptive Immune Receptor Repertoire sequencing (AIRR-Seq) data is the identification of B cell clones (sequences derived from cells descended from a common ancestor) using computationally-driven approaches. Accurate identification of clonal relationships is critical as these clonal groups form the fundamental basis for a wide range of repertoire analyses, including diversity analysis, lineage reconstruction, and effector functionality.

scoper provides a computational framework for identification of B cell clones from AIRR-Seq data among Ig (immunoglobulin, B cell receptor, BCR) sequences which share the same V gene, J gene and junction length. It includes methods to infer clonal relationships using either a predefined clustering threshold or an adaptive threshold.

Example data

A small example AIRR Rearrangement dataset is included in the scoper package. The dataset consists of a subset of Ig sequencing data from an influenza vaccination study (Laserson and Vigneault et al., PNAS, 2014). It includes sequences from multiple time-points before and after the subject received an influenza vaccination. Identification of clones requires the following fields (columns) to be present in the table:

  • junction
  • v_call
  • j_call
  • sequence_alignment
  • germline_alignment_d_mask

Identifying clones by sequence identity

The simplest method for inferring clonal relationships is to define clones among identical junction region sequences (the junction region is where the V, D, and J gene segments join). This can be done using the identicalClones function at either the nucleotide level (method="nt") or the amino acid level (method="aa"):

# Imports
library(scoper)
library(dplyr)

# Clonal assignment using identical nucleotide sequences
results <- identicalClones(ExampleDb, method="nt")

A modified input data.frame with clonal identifiers in the clone_id column is contained in the db slot of the returned returned ScoperClones object, which can also be accessed by calling as.data.frame on the result object.

# Get results data.frame
results_db <- as.data.frame(results)
glimpse(results_db)
## Rows: 2,000
## Columns: 16
## $ sequence_id               <chr> "GN5SHBT08JPUYU", "GN5SHBT01EOOGB", "GN5SHBT05IQQ1G", "GN5SHBT01A6IAJ", "GN5SHBT03BNODZ", "GN5SHBT02A6PJD", "GN5SHBT04EFLMK", "GN5SHBT02BH08U", "GN5SHBT04CSILO", "GN…
## $ sequence_alignment        <chr> "CAGGTTCAACTGGTGCAGTCTGGAGCT...GAGGTGAAAAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGACTTCTGGTTACACCTTT............ACCTCCTTTGGTCTCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGGTGGGATG…
## $ germline_alignment        <chr> "CAGGTTCAGCTGGTGCAGTCTGGAGCT...GAGGTGAAGAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGGCTTCTGGTTACACCTTT............ACCAGCTATGGTATCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGATGGGATG…
## $ germline_alignment_d_mask <chr> "CAGGTTCAGCTGGTGCAGTCTGGAGCT...GAGGTGAAGAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGGCTTCTGGTTACACCTTT............ACCAGCTATGGTATCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGATGGGATG…
## $ v_call                    <chr> "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F…
## $ v_call_genotyped          <chr> "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", …
## $ d_call                    <chr> "Homsap IGHD3-9*01 F", "Homsap IGHD2-8*01 F", "Homsap IGHD2-2*01 F", "Homsap IGHD2-21*02 F", "Homsap IGHD3-22*01 F", "Homsap IGHD3-16*02 F", "Homsap IGHD3-3*01 F", "…
## $ j_call                    <chr> "Homsap IGHJ4*03 F", "Homsap IGHJ4*02 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F…
## $ c_call                    <chr> "IGHA", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHD", "IGHD", "IGHM", "IGHM", "IGHM", "IGHM", "IGHA", "IGHM", "IGHA", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM…
## $ junction                  <chr> "TGTGCAAGAATGAAGTATTACGATATTTTGACTGGTTACGAGCCGACCGCTTATTTCTACTTTACGGGTTTGGACGTCTGG", "TGTGCGAGAGATCTGGGGGATATTGTACTAATGGTGTATGCCGACCAGTACCCCATATTGGGGTACTACTTTGACTACT…
## $ junction_length           <dbl> 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 75, 75, 75, 75, 75, 75, 75, 75, 75, 54, 54, 54, 63, 81, 81, 81, 81, 81, 90, 90, 90, 9…
## $ np1_length                <dbl> 5, 6, 6, 27, 7, 11, 13, 13, 16, 7, 26, 21, 11, 20, 26, 9, 19, 28, 19, 19, 11, 11, 11, 13, 13, 12, 8, 8, 32, 7, 1, 3, 10, 12, 12, 12, 7, 11, 49, 49, 49, 49, 49, 49, 6…
## $ np2_length                <dbl> 34, 23, 37, 6, 37, 27, 18, 18, 28, 27, 9, 17, 30, 21, 31, 35, 16, 1, 16, 24, 8, 3, 3, 15, 4, 10, 13, 13, 6, 16, 10, 6, 10, 33, 33, 33, 49, 17, 9, 9, 9, 9, 9, 9, 9, 1…
## $ duplicate_count           <dbl> 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 11, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1,…
## $ sample_id                 <chr> "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h…
## $ clone_id                  <chr> "1", "2", "3", "4", "5", "6", "7", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "21", "22", "23", "24", "25", "25", "26", "…

A summary of the results can be plotted by calling plot on the returned ScoperClones object. This will show the minimum inter (between) clonal distances. A detailed summary of clonal relationships as a data.frame is also available through a call to summary on the results object.

# Plot a histogram of inter clonal distances
plot(results, binwidth=0.02)

plot of chunk Scoper-Vignette-3

# Get summary data.frame
glimpse(summary(results))
## Rows: 156
## Columns: 7
## $ vjl_group       <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, …
## $ sequence_count  <int> 20, 1, 1, 1, 12, 7, 3, 1, 12, 5, 37, 4, 5, 10, 6, 9, 5, 4, 5, 2, 4, 1, 2, 1, 2, 1, 24, 25, 7, 2, 3, 3, 12, 1, 15, 26, 3, 22, 35, 2, 4, 1, 13, 3, 8, 15, 1, 2, 3, 4, 4, 28, 1, 1…
## $ v_call          <chr> "Homsap IGHV1-18*01 F", "Homsap IGHV1-46*01 F,Homsap IGHV1-46*03 F", "Homsap IGHV5-10-1*01 F", "Homsap IGHV5-10-1*01 F", "Homsap IGHV5-10-1*01 F,Homsap IGHV5-10-1*03 F", "Homs…
## $ j_call          <chr> "Homsap IGHJ4*03 F,Homsap IGHJ4*02 F,Homsap IGHJ4*01 F", "Homsap IGHJ2*01 F", "Homsap IGHJ2*01 F", "Homsap IGHJ3*01 F", "Homsap IGHJ5*02 F,Homsap IGHJ5*01 F", "Homsap IGHJ6*02…
## $ junction_length <int> 81, 81, 60, 102, 69, 66, 84, 96, 66, 75, 75, 84, 93, 60, 75, 87, 54, 63, 51, 60, 75, 60, 69, 57, 57, 78, 54, 63, 78, 87, 72, 90, 75, 36, 75, 72, 81, 60, 69, 72, 69, 90, 48, 93…
## $ clone_count     <int> 19, 1, 1, 1, 10, 7, 3, 1, 11, 4, 36, 4, 3, 8, 5, 9, 5, 4, 5, 2, 3, 1, 2, 1, 2, 1, 20, 25, 6, 1, 3, 2, 10, 1, 15, 22, 3, 20, 32, 2, 4, 1, 13, 3, 7, 10, 1, 2, 3, 4, 3, 24, 1, 1,…
## $ clone_id        <chr> "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19", "547", "611", "721", "768,769,770,771,772,773,774,775,776,777", "868,869,870,871,872,873,874", "942,943,944", "999", "1144,1…

Identifying clones by hierarchical clustering

Most current studies uses a more sophisticated definition for clonal relationships. These studies leverage the high diversity of the junction region as a fingerprint to identify each B cell clone. Since it is unlikely that two separate recombination events would lead to identical junctions, sequences with junction regions that are similar enough are determined to share a common B cell ancestor (i.e., be clonally related) rather than to have arisen independently. Hierarchical clustering is a widely used distance-based method for identify clonally related sequences. An implementation of the hierarchical clustering approach is provided via the hierachicalClones function.

It is important to determine an appropriate threshold for trimming the hierarchical clustering into B cell clones before using this method. The ideal threshold for separating clonal groups is the value that separates the two modes of the nearest-neighbor distance distribution. The nearest-neighbor distance distribution can be generated by using the distToNearest function in the shazam R package. The threshold itself can be found using the findThreshold function in the same package. The resulting distribution should be bimodal, with the first mode representing sequences with clonal relatives in the dataset and the second mode representing singletons. For further details regarding inferring an appropriate threshold for the hierarchical clustering method, see the Distance to Nearest Neighbor vignette in the shazam package. Technical details can be found in:

Gupta NT, et al. (2017). Hierarchical clustering can identify B cell clones with
    high confidence in Ig repertoire sequencing data.
    The Journal of Immunology 198(6):2489-2499.

Identifying clonal groups using hierachicalClones is largely the same as the approach using the identicalClones function, with the additional requirement of a distance threshold:

# Clonal assignment using hierarchical clustering
results <- hierarchicalClones(ExampleDb, threshold=0.15)

The results data.frame, summary plots, and summary table are accessed in the same manner as above. This will show the minimum inter (between) and maximum intra (within) clonal distances along with an effective threshold, which is an explanatory value calculated to represent the cut-off separating the inter and intra clonal distances. The effective threshold may differ from clustering threshold provided as input to hierarchicalClones.

# Get results data.frame
results_db <- as.data.frame(results)
glimpse(results_db)
## Rows: 2,000
## Columns: 16
## $ sequence_id               <chr> "GN5SHBT01EOOGB", "GN5SHBT06H5CUA", "GN5SHBT04EFLMK", "GN5SHBT02BH08U", "GN5SHBT01A6IAJ", "GN5SHBT08JDG2C", "GN5SHBT04CSILO", "GN5SHBT04A0OTA", "GN5SHBT07H3V3C", "GN…
## $ sequence_alignment        <chr> "CAGGTTCAGCTGGTGCAGTCTGGAGCT...GAGGTGAAGAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGGCTTCTGGTTACACCTTT............ACCAGCTATGGTATCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGATGGGATG…
## $ germline_alignment        <chr> "CAGGTTCAGCTGGTGCAGTCTGGAGCT...GAGGTGAAGAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGGCTTCTGGTTACACCTTT............ACCAGCTATGGTATCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGATGGGATG…
## $ germline_alignment_d_mask <chr> "CAGGTTCAGCTGGTGCAGTCTGGAGCT...GAGGTGAAGAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGGCTTCTGGTTACACCTTT............ACCAGCTATGGTATCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGATGGGATG…
## $ v_call                    <chr> "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F…
## $ v_call_genotyped          <chr> "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", …
## $ d_call                    <chr> "Homsap IGHD2-8*01 F", "Homsap IGHD3-22*01 F", "Homsap IGHD3-3*01 F", "Homsap IGHD3-3*01 F", "Homsap IGHD2-21*02 F", "Homsap IGHD3-3*01 F", "Homsap IGHD3-3*01 F", "H…
## $ j_call                    <chr> "Homsap IGHJ4*02 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F…
## $ c_call                    <chr> "IGHM", "IGHM", "IGHD", "IGHD", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHA", "IGHM", "IGHA", "IGHA", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM…
## $ junction                  <chr> "TGTGCGAGAGATCTGGGGGATATTGTACTAATGGTGTATGCCGACCAGTACCCCATATTGGGGTACTACTTTGACTACTGG", "TGTGCGAGAGACCACGCGTCCCTAATGCGCTACTATGATAGTAGTGGTTATTACCGGGGGAACCCAAATATTGACTACT…
## $ junction_length           <dbl> 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 75, 75, 75, 75, 75, 75, 75, 75, 75, 54, 54, 54, 63, 81, 81, 81, 81, 81, 90, 90, 90, 9…
## $ np1_length                <dbl> 6, 19, 13, 13, 27, 26, 16, 7, 20, 19, 26, 9, 5, 11, 7, 6, 28, 21, 11, 19, 13, 13, 11, 11, 11, 32, 12, 8, 8, 3, 1, 7, 10, 12, 12, 12, 11, 7, 49, 49, 49, 49, 49, 49, 1…
## $ np2_length                <dbl> 23, 16, 18, 18, 6, 9, 28, 27, 21, 16, 31, 35, 34, 30, 37, 37, 1, 17, 27, 24, 4, 15, 3, 3, 8, 6, 10, 13, 13, 6, 10, 16, 10, 33, 33, 33, 17, 49, 9, 9, 9, 9, 9, 9, 4, 1…
## $ duplicate_count           <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 11, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,…
## $ sample_id                 <chr> "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h…
## $ clone_id                  <chr> "1", "2", "3", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "22", "23", "24", "25", "26", "26", "…
# Plot a histogram of inter and intra clonal distances
plot(results, binwidth=0.02)

plot of chunk Scoper-Vignette-5

# Get summary data.frame
glimpse(summary(results))
## Rows: 156
## Columns: 7
## $ vjl_group       <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, …
## $ sequence_count  <int> 20, 1, 1, 1, 12, 7, 3, 1, 12, 5, 37, 4, 5, 10, 6, 9, 5, 4, 5, 2, 4, 1, 2, 1, 2, 1, 24, 25, 7, 2, 3, 3, 12, 1, 15, 26, 3, 22, 35, 2, 4, 1, 13, 3, 8, 15, 1, 2, 3, 4, 4, 28, 1, 1…
## $ v_call          <chr> "Homsap IGHV1-18*01 F", "Homsap IGHV1-46*01 F,Homsap IGHV1-46*03 F", "Homsap IGHV5-10-1*01 F", "Homsap IGHV5-10-1*01 F", "Homsap IGHV5-10-1*03 F,Homsap IGHV5-10-1*01 F", "Homs…
## $ j_call          <chr> "Homsap IGHJ4*02 F,Homsap IGHJ4*03 F,Homsap IGHJ4*01 F", "Homsap IGHJ2*01 F", "Homsap IGHJ2*01 F", "Homsap IGHJ3*01 F", "Homsap IGHJ5*02 F,Homsap IGHJ5*01 F", "Homsap IGHJ6*02…
## $ junction_length <int> 81, 81, 60, 102, 69, 66, 84, 96, 66, 75, 75, 84, 93, 60, 75, 87, 54, 63, 51, 60, 75, 60, 69, 57, 57, 78, 54, 63, 78, 87, 72, 90, 75, 36, 75, 72, 81, 60, 69, 72, 69, 90, 48, 93…
## $ clone_count     <int> 19, 1, 1, 1, 5, 7, 3, 1, 11, 4, 36, 4, 3, 6, 5, 9, 5, 4, 5, 2, 3, 1, 2, 1, 2, 1, 20, 25, 6, 1, 3, 2, 10, 1, 15, 22, 3, 13, 32, 2, 4, 1, 13, 3, 3, 9, 1, 2, 3, 4, 3, 24, 1, 1, 3…
## $ clone_id        <chr> "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19", "518", "582", "685", "727,728,729,730,731", "822,823,824,825,826,827,828", "891,892,893", "947", "1003,1004,1005,1006,1007,1…

Identifying clones by spectral clustering

While the hierarchical clustering method groups sequences using a fixed distance supervised threshold, the spectral clustering-based model uses an adaptive unsupervised threshold to tune the required level of similarity among sequences in different local neighborhoods. It can be used as an alternative if the nearest-neighbor distance distribution is unimodal, meaning that findThreshold wasn’t able to find the threshold at which to cut the hierarchy.

There are two available spectral clustering methods provided by the spectralClones function:

  1. method="novj": Infers clonal relationships using an adaptive threshold that indicates the level of similarity among junction sequences in a local neighborhood
  2. method="vj": Infers clonal relationships not only based on the junction region homology, but also taking into account the mutation profiles in the V and J segments

It is not mandatory, but a fixed threshold can also be provided to spectralClones (threshold argument) which will enforce an upper-limit cut-off. When specifying the threshold argument, any sequence with distances above the threshold value from all sequences will become a singleton. The threshold can be defined as discussed above using nearest-neighbor distance distribution methods provided in the shazam. If method="vj", the threshold will be applied on the distances calculated combining junction region homology and V/J mutation profiles. Technical details can be found in:

Nouri N and Kleinstein SH (2018). A spectral clustering-based method for
    identifying clones from high-throughput B cell repertoire sequencing data.
    Bioinformatics, 34(13):i341-i349.

Nouri N and Kleinstein SH (2019). Somatic hypermutation analysis for improved
    identification of B cell clonal families from next-generation sequencing data,
    bioRxiv doi: 10.1101/788620.

The following examples calls the spectralClones function with(out) the same (optional) threshold used previously to define clones using the hierachical approach. The results data.frame, summary plots, and summary table are accessed in the same manner as shown above using the hierachical approach.

# Clonal assignment using the spectral clustering method novj
results <- spectralClones(ExampleDb, method="novj")
# Plot a histogram of inter and intra clonal distances
plot(results, binwidth=0.02)

plot of chunk Scoper-Vignette-6

# Clonal assignment using the spectral clustering method novj with threshold
results <- spectralClones(ExampleDb, method="novj",
                          threshold=0.15)
# Plot a histogram of inter and intra clonal distances
plot(results, binwidth=0.02)

plot of chunk Scoper-Vignette-7

# Clonal assignment using the spectral clustering method vj with threshold
results <- spectralClones(ExampleDb, method="vj",
                          threshold=0.15,
                          germline="germline_alignment_d_mask")
# Get results data.frame
results_db <- as.data.frame(results)
glimpse(results_db)
## Rows: 2,000
## Columns: 16
## $ sequence_id               <chr> "GN5SHBT01EOOGB", "GN5SHBT06H5CUA", "GN5SHBT04EFLMK", "GN5SHBT02BH08U", "GN5SHBT01A6IAJ", "GN5SHBT08JDG2C", "GN5SHBT04CSILO", "GN5SHBT04A0OTA", "GN5SHBT07H3V3C", "GN…
## $ sequence_alignment        <chr> "CAGGTTCAGCTGGTGCAGTCTGGAGCT...GAGGTGAAGAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGGCTTCTGGTTACACCTTT............ACCAGCTATGGTATCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGATGGGATG…
## $ germline_alignment        <chr> "CAGGTTCAGCTGGTGCAGTCTGGAGCT...GAGGTGAAGAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGGCTTCTGGTTACACCTTT............ACCAGCTATGGTATCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGATGGGATG…
## $ germline_alignment_d_mask <chr> "CAGGTTCAGCTGGTGCAGTCTGGAGCT...GAGGTGAAGAAGCCTGGGGCCTCAGTGAAGGTCTCCTGCAAGGCTTCTGGTTACACCTTT............ACCAGCTATGGTATCAGCTGGGTGCGACAGGCCCCTGGACAAGGGCTTGAGTGGATGGGATG…
## $ v_call                    <chr> "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F", "Homsap IGHV1-18*01 F…
## $ v_call_genotyped          <chr> "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", "IGHV1-18*01", …
## $ d_call                    <chr> "Homsap IGHD2-8*01 F", "Homsap IGHD3-22*01 F", "Homsap IGHD3-3*01 F", "Homsap IGHD3-3*01 F", "Homsap IGHD2-21*02 F", "Homsap IGHD3-3*01 F", "Homsap IGHD3-3*01 F", "H…
## $ j_call                    <chr> "Homsap IGHJ4*02 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F", "Homsap IGHJ4*03 F…
## $ c_call                    <chr> "IGHM", "IGHM", "IGHD", "IGHD", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHA", "IGHM", "IGHA", "IGHA", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM", "IGHM…
## $ junction                  <chr> "TGTGCGAGAGATCTGGGGGATATTGTACTAATGGTGTATGCCGACCAGTACCCCATATTGGGGTACTACTTTGACTACTGG", "TGTGCGAGAGACCACGCGTCCCTAATGCGCTACTATGATAGTAGTGGTTATTACCGGGGGAACCCAAATATTGACTACT…
## $ junction_length           <dbl> 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 75, 75, 75, 75, 75, 75, 75, 75, 75, 54, 54, 54, 63, 81, 81, 81, 81, 81, 90, 90, 90, 9…
## $ np1_length                <dbl> 6, 19, 13, 13, 27, 26, 16, 7, 20, 19, 26, 9, 5, 11, 7, 6, 28, 21, 11, 19, 13, 13, 11, 11, 11, 32, 12, 8, 8, 3, 1, 7, 10, 12, 12, 12, 11, 7, 49, 49, 49, 49, 49, 49, 1…
## $ np2_length                <dbl> 23, 16, 18, 18, 6, 9, 28, 27, 21, 16, 31, 35, 34, 30, 37, 37, 1, 17, 27, 24, 4, 15, 3, 3, 8, 6, 10, 13, 13, 6, 10, 16, 10, 33, 33, 33, 17, 49, 9, 9, 9, 9, 9, 9, 4, 1…
## $ duplicate_count           <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 11, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,…
## $ sample_id                 <chr> "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h", "-1h…
## $ clone_id                  <chr> "1", "2", "3", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "22", "23", "24", "25", "26", "26", "…
# Plot a histogram of inter and intra clonal distances
plot(results, binwidth=0.02)

plot of chunk Scoper-Vignette-9

# Get summary data.frame
glimpse(summary(results))
## Rows: 156
## Columns: 7
## $ vjl_group       <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, …
## $ sequence_count  <int> 20, 1, 1, 1, 12, 7, 3, 1, 12, 5, 37, 4, 5, 10, 6, 9, 5, 4, 5, 2, 4, 1, 2, 1, 2, 1, 24, 25, 7, 2, 3, 3, 12, 1, 15, 26, 3, 22, 35, 2, 4, 1, 13, 3, 8, 15, 1, 2, 3, 4, 4, 28, 1, 1…
## $ v_call          <chr> "Homsap IGHV1-18*01 F", "Homsap IGHV1-46*01 F,Homsap IGHV1-46*03 F", "Homsap IGHV5-10-1*01 F", "Homsap IGHV5-10-1*01 F", "Homsap IGHV5-10-1*03 F,Homsap IGHV5-10-1*01 F", "Homs…
## $ j_call          <chr> "Homsap IGHJ4*02 F,Homsap IGHJ4*03 F,Homsap IGHJ4*01 F", "Homsap IGHJ2*01 F", "Homsap IGHJ2*01 F", "Homsap IGHJ3*01 F", "Homsap IGHJ5*02 F,Homsap IGHJ5*01 F", "Homsap IGHJ6*02…
## $ junction_length <int> 81, 81, 60, 102, 69, 66, 84, 96, 66, 75, 75, 84, 93, 60, 75, 87, 54, 63, 51, 60, 75, 60, 69, 57, 57, 78, 54, 63, 78, 87, 72, 90, 75, 36, 75, 72, 81, 60, 69, 72, 69, 90, 48, 93…
## $ clone_count     <int> 19, 1, 1, 1, 6, 7, 3, 1, 11, 4, 9, 4, 3, 7, 5, 9, 4, 3, 3, 2, 3, 1, 2, 1, 2, 1, 21, 11, 4, 1, 3, 2, 10, 1, 4, 11, 3, 14, 21, 2, 4, 1, 3, 3, 4, 10, 1, 2, 3, 4, 3, 25, 1, 1, 3, …
## $ clone_id        <chr> "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19", "465", "514", "585", "619,620,621,622,623,624", "682,683,684,685,686,687,688", "752,753,754", "809", "863,864,865,866,867,86…