-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8aeffc
commit 2ff0e32
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# python3 | ||
import argparse | ||
from biopandas.pdb import PandasPdb | ||
import matplotlib | ||
import matplotlib.pyplot as plt | ||
# input parameters | ||
ap = argparse.ArgumentParser() | ||
ap.add_argument("-in", "--input", required=True, help="input pdb file") | ||
ap.add_argument("-chain", "--chain", required=True, help="chain from pdb file to select") | ||
ap.add_argument("-col", "--col", required=True, help="colour of line in plot(write in '' or "" you can use hex colour codes)") | ||
ap.add_argument("-plot", "--plot", required=False, help="export plot to file") | ||
ap.add_argument("-dpi", "--dpi", default= 300, required=False, help="dpi of exported plot") | ||
ap.add_argument("-type", "--type", required=True, help="type of plot file(e.g png etc)") | ||
args = vars(ap.parse_args()) | ||
# main | ||
ppdb = PandasPdb() | ||
ppdb.read_pdb(args['input']) | ||
ppdb.df['ATOM'] = ppdb.df['ATOM'][ppdb.df['ATOM']['chain_id'] == args['chain']] | ||
# export figure | ||
ppdb.df['ATOM']['b_factor'].plot(kind='line', color= args['col']) | ||
plt.title('B-Factors Along the Amino Acid Chain') | ||
plt.xlabel('Atom Number') | ||
plt.ylabel('B-factor in $A^2$') | ||
matplotlib.pyplot.savefig(args['plot'], dpi=int(args['dpi']), format=args['type']) |