score2bq.py
Hey,

Here's a script for putting rosetta scoreterms in bfactor and occupancy columns of a pdb. Very cool to be able to visualize the scorefunction.

The input has to be a Rosetta output. It needs the stuff that comes after the ATOM records. The script assumes you're not trying to break it, so the # of residues in the pdb and the # of residue scores should be equal.

Default behavior is to put "total" in bfactor column.

$ ls
1A0O_AB.pdb  score2bq.py
$ ./score2bq.py 1A0O.pdb
$ ls
1A0O_AB.pdb  1A0O_AB_total_in_b.pdb  score2bq.py

It'll also take multiple structures so if you have a directory you want to run this on do:

$ ./score2bq.py *pdb

gzipped pdbs also work.

You can control what goes into the bfactor column with flag -b. Valid options are score terms that show up in Rosetta output pdbs right after the line "#BEGIN_POSE_ENERGIES_TABLE ...". In a structure I ran through the score app I have these:

fa_atr fa_rep fa_sol fa_intra_rep fa_elec pro_close hbond_sr_bb hbond_lr_bb hbond_bb_sc hbond_sc dslf_fa13 rama omega fa_dun p_aa_pp ref total

$ ./score2bq.py -b fa_atr 1A0O_AB.pdb
$ ls
1A0O_AB.pdb  1A0O_AB_fa_atr_in_b.pdb  1A0O_AB_total_in_b.pdb  score2bq.py

You can also put things in the occupancy column with -q.

Change the output suffix with -s or use -i to write the file inplace.

The program is documents itself with -h.

When you open the outputs in pymol and use the spectrum command you might have to manually adjust the minimum and maximum, especially if the input structures were xtal structs. For total score on unoptimized structures -3 to 5 seems good. Example:

spectrum b, blue_white_red, minimum=-3, maximum=5

Occupancy is accessible in pymol with q.

-z for gzipped output

pcaDock.py
you'll need to install a few Python modules to get this working:

argparse
numpy
scipy
pandas
scikit-learn

Use pip install <package>

The script documents itself:

$ ./pcaDock.py -h
usage: pcaDock.py [-h] --fixed FIXED --mobile MOBILE [--vector VECTOR]
                  --outfile OUTFILE [--show]

Generate an initial dock of two PDBs using principle axes. Example usage:
./pcaDock.py -f 1ubq.pdb -m myUBD.pdb -v "1, 0, 0" -o boundUbq.pdb

optional arguments:
  -h, --help            show this help message and exit
  --fixed FIXED, -f FIXED
                        Structure to place at origin and then keep fixed
  --mobile MOBILE, -m MOBILE
                        PDB cotaining structure to move about fixed structure
  --vector VECTOR, -v VECTOR
                        Displacement vector to apply to COM of mobile
                        structure.Ex: -v "1, 0, 0"
  --outfile OUTFILE, -o OUTFILE
                        Output file name. Contains both input structures.
  --show, -s            Generate pdb with fixed structure and print COM
                        displacement of mobile from that fixed structure.