CloneResidency¶
Identification of clone residency
This process is used to investigate the residency of clones in groups, typically two
samples (e.g. tumor and normal) from the same patient. But it can be used for any two groups of clones.
There are three types of output from this process
-
Count tables of the clones in the two groups
CDR3_aa Tumor Normal CASSYGLSWGSYEQYF 306 55 CASSVTGAETQYF 295 37 CASSVPSAHYNEQFF 197 9 ... ... ... -
Residency plots showing the residency of clones in the two groups
The points in the plot are jittered to avoid overplotting. The x-axis is the residency in the first group and the y-axis is the residency in the second group. The size of the points are relative to the normalized size of the clones. You may identify different types of clones in the plot based on their residency in the two groups:
- Collapsed (The clones that are collapsed in the second group)
- Dual (The clones that are present in both groups with equal size)
- Expanded (The clones that are expanded in the second group)
- First Group Multiplet (The clones only in the First Group with size > 1)
- Second Group Multiplet (The clones only in the Second Group with size > 1)
- First Group Singlet (The clones only in the First Group with size = 1)
- Second Group Singlet (The clones only in the Second Group with size = 1)
This idea is borrowed from this paper:
-
Venn diagrams showing the overlap of the clones in the two groups
Environment Variables¶
subject
(list
): Default:[]
.
The key of subject in metadata. The clone residency will be examined for this subject/patientgroup
: The key of group in metadata. This usually marks the samples that you want to compare. For example, Tumor vs Normal, post-treatment vs baseline It doesn't have to be 2 groups always. If there are more than 3 groups, instead of venn diagram, upset plots will be used.order
(list
): Default:[]
.
The order of the values ingroup
. In scatter/residency plots,X
inX,Y
will be used as x-axis andY
will be used as y-axis.
You can also have multiple orders. For example:["X,Y", "X,Z"]
.
If you only have two groups, you can setorder = ["X", "Y"]
, which will be the same asorder = ["X,Y"]
.section
: How the subjects aligned in the report. Multiple subjects with the same value will be grouped together.
Useful for cohort with large number of samples.mutaters
(type=json
): Default:{}
.
The mutaters passed todplyr::mutate()
on the cell-level data converted fromin.immdata
. Ifin.metafile
is provided, the mutaters will be applied to the joined data.
The keys will be the names of the new columns, and the values will be the expressions. The new names can be used insubject
,group
,order
andsection
.subset
: The filter passed todplyr::filter()
to filter the data for the cells before calculating the clone residency. For example,Clones > 1
to filter out singletons.prefix
: Default:{Sample}_
.
The prefix of the cell barcodes in theSeurat
object.upset_ymax
: The maximum value of the y-axis in the upset bar plots.upset_trans
: The transformation to apply to the y axis of upset bar plots.
For example,log10
orsqrt
. If not specified, the y axis will be plotted as is. Note that the position of the bar plots will be dodged instead of stacked when the transformation is applied.
See also https://github.com/tidyverse/ggplot2/issues/3671cases
(type=json
): Default:{}
.
If you have multiple cases, you can use this argument to specify them. The keys will be used as the names of the cases.
The values will be passed to the corresponding arguments.
If no cases are specified, the default case will be added, with the nameDEFAULT
and the values ofenvs.subject
,envs.group
,envs.order
andenvs.section
. These values are also the defaults for the other cases.