-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ProteinFoldingResult, XYZ files and plotting of folded Proteins for ProteinFoldingProblem. #655
ProteinFoldingResult, XYZ files and plotting of folded Proteins for ProteinFoldingProblem. #655
Conversation
…lso simplified some classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving a partial review.
qiskit_nature/problems/sampling/protein_folding/protein_folding_problem.py
Outdated
Show resolved
Hide resolved
qiskit_nature/problems/sampling/protein_folding/protein_folding_problem.py
Outdated
Show resolved
Hide resolved
Co-authored-by: dlasecki <[email protected]>
Co-authored-by: dlasecki <[email protected]>
Co-authored-by: dlasecki <[email protected]>
Co-authored-by: dlasecki <[email protected]>
Co-authored-by: dlasecki <[email protected]>
Co-authored-by: dlasecki <[email protected]>
"""Returns a string that encodes a solution of the | ||
:class:`~qiskit_nature.problems.sampling.protein_folding_problem.ProteinFoldingProblem`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this is enough for people to understand? Would an example of the string here with some further explanation help? You have more explanation in the tutorial right along with the example there. I just wonder if we are exposing this as part of the public API if things can be understood well enough from just from the docs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, apparently I had to review the changes in order for my comments to be posted. You might see a lot of comments all of the sudden. Don't be concerned about them and just look at the last ones.
"""Returns a string that encodes a solution of the | ||
:class:`~qiskit_nature.problems.sampling.protein_folding_problem.ProteinFoldingProblem`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that this seems pretty much good to go, once the CI is fixed 👍
qiskit_nature/problems/sampling/protein_folding/protein_folding_problem.py
Show resolved
Hide resolved
In regards of the depth shading the Axes 3DPlot has a parameter as to whether to do that or not.
Is this what the query was about "I am not sure I understand. The plot needs to be "3D" even if it doesn't rotate since it represents the shape of the protein. How would we turn that off?" I guess I was wondering if it would be worth on the plotter we have to allow a user to change the value via that logic. We allow grids to be on or off, this could be another parameter that was passed on down. But then I guess we don't expose a way to change colors that its uses either right, so maybe things are fine as they are and if the user wants/needs more they can plot it directly themselves. |
Well, since we are retuning a matplotlip figure the user can change any of those features of the plot. Same way I have manually rotated the plots in the notebook. |
…rcDrudis/qiskit-nature into ProteinFoldingInterpretMethod
releasenotes/notes/protein-folding-result-b344ac3c7f48e3ca.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work doing this. All looks good to me. I made a very minor last minute change to the reno (an and
to a but
).
…roteinFoldingProblem. (qiskit-community#655) * Adding files modified. Dependencies not Checked * Fixed one Dependency * Passing ProteinFoldingProblem as attribute to ProteinFoldingResult. Also simplified some classes * Some details * Created more test cases in test_protein_folding_result * Added comments in the unittest * Quick changes * Separated unittests, and small modifications * Fixed bug side turns * Added letters to the plotter * Fixed format and documentation * Added release note * Corrected indentation and typos * Changed legend location * Updated header's date * Updated header's date * Update qiskit_nature/results/protein_folding_tools/__init__.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_result.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_tools/protein_decoder.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_tools/protein_decoder.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_tools/protein_plotter.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_result.py Co-authored-by: dlasecki <[email protected]> * Updated header's date * Updated header's date * Update protein_decoder.py * Changed peptide getter docstring. * Update qiskit_nature/results/protein_folding_result.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_result.py Co-authored-by: dlasecki <[email protected]> * Fixed multiple things * Update qiskit_nature/results/protein_folding_tools/protein_xyz.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_tools/protein_xyz.py Co-authored-by: dlasecki <[email protected]> * Update releasenotes/notes/protein-folding-result-b344ac3c7f48e3ca.yaml Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_result.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_tools/protein_xyz.py Co-authored-by: dlasecki <[email protected]> * Modularized ProteinPlotter * Changed documentation * pylint * Exposed main_turns * Fixed make * Fixed codeb * Update qiskit_nature/results/protein_folding_result.py Co-authored-by: dlasecki <[email protected]> * Changed class description * Reformated Unittests * Refactored unittests * Adding matplotlib * Added Matplotlib requirement * Accidentaly removed pylintdict * Fixed circular import * Update qiskit_nature/results/utils/protein_decoder.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/utils/protein_decoder.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/utils/protein_decoder.py Co-authored-by: dlasecki <[email protected]> * Update qiskit_nature/results/protein_folding_result.py Co-authored-by: dlasecki <[email protected]> * Fixed lint * Refactored unittest * best_sequence -> turns_sequence * Update qiskit_nature/problems/sampling/protein_folding/protein_folding_problem.py Co-authored-by: Max Rossmannek <[email protected]> * Update test/results/test_protein_folding_result.py Co-authored-by: Max Rossmannek <[email protected]> * Update setup.py Co-authored-by: Max Rossmannek <[email protected]> * Update qiskit_nature/results/protein_folding_result.py Co-authored-by: Max Rossmannek <[email protected]> * Fixes * black * minor changes * Fixed intentations * Removed TODO comment * minor changes * Changed header XYZ file * fixed style * Return figure instead of plotting * Removed files * Returns in doc ploter * Fixed codeblocks and reno * RENO * changed matplotlib requirements * Added unittest for creating files * Changed header xyz files * changed direcotry name * typo * Make matplotlib optional * Fixed comments * Changed type hint * typehint * This version gives a circular import error. The reason is explained in a comment * Attempts * Fix errors * Changed Documentation and get_figure * Made more changes to RENO * RENO * reno * Reno * Fixed make html * Fix sphinx * Update releasenotes/notes/protein-folding-result-b344ac3c7f48e3ca.yaml * Fixed bug with letters on plot * Not plotting side chains when there are no side chains * Fixed default values for plotting * Make black * Changed import order * Fixes * Apply suggestions from code review Co-authored-by: Max Rossmannek <[email protected]> * Fixed spelling and writing bug * Changes in notebook * Add .editorconfig (qiskit-community#685) * Overwriting files * Notebook * Format * Max's comments * Fixed Notebook and changed name get_xyz_data() * turn_sequence and tempfile * Trailing Whitespace * make black * Changed notebook * Documentation git_result... * black * Removed file * Fixes * Changed reno * Changed capital letters on testfiles * Update releasenotes/notes/protein-folding-result-b344ac3c7f48e3ca.yaml Co-authored-by: dlasecki <[email protected]> Co-authored-by: Max Rossmannek <[email protected]> Co-authored-by: Steve Wood <[email protected]> Co-authored-by: Manoel Marques <[email protected]> Co-authored-by: Max Rossmannek <[email protected]> Co-authored-by: woodsp-ibm <[email protected]>
Summary
Implementation of the
interpret
method inProteinFoldingProblem
.ProteinFoldingResult
created by this method is now functional and can return the turns encoding the shape of the protein, the Cartesian coordinates of each aminoacid, and generate a plot of the structure.This PR solves issues #235 , #236 and #313.
Details and comments
Three new classes have been created and are arguments of
ProteinFoldingResult
.ProteinDecoder
: Takes the raw bitstring result and converts it into sequences of turns describing the shape of the protein.ProteinXYZ
: Takes the turn sequences fromProteinDecoder
and the peptide fromProteinFoldingResult
and generates a xyz file for the protein.ProteinPlotter
: Takes the xyz information fromProteinXYZ
and generates a plot of the protein.Usecase of how the class would work:
This is how the plot looks like:
Note: Right now the xyz file is generated in the working directory.