Project

General

Profile

Bug #278

make_ndx fails to create group corresponding to the last residue

Added by Alexey Anikeenko over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
analysis tools
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Steps to reproduce:
E.g. when structure file contains eight 6-atom molecules:

$make_ndx -f conf.pdb
0 System : 48 atoms
1 CHE : 48 atoms

a 8

2 a_8 : 1 atoms

res 2

Index a_8 contains number>nres (8>7)
Group is empty

Possible fix:
--- a/make_ndx.c 2009-01-22 11:40:11.000000000 0600
+
+ b/make_ndx.c 2009-01-22 11:40:36.000000000 +0600
@ -317,7 +317,7 @

j0=block->index[group];
j1=block->index[group+1];
- nres = atoms->atom[atoms->nr-1].resnr;
+ nres = atoms->atom[atoms->nr-1].resnr+1;
for(j=j0; j<j1; j++)
if (block->a[j]>=nres) {
printf("Index %s contains number>nres (%d>%d)\n",
conf.pdb (3.3 KB) conf.pdb Example conf Alexey Anikeenko, 01/22/2009 06:49 AM

History

#1 Updated by Alexey Anikeenko over 10 years ago

Created an attachment (id=342)
Example conf

#2 Updated by Berk Hess over 10 years ago

A slightly cleaner fix is:
nres = atoms->nres

I committed this.

Thanks for reporting this with the fix,

Berk

Also available in: Atom PDF