diff --git a/examples/using_rasp/querying_rasp.py b/examples/using_rasp/querying_rasp.py index 1df1e0a1..5aff86b8 100644 --- a/examples/using_rasp/querying_rasp.py +++ b/examples/using_rasp/querying_rasp.py @@ -4,13 +4,7 @@ """ from pathlib import Path -import numpy as np - -from poli.objective_repository.rasp.register import RaspBlackBox, RaspProblemFactory -from poli.core.problem_setup_information import ProblemSetupInformation - -from poli.core.util.proteins.defaults import AMINO_ACIDS -from poli.core.util.proteins.pdb_parsing import parse_pdb_as_residue_strings +from poli.objective_repository.rasp.register import RaspProblemFactory THIS_DIR = Path(__file__).parent.resolve() diff --git a/src/poli/core/util/proteins/rasp/rasp.py b/src/poli/core/util/proteins/rasp/rasp.py index 7317f617..32643b1e 100644 --- a/src/poli/core/util/proteins/rasp/rasp.py +++ b/src/poli/core/util/proteins/rasp/rasp.py @@ -396,8 +396,14 @@ def create_df_structure( for mutant_residue_string in mutant_residue_strings: if mutant_residue_string == wildtype_residue_string: # Then we append a mock mutation. + original_residue_as_single_character = wildtype_residue_string[0] + position_in_chain = res_info.iloc[0]["pos"] + mutant_residue_as_single_character = wildtype_residue_string[0] + mutations_in_rasp_format.append( - wildtype_residue_string[0] + f"{1}" + wildtype_residue_string[0] + original_residue_as_single_character + + f"{position_in_chain}" + + mutant_residue_as_single_character ) continue @@ -406,8 +412,14 @@ def create_df_structure( ) for edit_ in edits_: _, i, _ = edit_ + original_residue_as_single_character = wildtype_residue_string[i] + position_in_chain = res_info.iloc[i]["pos"] + mutant_residue_as_single_character = mutant_residue_string[i] + mutations_in_rasp_format.append( - wildtype_residue_string[i] + f"{i+1}" + mutant_residue_string[i] + original_residue_as_single_character + + f"{position_in_chain}" + + mutant_residue_as_single_character ) # Filter df_structure to only contain the mutations in