When I import protein and ligand from two PDB files and display them together using Show I cannot see the ligand since it is tiny in comparison with protein. How can I zoom the MoleculePlot on ligand automatically?
$\begingroup$ $\endgroup$
4 - $\begingroup$ Can you provide example code so that people who want to answer don't have to make up an example on their own? Otherwise, MoleculePlot returns a Graphics object, so the same solutions you use for zooming in a Graphics object can be used here as well. $\endgroup$bobthechemist– bobthechemist2022-12-09 13:05:40 +00:00Commented Dec 9, 2022 at 13:05
- $\begingroup$ have you tried Magnify, Magnification ? $\endgroup$Alrubaie– Alrubaie2022-12-09 13:55:27 +00:00Commented Dec 9, 2022 at 13:55
- $\begingroup$ I cannot provide an example since I cannot attach two large files in pdb format $\endgroup$Филипп Цветков– Филипп Цветков2022-12-09 15:02:44 +00:00Commented Dec 9, 2022 at 15:02
- $\begingroup$ Magnify, Magnification does not work in this case $\endgroup$Филипп Цветков– Филипп Цветков2022-12-09 15:06:24 +00:00Commented Dec 9, 2022 at 15:06
Add a comment |
1 Answer
$\begingroup$ $\endgroup$
2 Clear["Global`*"] Without a minimal example to work with, I can only suggest a general direction.
img = Import[ "http://www.rcsb.org/pdb/download/downloadFile.do?fileFormat=pdb&\ compression=NO&structureId=1tf6", "PDB", ImageSize -> Large] EDIT: Added control labels and axes and box ratio controls
{{xmin, xmax}, {ymin, ymax}, {zmin, zmax}} = Round[Values@AbsoluteOptions[img, PlotRange][[1]]]; Manipulate[ Show[ img, PlotRange -> {xint, yint, zint}, ImageSize -> Large, SphericalRegion -> True, Axes -> axes, AxesLabel -> (Style[#, 14] & /@ {x, y, z}), Boxed -> axes, BoxRatios -> br], {{xint, {xmin, xmax}, "x interval"}, xmin, xmax, Round[(xmax - xmin)/100], ControlType -> IntervalSlider, ImageSize -> Large, Appearance -> "Labeled"}, Row[{ Control[ {{yint, {ymin, ymax}, "y interval"}, ymin, ymax, Round[(ymax - ymin)/100], ControlType -> IntervalSlider, ImageSize -> Large, Appearance -> "Labeled"}], Spacer[20], Control[ {{br, Automatic, "Box\nRatio"}, {Automatic, {1, 1, 1}}}]}], Row[{ Control[ {{zint, {zmin, zmax}, "z interval"}, zmin, zmax, Round[(zmax - zmin)/100], ControlType -> IntervalSlider, ImageSize -> Large, Appearance -> "Labeled"}], Spacer[40], Control[ {{axes, False}, {True, False}}]}], SynchronousUpdating -> False, TrackedSymbols :> All] - $\begingroup$ Unfortunately, this code just cut the molecule, but not zoom on it. I need to enlarge the particular region centered to the ligand. $\endgroup$Филипп Цветков– Филипп Цветков2022-12-12 14:38:13 +00:00Commented Dec 12, 2022 at 14:38
- $\begingroup$ I don't understand your comment. As the plot range is reduced the remaining image is enlarged, i.e., zoomed in on. $\endgroup$Bob Hanlon– Bob Hanlon2022-12-12 14:55:22 +00:00Commented Dec 12, 2022 at 14:55

