Closed menoliu closed 2 years ago
Thanks for the comment Joao, I've implemented a way to auto-scale the x-axis tick increments based on the figure size. Of course, we can change these parameters as well in CLI :)
@joaomcteixeira it's fixed! Plotting torsions is more flexible now
Almost there! If I run the torsions on the conformers generated by the example, I get this:
· idpconfgen torsions conformer_*.pdb -o idpconfgen_database.json --plot colors='b','r'
[2022-05-24 11:40:11,300]Extracting Torsion Angles:
[2022-05-24 11:40:11,300]Reading Input Paths:
[2022-05-24 11:40:11,300]Logging Non-Existent Files:
[2022-05-24 11:40:11,300]
[2022-05-24 11:40:11,300] done
[2022-05-24 11:40:11,301] done
100.0% 10/10 on 1 cpus |███████████████████████████████████████████████████████████████████|
[2022-05-24 11:40:11,332]Plotting Torsion Angle Distribution:
[2022-05-24 11:40:11,332] Reminder: PDBs must be conformers of the same protein-system.
Traceback (most recent call last):
File "/home/joao/anaconda3/envs/idpconfgen/bin/idpconfgen", line 33, in <module>
sys.exit(load_entry_point('idpconfgen', 'console_scripts', 'idpconfgen')())
File "/home/joao/github/idpconfgen/src/idpconfgen/cli.py", line 121, in maincli
cmd.func(**vars(cmd))
File "/home/joao/github/idpconfgen/src/idpconfgen/cli_torsions.py", line 205, in main
errs=plot_torsions(max_residues, angles, degrees, n_confs, **tor_defaults)
File "/home/joao/github/idpconfgen/src/idpconfgen/components/plots/plotfuncs.py", line 107, in plot_torsions
xticks = np.arange(0,residues, increment)
ZeroDivisionError: division by zero
Great catch @joaomcteixeira! Nice limit test. It's been fixed.
We use to say in Portugal: "the devil knows more because he's old and because he's the devil" :smiling_imp:
This is better because type
is also a reserved word in python and we should not use it for variable names.
I tested this locally and everything seems working. Do you agree on merging?
Yes let's merge @joaomcteixeira
Currently, only working on two plotting functions associated with torsion angle distribution (scatter plot) called by
torsions
and fractional secondary structure (overlaid line graph) called bysscalc
. Modular inspirations from https://github.com/joaomcteixeira/taurenmd/pull/60