Skip to content

Commit 4442276

Browse files
committed
corrections in POPSC and added options to popscomp.R script
1 parent 144959d commit 4442276

11 files changed

Lines changed: 173 additions & 103 deletions

File tree

Docker/README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# POPScomp Docker container
2-
Since end of 2025, the 'Dockerfile' performs all the necessary
3-
installation steps and can be invoked using the scripts:
4-
```
5-
make_Docker_[Mac|Linux].bash
6-
```
72

83
Installation instructions are given in the Wiki of the
9-
POPScomp GitHub repository.
4+
POPScomp GitHub repository:
5+
https://github.com/Fraternalilab/POPScomp/wiki/Docker-Image
6+
7+
The simplest installation route is downloading the POPScomp
8+
image from the Docker repository.
109

10+
Alternatively the 'Dockerfile' can be run locally to compile
11+
that image.
12+
```
13+
make_Docker_[Mac|Linux].bash
14+
```
1115

1216
The legacy installations scripts 'onContainer_\*.bash'
1317
are kept here as a fall-back solution.

POPSC/src/arg.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,24 @@ int parse_args(int argc, char **argv, Arg *arg, Argpdb *argpdb)
191191
int c;
192192
const char usage[] = "\npops [--pdb ... | --pdbml ...] [OPTIONS ...]\n\
193193
INPUT OPTIONS\n\
194-
Input syntax is either '--pdb <name>.pdb[.gz]' or '--pdbml <name>.xml[.gz]'.\n\
195-
--mmcif <PDB input>\t\t(type: char , default: void)\n\
194+
Specify one format option: '--pdb', '--pdbml', '--mmcif'.\n\
195+
Input structures can be read compressed ('.gz');\n\
196+
specify '--pdb --zipped', the other formats detect compression.\n\
197+
\n\
198+
--mmcif <MMCIF input>\t\t(type: char , default: void)\n\
196199
--pdb <PDB input>\t\t(type: char , default: void)\n\
197200
--pdbml <PDBML input>\t(type: char , default: void)\n\
198201
--traj <trajectory input>\t(type: char , default: void)\n\
199202
--zipped\t\t\t(type: no_arg, default: off)\n\
203+
\n\
200204
MODE OPTIONS\n\
201205
--coarse\t\t\t(type: no_arg, default: off)\n\
202206
--hydrogens\t\t\t(type: no_arg, default: off)\n\
203207
--multiModel\t\t\t(type: no_arg, default: off)\n\
204208
--partOcc\t\t\t(type: no_arg, default: off)\n\
205209
--rProbe <probe radius [A]>\t(type: float , default: 1.4)\n\
206210
--silent\t\t\t(type: no_arg, default: off)\n\
211+
\n\
207212
OUTPUT OPTIONS\n\
208213
--outDirName <output dir>\t(type: char , default: NULL)\n\
209214
--popsOut <POPS output>\t(type: char , default: pops.out)\n\
@@ -227,6 +232,7 @@ int parse_args(int argc, char **argv, Arg *arg, Argpdb *argpdb)
227232
--rout\t\t\t(type: no_arg, default: off)\n\
228233
--routPrefix <prefix>\t(type: char , default: NULL)\n\
229234
--jsonOut\t\t\t(type: no_arg, default: off)\n\
235+
\n\
230236
INFO OPTIONS\n\
231237
--cite\t\t\t(type: no_arg, default: off)\n\
232238
--version\t\t\t(type: no_arg, default: off)\n\
@@ -288,6 +294,7 @@ int parse_args(int argc, char **argv, Arg *arg, Argpdb *argpdb)
288294
case 1:
289295
arg->pdbInFileName = optarg;
290296
arg->pdbIn = basename(optarg);
297+
arg->pdb = 1;
291298
break;
292299
case 2:
293300
arg->trajInFileName = optarg;

POPSC/src/pops

1.52 KB
Binary file not shown.

POPSC/src/pops.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,21 @@ int main(int argc, char *argv[])
9696
/** read input structure: mmcif, xml or pdb format */
9797
if (! arg.silent) fprintf(stdout, "Input structure\n");
9898
strcpy(pdb.pdbID, "");
99+
99100
if (arg.mmcif) {
101+
printf("Reading MMCIF file\n");
100102
/* 'gemmi' library function to read PDB entries */
101103
s = read_cif(arg.mmcifInFileName);
102104
/* map function to copy PDB entries to C structure */
103105
map_structure_mmcif(&arg, &argpdb, &pdb, s);
104106
} else if (arg.pdbml) {
107+
printf("Reading PDBML file\n");
105108
read_structure_xml(&arg, &argpdb, &pdb);
106109
} else if (arg.pdb) {
110+
printf("Reading PDB file\n");
107111
read_structure(&arg, &argpdb, &pdb);
108112
} else {
113+
printf("Failed to read an input structure!\n");
109114
exit(EXIT_FAILURE);
110115
}
111116

POPSC/src/putsasa.c

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */
311311
void 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

POPSC/tests/test4a.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ echo "--------------------------------------------------------------"
44
echo " test4a.sh "
55
echo "--------------------------------------------------------------"
66

7-
../src/pops --mmcif 1F3R.cif --compositionOut --typeOut --topologyOut --atomOut --residueOut --chainOut --neighboutOut --interfaceOut || exit 1
7+
../src/pops --mmcif 1F3R.cif --compositionOut --typeOut --topologyOut --atomOut --residueOut --chainOut --neighbourOut --interfaceOut || exit 1
88

POPSR/Rscript/1F3R.cif

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../POPSC/tests/1F3R.cif

0 commit comments

Comments
 (0)