Clonotype¶
A class to model the clonotype input data.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
the label of the clonotype |
alignment |
dict
|
the multiple sequence alignment for the BCR sequences |
isotypes |
dict
|
the encoded isotypes of the sequenced B cells |
forest |
list
|
a list of networkx.Digraphs containing the maximum parsimony forest for a the multiple sequence alignment |
isotype_encoding |
list
|
an ordered list of the labels of the isotypes. This is important because naming conventions of isotype states, i.e., IgM, M, IghM, ighm, vary across datasets. |
Source code in tribal/clonotype.py
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
__getitem__(key)
¶
Slice a tree in the parsimony forest.
Source code in tribal/clonotype.py
60 61 62 |
|
add(tree)
¶
Add a tree to the parsimony forest.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tree |
DiGraph
|
a tree to add to the parsimony forest |
required |
Source code in tribal/clonotype.py
51 52 53 54 55 56 57 58 |
|
generate_from_list(tree_list, root=None)
¶
Populate the parsimony forst from a list of networkx digraphs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tree_list |
list
|
a list of nx.DiGraphs containing the trees to populate the parsimony forest |
required |
root |
str
|
the root id of each B cell lineage tree |
None
|
Source code in tribal/clonotype.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
get_forest()
¶
Return the parsimony forest.
Source code in tribal/clonotype.py
68 69 70 |
|
save(fname)
¶
Pickle the clonotype.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fname |
str
|
the filename where the clonotype should be pickled. |
required |
Source code in tribal/clonotype.py
72 73 74 75 76 77 78 79 80 81 |
|
size()
¶
Return the size of the parsimony forest.
Source code in tribal/clonotype.py
64 65 66 |
|