File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
import numpy as np
2
2
import sapiens
3
+ from abnumber import Chain
4
+ from biophi .humanization .methods .humanization import humanize_chain , SapiensHumanizationParams
3
5
4
6
5
7
def test_sapiens_predict ():
@@ -11,3 +13,17 @@ def test_sapiens_predict():
11
13
)
12
14
assert pred .shape == (len (seq ), 20 ), 'Expected matrix (length of sequence * 20 amino acids)'
13
15
assert (pred .idxmax (axis = 1 ).values == np .array (list (seq ))).sum () > 100 , 'Prediction should be similar to input sequence'
16
+
17
+
18
+ def test_sapiens_humanize ():
19
+ seq = 'QVQLVQSGVEVKKPGASVKVSCKASGYTFTNYYMYWVRQAPGQGLEWMGGINPSNGGTNFNEKFKNRVTLTTDSSTTTAYMELKSLQFDDTAVYYCARRDYRFDMGFDYWGQGTTVTVSS'
20
+ chain = Chain (seq , scheme = 'kabat' )
21
+ humanization_params = SapiensHumanizationParams (
22
+ model_version = 'latest' ,
23
+ humanize_cdrs = False ,
24
+ scheme = 'kabat' ,
25
+ cdr_definition = 'kabat' ,
26
+ iterations = 1
27
+ )
28
+ humanization = humanize_chain (chain , params = humanization_params )
29
+ assert humanization .humanized_chain .seq == 'QVQLVQSGAEVKKPGASVKVSCKASGYTFTNYYMYWVRQAPGQGLEWMGGINPSNGGTNFNEKFKNRVTLTTDTSTTTAYMELRSLRSDDTAVYYCARRDYRFDMGFDYWGQGTLVTVSS'
You can’t perform that action at this time.
0 commit comments