and has a digit in the third character. In that case the name is expected
to be protein. However, in this case e.g. Si12 will be designated as Sulphur.
The alternative would be to check whether the present residue is an amino acid
but that may be problematic as well.
void get_pdb_atomnumber(t_atoms *atoms,gmx_atomprop_t aps)
{
- int i,atomnumber;
+ int i,atomnumber,len;
size_t k;
char anm[6],anm_copy[6];
char nc='\0';
for(i=0; (i<atoms->nr); i++) {
strcpy(anm,atoms->pdbinfo[i].atomnm);
strcpy(anm_copy,atoms->pdbinfo[i].atomnm);
+ len = strlen(anm);
atomnumber = NOTSET;
- if (anm[0] != ' ') {
+ if ((anm[0] != ' ') && ((len <=2) || ((len > 2) && !isdigit(anm[2])))) {
anm_copy[2] = nc;
if (gmx_atomprop_query(aps,epropElement,"???",anm_copy,&eval))
atomnumber = gmx_nint(eval);