@@ -306,7 +306,7 @@ void print_neighbour_parameter(FILE *parameterOutFile, Str *pdb, Type *type, \
306306}
307307
308308/*____________________________________________________________________________*/
309- /** print interface residue pairs */
309+ /** print interface ( residue pairs) */
310310/* nearest neighbour atom pairs on different chains */
311311void print_interface (FILE * interfaceOutFile , Arg * arg , Str * pdb , Type * type , Topol * topol )
312312{
@@ -442,13 +442,25 @@ void print_sasa(Arg *arg, Argpdb *argpdb, Str *pdb, Type *type, Topol *topol, \
442442
443443 /* neighbour list */
444444 if (arg -> neighbourOut ) {
445- if (frame < 0 )
446- arg -> neighbourOutFile = safe_open (arg -> neighbourOutFileName , "w" );
447- else
448- arg -> neighbourOutFile = safe_open (arg -> neighbourOutFileName , "a" );
449-
450- print_neighbour_list (arg -> neighbourOutFile , arg , pdb , topol );
451- fclose (arg -> neighbourOutFile );
445+ if (arg -> rout ) {
446+ sprintf (rpopsOutFileName , "%s/%s.%s" ,
447+ arg -> outDirName , arg -> routPrefix , "neighbours.out" );
448+ if (frame < 0 ) {
449+ rpopsOutFile = safe_open (rpopsOutFileName , "w" );
450+ } else {
451+ rpopsOutFile = safe_open (rpopsOutFileName , "a" );
452+ }
453+ print_neighbour_list (arg -> neighbourOutFile , arg , pdb , topol );
454+ fclose (rpopsOutFile );
455+ } else {
456+ if (frame < 0 ) {
457+ arg -> neighbourOutFile = safe_open (arg -> neighbourOutFileName , "w" );
458+ } else {
459+ arg -> neighbourOutFile = safe_open (arg -> neighbourOutFileName , "a" );
460+ }
461+ print_neighbour_list (arg -> neighbourOutFile , arg , pdb , topol );
462+ fclose (arg -> neighbourOutFile );
463+ }
452464 }
453465
454466 /* neighbour parameters (for benchmarking) */
@@ -464,13 +476,25 @@ void print_sasa(Arg *arg, Argpdb *argpdb, Str *pdb, Type *type, Topol *topol, \
464476
465477 /* interface residue pairs */
466478 if (arg -> interfaceOut ) {
467- if (frame < 0 )
468- arg -> interfaceOutFile = safe_open (arg -> interfaceOutFileName , "w" );
469- else
470- arg -> interfaceOutFile = safe_open (arg -> interfaceOutFileName , "a" );
471-
472- print_interface (arg -> interfaceOutFile , arg , pdb , type , topol );
473- fclose (arg -> interfaceOutFile );
479+ if (arg -> rout ) {
480+ sprintf (rpopsOutFileName , "%s/%s.%s" ,
481+ arg -> outDirName , arg -> routPrefix , "interface.out" );
482+ if (frame < 0 ) {
483+ rpopsOutFile = safe_open (rpopsOutFileName , "w" );
484+ } else {
485+ rpopsOutFile = safe_open (rpopsOutFileName , "a" );
486+ }
487+ print_interface (arg -> interfaceOutFile , arg , pdb , type , topol );
488+ fclose (rpopsOutFile );
489+ } else {
490+ if (frame < 0 ) {
491+ arg -> interfaceOutFile = safe_open (arg -> interfaceOutFileName , "w" );
492+ } else {
493+ arg -> interfaceOutFile = safe_open (arg -> interfaceOutFileName , "a" );
494+ }
495+ print_interface (arg -> interfaceOutFile , arg , pdb , type , topol );
496+ fclose (arg -> interfaceOutFile );
497+ }
474498 }
475499}
476500
0 commit comments