rstoolbox.components.DesignSeries.generate_mutant_variants

DesignSeries.generate_mutant_variants(seqID, mutations, keep_scores=False)

Expands selected decoy sequences generating all the provided mutant combinations.

For all the new mutations provided, it will generate all the possible combinations with those mutations and annotate them with respect to the reference_sequence.

A mutation will be specified as a tuple of length=2. The first position will be the sequence position to target (reference_shift aware) and the second will be a string with all the desired residue types. Multiple positions can be provided in a list():

mutants = [(20, "AIV"), (31, "EDQR")]

Lastly, when multiple changes are provided for a position, this will translate into an insertion.

Tip

The number of positions and mutations for position produce an exponential increment of the generated sequences. Thus, the previous example will generate 3 * 4 new sequences. Depending on the input this can explode pretty fast, be aware.

Tip

* will call all 20 regular amino acids for a given position.

Alters the names of the designs in description by adding a _v<number> suffix.

By providing multiple input decoys, sequence can be repeated. Thus, repeated sequences will be filtered; the provided copy will be the first instance of the sequence.

Parameters:
  • seqID (str) – Identifier of the sequence of interest.
  • mutations (list() of tuple (int, str)) – List of mutations to generate in a format (position, variants)
  • keep_scores (bool) – New variants inherit scores from their source sequence. This is not recommended, as it can get confusing (Default: False).
Returns:

DesignFrame

Example

In [1]: from rstoolbox.io import parse_rosetta_file
   ...: import pandas as pd
   ...: pd.set_option('display.width', 1000)
   ...: pd.set_option('display.max_columns', 500)
   ...: df = parse_rosetta_file("../rstoolbox/tests/data/input_2seq.minisilent.gz",
   ...:                         {'scores': ['score', 'description'], 'sequence': 'B'})
   ...: df.add_reference_sequence('B', df.get_sequence('B').values[0])
   ...: mutants = [(20, "AIV"), (31, "EDQR")]
   ...: df.iloc[1].generate_mutant_variants('B', mutants)
   ...: 
Out[1]: 
                                                                                                              sequence_B                           description                                                                                                                                                                                                                                                                                                                                                                                              mutants_B                                                                                                                                                                                                                             mutant_positions_B  mutant_count_B
0   PKPEEAMREAYKLIKKYMLKAQKEAQEEWERMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002        T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,G21A,W22Q,E23K,H25A,E26Q,R27E,W31R,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R       1,2,7,8,9,11,12,14,15,16,17,19,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116     75            
1   PKPEEAMREAYKLIKKYMLAAQKEAQEEWEEMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0001  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20A,G21A,W22Q,E23K,H25A,E26Q,R27E,W31E,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
2   PKPEEAMREAYKLIKKYMLAAQKEAQEEWEDMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0002  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20A,G21A,W22Q,E23K,H25A,E26Q,R27E,W31D,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
3   PKPEEAMREAYKLIKKYMLAAQKEAQEEWEQMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0003  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20A,G21A,W22Q,E23K,H25A,E26Q,R27E,W31Q,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
4   PKPEEAMREAYKLIKKYMLAAQKEAQEEWERMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0004  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20A,G21A,W22Q,E23K,H25A,E26Q,R27E,W31R,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
5   PKPEEAMREAYKLIKKYMLIAQKEAQEEWEEMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0005  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20I,G21A,W22Q,E23K,H25A,E26Q,R27E,W31E,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
6   PKPEEAMREAYKLIKKYMLIAQKEAQEEWEDMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0006  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20I,G21A,W22Q,E23K,H25A,E26Q,R27E,W31D,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
7   PKPEEAMREAYKLIKKYMLIAQKEAQEEWEQMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0007  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20I,G21A,W22Q,E23K,H25A,E26Q,R27E,W31Q,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
8   PKPEEAMREAYKLIKKYMLIAQKEAQEEWERMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0008  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20I,G21A,W22Q,E23K,H25A,E26Q,R27E,W31R,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
9   PKPEEAMREAYKLIKKYMLVAQKEAQEEWEEMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0009  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20V,G21A,W22Q,E23K,H25A,E26Q,R27E,W31E,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
10  PKPEEAMREAYKLIKKYMLVAQKEAQEEWEDMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0010  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20V,G21A,W22Q,E23K,H25A,E26Q,R27E,W31D,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
11  PKPEEAMREAYKLIKKYMLVAQKEAQEEWEQMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0011  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20V,G21A,W22Q,E23K,H25A,E26Q,R27E,W31Q,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76            
12  PKPEEAMREAYKLIKKYMLVAQKEAQEEWERMRRTDGTKEEKDMFPEKMIAQALRAIGEIFNAYYWAFLKLQEFKKYPSVRWEEQEEARKRLKIMMKIGAEWAREIAREMKERIKR  test_3lhp_binder_labeled_00002_v0012  T1P,R2K,R7M,E8R,R9E,W11Y,R12K,A14I,E15K,I16K,A17Y,R19L,K20V,G21A,W22Q,E23K,H25A,E26Q,R27E,W31R,W32M,K33R,A35T,S36D,K37G,G38T,R39K,R42K,L45F,R48K,A52Q,E64Y,W65Y,Q66W,M67A,R68F,E70K,M71L,E72Q,K73E,E74F,R75K,N77Y,N79S,A80V,G81R,E82W,K84E,M85Q,K86E,Q88A,K89R,E91R,A92L,W93K,K94I,I95M,A96M,Y97K,Y98I,W99G,G100A,L101E,M102W,A104R,Y105E,W106I,I107A,K108R,Q109E,H110M,R111K,K113R,E114I,R115K,K116R  1,2,7,8,9,11,12,14,15,16,17,19,20,21,22,23,25,26,27,31,32,33,35,36,37,38,39,42,45,48,52,64,65,66,67,68,70,71,72,73,74,75,77,79,80,81,82,84,85,86,88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116  76