Skip to content

Commit

Permalink
Allow for nodes files to be either PDB or mmCIF
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Sep 12, 2024
1 parent 41fa2d6 commit d57d13c
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions scripts/runMultiFoXS.pl
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,21 @@
if($flexresnum > 15) { $cmd .= " -a 10"; }
print "$cmd\n";
`$cmd`;
if(not -e "nodes1.pdb") {
if(not -e "nodes1.pdb" and not -e "nodes1.cif") {
print "ERROR: RRT generated no conformations\n";
exit;
}


# STEP 2: run FoXS
for(my $i = 1; $i < 110; $i++) {
my $nodes_file = "nodes".$i.".pdb";
if(-e $nodes_file) {
$cmd = "foxs -m 2 -p $nodes_file";
print "$cmd\n";
`$cmd`;
for my $ext ("pdb", "cif") {
my $nodes_file = "nodes${i}.${ext}";
if(-e $nodes_file) {
$cmd = "foxs -m 2 -p $nodes_file";
print "$cmd\n";
`$cmd`;
}
}
}
# run FoXS for input PDB
Expand All @@ -83,7 +85,7 @@
`$cmd`;

# STEP 3: run MultiFoXS
`ls nodes*.pdb.dat > filenames`;
`ls nodes*.{cif,pdb}.dat > filenames`;
$cmd = "multi_foxs $saxs_file filenames -s 5 -k 1000 --max_c2 4.0 -u $unit_option";
print "$cmd\n";
`$cmd`;
Expand All @@ -92,20 +94,22 @@
# STEP 4: calculate Rg
`rm -f rg.out; touch rg.out`;
for(my $i = 1; $i < 110; $i++) {
my $nodes_file = "nodes".$i.".pdb";
if(-e $nodes_file) {
$cmd = "compute_rg -m 2 $nodes_file >> rg.out";
print "$cmd\n";
`$cmd`;
for my $ext ("pdb", "cif") {
my $nodes_file = "nodes".$i.".pdb";
if(-e $nodes_file) {
$cmd = "compute_rg -m 2 $nodes_file >> rg.out";
print "$cmd\n";
`$cmd`;
}
}
}
`grep Rg rg.out | awk '{ print \$3}' > rg`;

# STEP 5: plots
`$home/plotHistograms.pl 5 100 1 1`;

`rm -f e?/e[2-9]?_?.pdb e?/e1[1-9]_?.pdb`;
`zip conformations.zip nodes*.pdb`;
`rm -f e?/e[2-9]?_?.{cif,pdb} e?/e1[1-9]_?.{cif,pdb}`;
`zip conformations.zip nodes*.{cif,pdb}`;
`zip -r multi_foxs.zip ensembles_size_?.txt multi_state_model_?_1_1.dat e? chis chis.png gnuplot.txt hist hist? hist.png plotbar.plt`;
`rm -f nodes*.pdb.dat`;
`rm -f nodes?.pdb nodes??.pdb nodes???.pdb`;
`rm -f nodes*.{cif,pdb}.dat`;
`rm -f nodes?.{cif,pdb} nodes??.{cif,pdb} nodes???.{cif,pdb}`;

0 comments on commit d57d13c

Please sign in to comment.