Usage principles¶
Import scirpy as
import scanpy as sc
import scirpy as ir
Workflow¶
Scirpy is an extension to Scanpy and adheres to its workflow principles:
We decided to handle a few minor points differenlty to Scanpy:
Plotting functions with inexpensive computations (e.g.
scirpy.pl.clonal_expansion()
) call the corresponding tool (scirpy.tl.clonal_expansion()
) on-the-fly and don’t store the results in theAnnData
object.All plotting functions, by default, return a
Axes
object, or a list of such.
Data structure¶
For instructions how to load data into scirpy, see Loading TCR data with scirpy.
Scirpy leverages the AnnData data structure
which combines a gene expression matrix (.X
), gene-level annotations (.var
) and
cell-level annotations (.obs
) into a single object. AnnData
forms the basis for the
Scanpy analysis workflow
for single-cell transcriptomics data.
Image by F. Alex Wolf.¶
Scirpy adds the following TCR-related columns to AnnData.obs
:
has_tcr
:True
for all cells with a T-cell receptor
TRA_1_<attr>
/TRA_2_<attr>
: columns related to the primary and secondary TCR-alpha chain
TRB_1_<attr>
/TRB_2_<attr>
: columns related to the primary and secondary TCR-beta chain
Where <attr>
is any of:
c_gene
,v_gene
,d_gene
,j_gene
: The gene symbols of the respective genes
cdr3
andcdr3_nt
: The amino acoid and nucleotide sequences of the CDR3 regions
junction_ins
: The number of nucleotides inserted in theVD
+DJ
junctions or theVJ
junction, respectively.