Skip to content

Commit

Permalink
fix a bug in AA conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
FreshAirTonight committed Sep 8, 2024
1 parent 6028657 commit 1929612
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tools/check_msa_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


#from alphafold.data.complex import read_af2c_target_file,initialize_template_feats
from alphafold.common.residue_constants import restypes
from alphafold.common.residue_constants import ID_TO_HHBLITS_AA as aa_dict


import numpy as np
Expand All @@ -42,10 +42,10 @@
FLAGS = flags.FLAGS
Flag = Type[FLAGS]


## previous mapping was incorrect, commented out
## number to AA mapping
aa_dict = {i: restypes[i] for i in range(20)}
aa_dict[21] = '-'
#aa_dict = {i: restypes[i] for i in range(20)}
#aa_dict[21] = '-'


##################################################################################################
Expand All @@ -59,7 +59,7 @@ def main(argv):
features_input_path = argv[1]

if not os.path.exists(features_input_path):
raise Exception(f"Error: could not locate feature input file under {feature_dir}" )
raise Exception(f"Error: could not locate file {features_input_path}" )

with hook_compressed(features_input_path, "rb") as f:
mono_feature_dict = None
Expand All @@ -69,6 +69,10 @@ def main(argv):
T = mono_feature_dict["template_all_atom_positions"].shape[0]
print(f"Info: found msa_depth = {N}, seq_len = {L}, num_templ = {T}")

target_seq = mono_feature_dict["sequence"][0].decode('utf-8')
print(f"Info: target sequence")
print(f"Info: {target_seq}")

msa = mono_feature_dict["msa"][:FLAGS.num_msa_seq,:]
species = mono_feature_dict['msa_species_identifiers'][:FLAGS.num_msa_seq]
templ_name = mono_feature_dict["template_domain_names"][:FLAGS.num_templates]
Expand Down

0 comments on commit 1929612

Please sign in to comment.