Skip to content

Commit

Permalink
Merge pull request #133 from Discngine/issue-129
Browse files Browse the repository at this point in the history
issue-129 correcting behaviour from pdb to mmcif
  • Loading branch information
pschmidtke authored Feb 23, 2024
2 parents 1e861b1 + 6d7e846 commit 2bfce34
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
26 changes: 21 additions & 5 deletions src/rpdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down Expand Up @@ -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++;

Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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++;
Expand Down
2 changes: 1 addition & 1 deletion src/writepdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 2bfce34

Please sign in to comment.