From 6d7e84677be71686b42652f13e331f0933f402ae Mon Sep 17 00:00:00 2001 From: pschmidtke Date: Fri, 23 Feb 2024 21:32:54 +0100 Subject: [PATCH] issue-129 correcting behaviour from pdb to mmcif --- src/rpdb.c | 26 +++++++++++++++++++++----- src/writepdb.c | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/rpdb.c b/src/rpdb.c index ee517b10..2341e605 100644 --- a/src/rpdb.c +++ b/src/rpdb.c @@ -1161,6 +1161,9 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb atom->radius = pte_get_vdw_ray(atom->symbol); atom->electroneg = pte_get_enegativity(atom->symbol); atom->sort_x = -1; + atom->label_seq_id=atom->res_id; + strcpy(atom->label_asym_id, atom->chain); + atoms_p[iatoms] = atom; iatoms++; @@ -1189,7 +1192,9 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb atom->radius = pte_get_vdw_ray(atom->symbol); atom->electroneg = pte_get_enegativity(atom->symbol); atom->sort_x = -1; - + atom->label_seq_id=atom->res_id; + strcpy(atom->label_asym_id, atom->chain); + atoms_p[iatoms] = atom; iatoms++; @@ -1215,6 +1220,9 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb atom->radius = pte_get_vdw_ray(atom->symbol); atom->electroneg = pte_get_enegativity(atom->symbol); atom->sort_x = -1; + atom->label_seq_id=atom->res_id; + strcpy(atom->label_asym_id, atom->chain); + // printf("type : %s, id : %d, name : %s, aloc : %c, res_name : %s, chain : %s, res_id : %d, pdb_insert : %c, occupancy : %f, b_factor : %f, symbol : %s, charge : %d\n", // atom->type, atom->id,atom->name ,atom->pdb_aloc,atom->res_name,atom->chain,atom->res_id,atom->pdb_insert,atom->occupancy,atom->bfactor, atom->symbol,atom->charge); // printf("electroneg : %s\n",atom->symbol); @@ -1284,7 +1292,9 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb atom->radius = pte_get_vdw_ray(atom->symbol); atom->electroneg = pte_get_enegativity(atom->symbol); atom->sort_x = -1; - + atom->label_seq_id=atom->res_id; + strcpy(atom->label_asym_id, atom->chain); + atoms_p[iatoms] = atom; atm_lig[iatm_lig] = atom; @@ -1310,7 +1320,9 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb atom->radius = pte_get_vdw_ray(atom->symbol); atom->electroneg = pte_get_enegativity(atom->symbol); atom->sort_x = -1; - + atom->label_seq_id=atom->res_id; + strcpy(atom->label_asym_id, atom->chain); + atoms_p[iatoms] = atom; atm_lig[iatm_lig] = atom; @@ -1338,7 +1350,9 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb atom->radius = pte_get_vdw_ray(atom->symbol); atom->electroneg = pte_get_enegativity(atom->symbol); atom->sort_x = -1; - + atom->label_seq_id=atom->res_id; + strcpy(atom->label_asym_id, atom->chain); + atoms_p[iatoms] = atom; pdb->lhetatm[ihetatm] = atom; ihetatm++; @@ -1366,7 +1380,9 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb atom->radius = pte_get_vdw_ray(atom->symbol); atom->electroneg = pte_get_enegativity(atom->symbol); atom->sort_x = -1; - + atom->label_seq_id=atom->res_id; + strcpy(atom->label_asym_id, atom->chain); + atoms_p[iatoms] = atom; pdb->lhetatm[ihetatm] = atom; ihetatm++; diff --git a/src/writepdb.c b/src/writepdb.c index 37cde632..6e36f110 100644 --- a/src/writepdb.c +++ b/src/writepdb.c @@ -227,7 +227,7 @@ void write_mmcif_atom_line(FILE *f, const char rec_name[], int id, const char at sprintf(res_id_buf, "****"); alt_loc = (alt_loc == '\0' || (alt_loc == ' ')) ? '?' : alt_loc; - insert = (insert == '\0') ? '?' : insert; + insert = (insert == '\0' || insert==' ') ? '?' : insert; if (charge == -1) sprintf(charge_buf, " 0");