Skip to content

Commit

Permalink
Support multi character chain labels in CIF output format (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmloy committed Mar 15, 2024
1 parent e6783ae commit 89de8c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cif.cc
Expand Up @@ -603,7 +603,7 @@ populate_freesasa_result_vectors(gemmi::cif::Table &table, freesasa_node *result
append_freesasa_rsa_residue_to_block(table.bloc, residue);
atom = freesasa_node_children(residue);
while (atom) {
auto cName = std::string(1, freesasa_node_atom_chain(atom));
auto cName = std::string(freesasa_node_atom_chain(atom));
// TODO figure out why this returns decimal string sometimes
auto rNum = std::to_string(std::atoi(freesasa_node_atom_residue_number(atom)));
auto rName = freesasa_node_atom_residue_name(atom);
Expand Down
2 changes: 1 addition & 1 deletion src/freesasa.h
Expand Up @@ -1670,7 +1670,7 @@ freesasa_node_atom_residue_name(const freesasa_node *node);
@ingroup node
*/
char freesasa_node_atom_chain(const freesasa_node *node);
char* freesasa_node_atom_chain(const freesasa_node *node);

/**
Residue number.
Expand Down
6 changes: 3 additions & 3 deletions src/node.c
Expand Up @@ -14,7 +14,7 @@ struct atom_properties {
int is_bb;
double radius;
char *pdb_line;
char chain;
char *chain;
char *res_number;
char *res_name;
};
Expand Down Expand Up @@ -231,7 +231,7 @@ node_atom(const freesasa_structure *structure,
atom->properties.atom.is_polar = freesasa_structure_atom_class(structure, atom_index) == FREESASA_ATOM_POLAR;
atom->properties.atom.is_bb = freesasa_atom_is_backbone(atom->name);
atom->properties.atom.radius = freesasa_structure_atom_radius(structure, atom_index);
atom->properties.atom.chain = freesasa_structure_atom_chain(structure, atom_index);
atom->properties.atom.chain = freesasa_structure_atom_chain_lcl(structure, atom_index);

atom->properties.atom.res_number = strdup(freesasa_structure_atom_res_number(structure, atom_index));
if (atom->properties.atom.res_number == NULL) {
Expand Down Expand Up @@ -590,7 +590,7 @@ freesasa_node_atom_residue_name(const freesasa_node *node)
return node->properties.atom.res_name;
}

char freesasa_node_atom_chain(const freesasa_node *node)
char* freesasa_node_atom_chain(const freesasa_node *node)
{
assert(node->type == FREESASA_NODE_ATOM);
return node->properties.atom.chain;
Expand Down

0 comments on commit 89de8c8

Please sign in to comment.