├── .DS_Store ├── AlternateLocators └── hidealtloc.py ├── ChangeOrientation ├── rotate.py ├── rv.py └── turnAboutAxis.py ├── Citation.md ├── ColorScheme ├── cblind.py ├── cribbon.py ├── grayscale.py ├── printColorByAtomCodes.py └── volumeRamp.py ├── ElectronDensity ├── carvedIsomesh.py ├── carvedIsosurface.py ├── carvedVolume.py ├── fetch2FoFcIsomesh.py ├── fetch2FoFcIsosurface.py ├── fetch2FoFcVolume.py ├── fetchThreeMaps.py ├── loadThreeMaps.py ├── threeMapsIsosurface.py └── threeMapsVolume.py ├── FileIO ├── cblindCartoon.py ├── fetchCIF.py ├── fetchFoFc.py ├── loadPDBfile.py ├── printPath.py ├── saln.py ├── salnpy.py ├── savePNG.py ├── sccp4.py ├── sccp4py.py ├── sdae.py ├── sdaepy.py ├── spng.py ├── spngpy.py ├── spse.py ├── wallart.py └── wallartpy.py ├── H-bonds ├── distance.py ├── drawHbonds.py └── hbonddash.py ├── Help ├── cmddocs.py ├── github.py ├── helpDocs.py ├── presetDocs.py ├── printDoc.py ├── printDocpy.py ├── pymoldocs.py ├── pymoldocspy.py └── writeCommandReference2HTML.py ├── Jupyter ├── AO.py ├── AOBW.py ├── AOD.py ├── AODBW.py ├── PE125.py ├── PE25.py ├── PE33.py ├── PE50.py ├── PE66.py ├── PE75.py ├── PE85.py ├── cav.py ├── cntccp4emaps.py ├── cntfiles.py ├── cntlogs.py ├── cntmtzs.py ├── cntpdbs.py ├── cntpmls.py ├── cntpngs.py ├── cntpses.py ├── colorh1.py ├── colorh2.py ├── hb.py ├── importIPythonDisplay.py ├── importPyMOLandShortcuts.py ├── importPyMOLcmd.py ├── importShortcuts.py ├── imports4PyMOLjupyter.py ├── ipymolProtein.py ├── ipymolStart.py ├── kernel.py ├── loadImage.py ├── nmr.py ├── nmroff.py ├── nmroffpy.py ├── nmrpy.py ├── rdkrpcChem.py ├── rdkrpcProtein.py ├── rmd.py ├── rmhb.py ├── rv.py ├── rvi.py ├── rvr.py ├── timcolor.py └── yrb.py ├── LICENSE ├── Labels ├── centerpi.py ├── displayFonts.py ├── displayFontspy.py ├── labelCAs.py ├── labelMainChain.py ├── labelResnResi.py ├── labelSS.py ├── labelWatersHOH.py ├── labelWatersW.py ├── oneLetter.py ├── pseudolabel.py ├── sigang.py ├── sigdihedral.py └── sigdist.py ├── ListSnippets └── lsSnips.py ├── Measurements ├── listLigandProteinDistances.py └── ms.py ├── MolecularRepresentation ├── ao.py ├── aobw.py ├── aod.py ├── aodbw.py ├── bs.py ├── bsfr.py ├── bu.py ├── coordinate.py ├── cspheres.py ├── discreteCartoonColoring.py ├── doubleBond.py ├── drawLinks.py ├── ellipcol.py ├── filledRing.py ├── fog.py ├── grayscalepy.py ├── his31asp70.py ├── loadPDBbs.py ├── loadPDBnb.py ├── molscriptRibbon.py ├── oneBondThicknessColor.py ├── pearl.py ├── puttyCartoon.py ├── ringMode.py ├── rmwater.py ├── sas.py ├── saxsEnvelope.py ├── scaleRadiusColor.py ├── scaleRadiusColorPythonInsertpy.py ├── scaleRadiusColorpy.py ├── setLigandValenceOn.py ├── setcolor.py ├── sidehChainHelper.py ├── solventRadius.py ├── stack.py ├── stateOne.py └── waterTriple.py ├── NucleicAcids ├── basePairStacking.py ├── brokenNucleicBackbone.py ├── dssrBlock1.py ├── dssrBlock2.py ├── dssrBlock3.py ├── dssrBlock4.py ├── nucleicAcidBackboneTubesSticks.py ├── nucleicAcidCartoon.py ├── nucleicAcidCartoon2Strands.py ├── nucleicAcidCartoonFilledRings.py ├── nucleicAcidColorbySequence.py ├── nucleicAcidDumbellCartoonColorbySequence.py └── nucleicAcidFlatRibbonColorbySequence.py ├── Objects ├── allPairs.py ├── listObjects.py ├── loadAndAlignManyFiles1.py ├── loadAndAlignManyFiles2.py ├── loadAndAlignManyFiles3.py ├── loadManyFiles.py ├── optAlignRNA.py └── saveSeppy.py ├── Print ├── aveB4resiX.py ├── aveB4resiXpy.py ├── averageB.py ├── fasta.py ├── fastapy.py ├── findHbonds.py ├── getCoordinates.py ├── getCoordinatespy.py ├── numResiNucleic.py ├── numResiNucleicChainA.py ├── numResiProtein.py ├── numResiProteinChainA.py ├── printBs.py ├── printBs2digits.py ├── printBspartB.py ├── printNameB4ResiX.py ├── printPathpy.py ├── printResiResnNameB4ResiX.py └── printResiResnNameB4ResiXNoH.py ├── Programming ├── emacsjupyterSourceBlock.py ├── obipythonSourceBlock.py ├── printAtomNames.py ├── printAtomNumbers.py ├── printBfactors.py ├── printCoordinates.py ├── printNamesCoordinates.py ├── printVDWradii.py ├── renameChain.py ├── renumAtoms.py ├── renumResi.py └── synch.py ├── Pymolrc ├── antialias.py ├── fetchPath.py ├── lspymolrc.py ├── lspymolrcpy.py ├── setpath.py └── sigDigits.py ├── README.md ├── Selection ├── duplicateObject.py ├── extractPartObj.py ├── hideSelection.py ├── ligandSelect.py ├── selectAllBut.py ├── selectAtomsAround.py ├── selectChain.py ├── selectElement.py ├── selectHelices.py ├── selectLoops.py ├── selectName.py ├── selectResi.py ├── selectResidues.py ├── selectResiduesAround.py ├── selectStrands.py └── undoSelection.py ├── Settings ├── listSettings.py └── listSettings2.py ├── Stereo ├── stereoDraw.py ├── stereoRay.py └── stereokb.py ├── Trajectories └── loadAmberTrajs.py ├── UnitCellDisplay ├── addAxis.py ├── addAxispy.py ├── sc111.py ├── sc112.py ├── sc113.py ├── sc114.py ├── sc121.py ├── sc122.py ├── sc131.py ├── sc133.py ├── sc141.py ├── sc144.py ├── sc211.py ├── sc212.py ├── sc221.py ├── sc222.py ├── sc233.py ├── sc311.py ├── sc313.py ├── sc323.py ├── sc331.py ├── sc332.py ├── sc333.py ├── sc411.py ├── sc414.py ├── sc441.py ├── sc444.py ├── symexp.py └── unitCellEdgesColorBlack.py ├── Workshop ├── internalGUImode2.py └── internalGUIwidth.py ├── _config.yml ├── gifs └── aoUbuntu.gif ├── images └── 5d99AOD.png └── index.html /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MooersLab/jupyterlabpymolpysnips/79adfb09c0c1c7e4c893ac219ef877740ca54dc6/.DS_Store -------------------------------------------------------------------------------- /AlternateLocators/hidealtloc.py: -------------------------------------------------------------------------------- 1 | cmd.do('select altconf, alt b # select B alternative locators;') 2 | cmd.do('hide everything, altconf # hide alt B locators;') 3 | -------------------------------------------------------------------------------- /ChangeOrientation/rotate.py: -------------------------------------------------------------------------------- 1 | cmd.do('rotate x, 45, pept;') 2 | -------------------------------------------------------------------------------- /ChangeOrientation/rv.py: -------------------------------------------------------------------------------- 1 | cmd.do('run roundview.py;') 2 | -------------------------------------------------------------------------------- /ChangeOrientation/turnAboutAxis.py: -------------------------------------------------------------------------------- 1 | cmd.do('turn x,90;') 2 | -------------------------------------------------------------------------------- /Citation.md: -------------------------------------------------------------------------------- 1 | Insert in the main body of the paper: 2 | 3 | We used the jupyterlabpymolpysnips library to support using PyMOL in JupuyterLab (https://github.com/MooersLab/jupyterlabpymolpysnips). 4 | 5 | Or you can cite this paper which describes this library. 6 | 7 | @Article{Mooers2021APyMOLSnippetLibraryForJupyterToBoostResearcherProductivity, 8 | author = {Mooers, Blaine HM}, 9 | journal = {Computing in Science \& Engineering}, 10 | title = {A PyMOL snippet library for Jupyter to boost researcher productivity}, 11 | year = {2021}, 12 | pages = {47-53}, 13 | volume = {23}, 14 | publisher = {IEEE}, 15 | doi = {10.1109/MCSE.2021.3059536}, 16 | } 17 | -------------------------------------------------------------------------------- /ColorScheme/cblind.py: -------------------------------------------------------------------------------- 1 | cmd.do('run ~/Pymol-script-repo/colorblindfriendly.py;') 2 | cmd.do('as cartoon;') 3 | cmd.do('color cb_red, ss H;') 4 | cmd.do('color cb_yellow,ss S;') 5 | cmd.do('color cb_green, ss L+;') 6 | -------------------------------------------------------------------------------- /ColorScheme/cribbon.py: -------------------------------------------------------------------------------- 1 | cmd.do('as cartoon;') 2 | cmd.do('color red, ss H;') 3 | cmd.do('color yellow,ss S;') 4 | cmd.do('color green, ss L+;') 5 | -------------------------------------------------------------------------------- /ColorScheme/grayscale.py: -------------------------------------------------------------------------------- 1 | cmd.do('python') 2 | cmd.do('def grayscale(selection="all"):') 3 | cmd.do(' """Apply by entering grayscale"""') 4 | cmd.do(' cmd.color("grey64", "elem Ac")') 5 | cmd.do(' cmd.color("grey67", "elem Al")') 6 | cmd.do(' cmd.color("grey39", "elem Am")') 7 | cmd.do(' cmd.color("grey46", "elem Sb")') 8 | cmd.do(' cmd.color("grey75", "elem Ar")') 9 | cmd.do(' cmd.color("grey58", "elem As")') 10 | cmd.do(' cmd.color("grey33", "elem At")') 11 | cmd.do(' cmd.color("grey56", "elem Ba")') 12 | cmd.do(' cmd.color("grey40", "elem Bk")') 13 | cmd.do(' cmd.color("grey87", "elem Be")') 14 | cmd.do(' cmd.color("grey40", "elem Bi")') 15 | cmd.do(' cmd.color("grey20", "elem Bh")') 16 | cmd.do(' cmd.color("grey77", "elem B")') 17 | cmd.do(' cmd.color("grey26", "elem Br")') 18 | cmd.do(' cmd.color("grey86", "elem Cd")') 19 | cmd.do(' cmd.color("grey76", "elem Ca")') 20 | cmd.do(' cmd.color("grey34", "elem Cf")') 21 | cmd.do(' cmd.color("grey77", "elem C")') 22 | cmd.do(' cmd.color("grey98", "elem Ce")') 23 | cmd.do(' cmd.color("grey17", "elem Cs")') 24 | cmd.do(' cmd.color("grey70", "elem Cl")') 25 | cmd.do(' cmd.color("grey60", "elem Cr")') 26 | cmd.do(' cmd.color("grey64", "elem Co")') 27 | cmd.do(' cmd.color("grey54", "elem Cu")') 28 | cmd.do(' cmd.color("grey42", "elem Cm")') 29 | cmd.do(' cmd.color("grey89", "elem D")') 30 | cmd.do(' cmd.color("grey19", "elem Db")') 31 | cmd.do(' cmd.color("grey79", "elem Dy")') 32 | cmd.do(' cmd.color("grey29", "elem Es")') 33 | cmd.do(' cmd.color("grey67", "elem Er")') 34 | cmd.do(' cmd.color("grey85", "elem Eu")') 35 | cmd.do(' cmd.color("grey28", "elem Fm")') 36 | cmd.do(' cmd.color("grey93", "elem F")') 37 | cmd.do(' cmd.color("grey8", "elem Fr")') 38 | cmd.do(' cmd.color("grey82", "elem Gd")') 39 | cmd.do(' cmd.color("grey60", "elem Ga")') 40 | cmd.do(' cmd.color("grey52", "elem Ge")') 41 | cmd.do(' cmd.color("grey80", "elem Au")') 42 | cmd.do(' cmd.color("grey68", "elem Hf")') 43 | cmd.do(' cmd.color("grey20", "elem Hs")') 44 | cmd.do(' cmd.color("grey96", "elem He")') 45 | cmd.do(' cmd.color("grey75", "elem Ho")') 46 | cmd.do(' cmd.color("grey89", "elem H")') 47 | cmd.do(' cmd.color("grey49", "elem In")') 48 | cmd.do(' cmd.color("grey16", "elem I")') 49 | cmd.do(' cmd.color("grey29", "elem Ir")') 50 | cmd.do(' cmd.color("grey48", "elem Fe")') 51 | cmd.do(' cmd.color("grey65", "elem Kr")') 52 | cmd.do(' cmd.color("grey76", "elem La")') 53 | cmd.do(' cmd.color("grey19", "elem Lr")') 54 | cmd.do(' cmd.color("grey34", "elem Pb")') 55 | cmd.do(' cmd.color("grey60", "elem Li")') 56 | cmd.do(' cmd.color("grey48", "elem Lu")') 57 | cmd.do(' cmd.color("grey83", "elem Mg")') 58 | cmd.do(' cmd.color("grey52", "elem Mn")') 59 | cmd.do(' cmd.color("grey20", "elem Mt")') 60 | cmd.do(' cmd.color("grey23", "elem Md")') 61 | cmd.do(' cmd.color("grey72", "elem Hg")') 62 | cmd.do(' cmd.color("grey62", "elem Mo")') 63 | cmd.do(' cmd.color("grey93", "elem Nd")') 64 | cmd.do(' cmd.color("grey85", "elem Ne")') 65 | cmd.do(' cmd.color("grey43", "elem Np")') 66 | cmd.do(' cmd.color("grey67", "elem Ni")') 67 | cmd.do(' cmd.color("grey69", "elem Nb")') 68 | cmd.do(' cmd.color("grey25", "elem N")') 69 | cmd.do(' cmd.color("grey23", "elem No")') 70 | cmd.do(' cmd.color("grey36", "elem Os")') 71 | cmd.do(' cmd.color("grey44", "elem O")') 72 | cmd.do(' cmd.color("grey33", "elem Pd")') 73 | cmd.do(' cmd.color("grey57", "elem P")') 74 | cmd.do(' cmd.color("grey82", "elem Pt")') 75 | cmd.do(' cmd.color("grey37", "elem Pu")') 76 | cmd.do(' cmd.color("grey40", "elem Po")') 77 | cmd.do(' cmd.color("grey35", "elem K")') 78 | cmd.do(' cmd.color("grey95", "elem Pr")') 79 | cmd.do(' cmd.color("grey90", "elem Pm")') 80 | cmd.do(' cmd.color("grey52", "elem Pa")') 81 | cmd.do(' cmd.color("grey35", "elem Ra")') 82 | cmd.do(' cmd.color("grey46", "elem Rn")') 83 | cmd.do(' cmd.color("grey43", "elem Re")') 84 | cmd.do(' cmd.color("grey39", "elem Rh")') 85 | cmd.do(' cmd.color("grey27", "elem Rb")') 86 | cmd.do(' cmd.color("grey47", "elem Ru")') 87 | cmd.do(' cmd.color("grey19", "elem Rf")') 88 | cmd.do(' cmd.color("grey89", "elem Sm")') 89 | cmd.do(' cmd.color("grey90", "elem Sc")') 90 | cmd.do(' cmd.color("grey20", "elem Sg")') 91 | cmd.do(' cmd.color("grey66", "elem Se")') 92 | cmd.do(' cmd.color("grey80", "elem Si")') 93 | cmd.do(' cmd.color("grey75", "elem Ag")') 94 | cmd.do(' cmd.color("grey46", "elem Na")') 95 | cmd.do(' cmd.color("grey71", "elem Sr")') 96 | cmd.do(' cmd.color("grey76", "elem S")') 97 | cmd.do(' cmd.color("grey60", "elem Ta")') 98 | cmd.do(' cmd.color("grey53", "elem Tc")') 99 | cmd.do(' cmd.color("grey51", "elem Te")') 100 | cmd.do(' cmd.color("grey81", "elem Tb")') 101 | cmd.do(' cmd.color("grey39", "elem Tl")') 102 | cmd.do(' cmd.color("grey59", "elem Th")') 103 | cmd.do(' cmd.color("grey61", "elem Tm")') 104 | cmd.do(' cmd.color("grey48", "elem Sn")') 105 | cmd.do(' cmd.color("grey75", "elem Ti")') 106 | cmd.do(' cmd.color("grey50", "elem W")') 107 | cmd.do(' cmd.color("grey47", "elem U")') 108 | cmd.do(' cmd.color("grey65", "elem V")') 109 | cmd.do(' cmd.color("grey54", "elem Xe")') 110 | cmd.do(' cmd.color("grey55", "elem Yb")') 111 | cmd.do(' cmd.color("grey91", "elem Y")') 112 | cmd.do(' cmd.color("grey51", "elem Zn")') 113 | cmd.do(' cmd.color("grey81", "elem Zr")') 114 | cmd.do('cmd.extend("grayscale",grayscale)') 115 | cmd.do('python end') 116 | -------------------------------------------------------------------------------- /ColorScheme/printColorByAtomCodes.py: -------------------------------------------------------------------------------- 1 | print("util.cbag, green carbons atoms" + "\n" + "util.cbac, cyan carbon atoms" + "\n" + "util.cbam, magenta carbon atoms" + "\n" + "util.cbay, yellow carbons atoms" + "\n"+ "util.cbas, salmon carbons atoms" + "\n" + "util.cbaw, white carbons atoms" + "\n" + "util.cbab, slate carbons atoms" + "\n" + "util.cbao, bright orange carbons atoms" + "\n" + "util.cbap, purple carbons atoms" + "\n" +"util.cbak, pink carbons atoms") 2 | -------------------------------------------------------------------------------- /ColorScheme/volumeRamp.py: -------------------------------------------------------------------------------- 1 | cmd.volume_ramp_new("ramp_magenta", [0.01, 1.00, 0.00, 1.00, 0.00, 4.01, 1.00, 0.00, 1.00, 0.10, 4.99, 1.00, 0.00, 1.00, 0.50,]) 2 | -------------------------------------------------------------------------------- /ElectronDensity/carvedIsomesh.py: -------------------------------------------------------------------------------- 1 | cmd.do('delete all;') 2 | cmd.do('# Fetch the coordinates. Need internet connection.') 3 | cmd.do('fetch 4dgr, async=0;') 4 | cmd.do('# Fetch the electron density map.') 5 | cmd.do('fetch 4dgr, type=2fofc,async=0;') 6 | cmd.do('# create a selection out of the glycan') 7 | cmd.do('select LongGlycan, resi 469:477;') 8 | cmd.do('orient LongGlycan;') 9 | cmd.do('remove not LongGlycan;') 10 | cmd.do('remove name H*;') 11 | cmd.do('isomesh 2fofcmap, 4dgr_2fofc, 1, LongGlycan, carve = 1.8;') 12 | cmd.do('color density, 2fofcmap; ') 13 | cmd.do('show sticks;') 14 | cmd.do('show spheres;') 15 | cmd.do('set stick_radius, .07;') 16 | cmd.do('set sphere_scale, .19;') 17 | cmd.do('set sphere_scale, .13, elem H;') 18 | cmd.do('set bg_rgb=[1, 1, 1];') 19 | cmd.do('set stick_quality, 50;') 20 | cmd.do('set sphere_quality, 4;') 21 | cmd.do('color gray85, elem C;') 22 | cmd.do('color red, elem O;') 23 | cmd.do('color slate, elem N;') 24 | cmd.do('color gray98, elem H;') 25 | cmd.do('set stick_color, gray50;') 26 | cmd.do('set ray_trace_mode, 1;') 27 | cmd.do('set ray_texture, 2;') 28 | cmd.do('set antialias, 3;') 29 | cmd.do('set ambient, 0.5;') 30 | cmd.do('set spec_count, 5;') 31 | cmd.do('set shininess, 50;') 32 | cmd.do('set specular, 1;') 33 | cmd.do('set reflect, .1;') 34 | cmd.do('set dash_gap, 0;') 35 | cmd.do('set dash_color, black;') 36 | cmd.do('set dash_gap, .15;') 37 | cmd.do('set dash_length, .05;') 38 | cmd.do('set dash_round_ends, 0;') 39 | cmd.do('set dash_radius, .05;') 40 | cmd.do('set_view (0.34,-0.72,0.61,0.8,0.56,0.22,-0.51,0.4,0.77,0.0,0.0,-81.31,44.64,-9.02,58.62,65.34,97.28,-20.0);') 41 | cmd.do('preset.ball_and_stick("all",mode=1);') 42 | cmd.do('draw;') 43 | -------------------------------------------------------------------------------- /ElectronDensity/carvedIsosurface.py: -------------------------------------------------------------------------------- 1 | cmd.do('delete all;') 2 | cmd.do('# Fetch the coordinates. Need internet connection.;') 3 | cmd.do('fetch 4dgr, async=0;') 4 | cmd.do('# Fetch the electron density map.;') 5 | cmd.do('fetch 4dgr, type=2fofc,async=0;') 6 | cmd.do('# create a selection out of the glycan;') 7 | cmd.do('select LongGlycan, resi 469:477;') 8 | cmd.do('orient LongGlycan;') 9 | cmd.do('remove not LongGlycan;') 10 | cmd.do('remove name H*;') 11 | cmd.do('isosurface 2fofcmap, 4dgr_2fofc, 1, LongGlycan, carve = 1.8;') 12 | cmd.do('color density, 2fofcmap; ') 13 | cmd.do('show sticks;') 14 | cmd.do('show spheres;') 15 | cmd.do('set stick_radius, .07;') 16 | cmd.do('set sphere_scale, .19;') 17 | cmd.do('set sphere_scale, .13, elem H;') 18 | cmd.do('set bg_rgb=[1, 1, 1];') 19 | cmd.do('set stick_quality, 50;') 20 | cmd.do('set sphere_quality, 4;') 21 | cmd.do('color gray85, elem C;') 22 | cmd.do('color red, elem O;') 23 | cmd.do('color slate, elem N;') 24 | cmd.do('color gray98, elem H;') 25 | cmd.do('set stick_color, gray50;') 26 | cmd.do('set ray_trace_mode, 1;') 27 | cmd.do('set ray_texture, 2;') 28 | cmd.do('set antialias, 3;') 29 | cmd.do('set ambient, 0.5;') 30 | cmd.do('set spec_count, 5;') 31 | cmd.do('set shininess, 50;') 32 | cmd.do('set specular, 1;') 33 | cmd.do('set reflect, .1;') 34 | cmd.do('set dash_gap, 0;') 35 | cmd.do('set dash_color, black;') 36 | cmd.do('set dash_gap, .15;') 37 | cmd.do('set dash_length, .05;') 38 | cmd.do('set dash_round_ends, 0;') 39 | cmd.do('set dash_radius, .05;') 40 | cmd.do('set_view (0.34,-0.72,0.61,0.8,0.56,0.22,-0.51,0.4,0.77,0.0,0.0,-81.31,44.64,-9.02,58.62,65.34,97.28,-20.0);') 41 | cmd.do('preset.ball_and_stick("all",mode=1);') 42 | cmd.do('draw;') 43 | -------------------------------------------------------------------------------- /ElectronDensity/carvedVolume.py: -------------------------------------------------------------------------------- 1 | cmd.do('delete all;') 2 | cmd.do('# Fetch the coordinates. Need internet connection.;') 3 | cmd.do('fetch 4dgr, async=0;') 4 | cmd.do('# Fetch the electron density map.;') 5 | cmd.do('fetch 4dgr, type=2fofc,async=0;') 6 | cmd.do('# create a selection out of the glycan;') 7 | cmd.do('select LongGlycan, resi 469:477;') 8 | cmd.do('# oreint the long axes of the object along the x-axis;') 9 | cmd.do('orient LongGlycan;') 10 | cmd.do('# remove everything except the glycan;') 11 | cmd.do('remove not LongGlycan;') 12 | cmd.do('# remove the remaining hydrogen atoms;') 13 | cmd.do('remove name H*;') 14 | cmd.do('# show the electron density map as a surface.') 15 | cmd.do('surface 2fofcmap, 4dgr_2fofc, 1, LongGlycan, carve = 1.8;') 16 | cmd.do('color density, 2fofcmap; ') 17 | cmd.do('show sticks;') 18 | cmd.do('show spheres;') 19 | cmd.do('set stick_radius, .07;') 20 | cmd.do('set sphere_scale, .19;') 21 | cmd.do('set sphere_scale, .13, elem H;') 22 | cmd.do('set bg_rgb=[1, 1, 1];') 23 | cmd.do('set stick_quality, 50;') 24 | cmd.do('# make the spheres smooth with larger settings.;') 25 | cmd.do('set sphere_quality, 4;') 26 | cmd.do('# gray85 is off-white, gray0 is black;') 27 | cmd.do('color gray85, elem C;') 28 | cmd.do('color red, elem O;') 29 | cmd.do('color slate, elem N;') 30 | cmd.do('color gray98, elem H;') 31 | cmd.do('set stick_color, gray50;') 32 | cmd.do('set ray_trace_mode, 1;') 33 | cmd.do('set ray_texture, 2;') 34 | cmd.do('set antialias, 3;') 35 | cmd.do('set ambient, 0.5;') 36 | cmd.do('set spec_count, 5;') 37 | cmd.do('set shininess, 50;') 38 | cmd.do('set specular, 1;') 39 | cmd.do('set reflect, .1;') 40 | cmd.do('set dash_gap, 0;') 41 | cmd.do('set dash_color, black;') 42 | cmd.do('set dash_gap, .15;') 43 | cmd.do('set dash_length, .05;') 44 | cmd.do('set dash_round_ends, 0;') 45 | cmd.do('set dash_radius, .05;') 46 | cmd.do('set_view (0.34,-0.72,0.61,0.8,0.56,0.22,-0.51,0.4,0.77,0.0,0.0,-81.31,44.64,-9.02,58.62,65.34,97.28,-20.0);') 47 | cmd.do('preset.ball_and_stick("all",mode=1);') 48 | cmd.do('draw;') 49 | -------------------------------------------------------------------------------- /ElectronDensity/fetch2FoFcIsomesh.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 3nd4, 3nd4_2fofc, type=2fofc, async=0;') 2 | cmd.do('isomesh 2fofcmap, 3nd4_2fofc, 1, 3nd4, carve = 1.8;') 3 | -------------------------------------------------------------------------------- /ElectronDensity/fetch2FoFcIsosurface.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 3nd4, 3nd4_2fofc, type=2fofc, async=0;') 2 | cmd.do('# Render and display a contour of this map as a chicken wire representation.;') 3 | cmd.do('isosurface 2fofcmap, 3nd4_2fofc, 1, 3nd4, carve = 1.8;') 4 | -------------------------------------------------------------------------------- /ElectronDensity/fetch2FoFcVolume.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 3nd4, type=cif, async=0;') 2 | cmd.do('fetch 3nd4, {1:3nd4_2fofc, type=2fofc, async=0;') 3 | cmd.do('# Render and display a contour of this map as a volume around a selection called LongGlycan.;') 4 | cmd.do('volume 2fofcmap, 3nd4_2fofc, 1, LongGlycan, carve = 1.8;') 5 | -------------------------------------------------------------------------------- /ElectronDensity/fetchThreeMaps.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 4dgr, type=pdb;') 2 | cmd.do('# Make sure to rename map file so that ;') 3 | cmd.do('# the root filename differs from pdb root filename;') 4 | cmd.do('fetch 4dgr, 4dgr_2fofc, type=2fofc;') 5 | cmd.do('fetch 4dgr, 4dgr_fofc, type=fofc;') 6 | cmd.do('select glycan, resid 200 or resid 469:477;') 7 | cmd.do('isomesh mesh1, 2fofc, 1.0, glycan;') 8 | cmd.do('color density, mesh1;') 9 | cmd.do('isomesh mesh2, fofc, 3.0, glycan;') 10 | cmd.do('color green, mesh2;') 11 | cmd.do('isomesh mesh3, fofc, -3.0, glycan;') 12 | cmd.do('color red, mesh3;') 13 | -------------------------------------------------------------------------------- /ElectronDensity/loadThreeMaps.py: -------------------------------------------------------------------------------- 1 | cmd.do('load 4dgr.pdb;') 2 | cmd.do('# Make sure to rename map file so that;') 3 | cmd.do('# the root filename differs from pdb root filename;') 4 | cmd.do('load 4dgr_2fofc.ccp4, 2fofc;') 5 | cmd.do('load 4dgr_fofc.ccp4, fofc;') 6 | cmd.do('select glycan, resid 200 or (resid 469:477);') 7 | cmd.do('isomesh mesh1, 2fofc, 1.0, glycan;') 8 | cmd.do('color density, mesh1;') 9 | cmd.do('isomesh mesh2, fofc, 3.0, glycan;') 10 | cmd.do('color green, mesh2;') 11 | cmd.do('isomesh mesh3, fofc, -3.0, glycan;') 12 | cmd.do('color red, mesh3;') 13 | -------------------------------------------------------------------------------- /ElectronDensity/threeMapsIsosurface.py: -------------------------------------------------------------------------------- 1 | cmd.do('load 4dgr.pdb;') 2 | cmd.do('# Make sure to rename map file so that ;') 3 | cmd.do('# the root filename differs from pdb root filename;') 4 | cmd.do('load 4dgr_2fofc.ccp4, 2fofc;') 5 | cmd.do('load 4dgr_fofc.ccp4, fofc;') 6 | cmd.do('select glycan, resid 200 or (resid 469:477);') 7 | cmd.do('isosurface mesh1, 2fofc, 1.0, glycan;') 8 | cmd.do('color density, mesh1;') 9 | cmd.do('isosurface mesh2, fofc, 3.0, glycan;') 10 | cmd.do('color green, mesh2;') 11 | cmd.do('isosurface mesh3, fofc, -3.0, glycan;') 12 | cmd.do('color red, mesh3;') 13 | -------------------------------------------------------------------------------- /ElectronDensity/threeMapsVolume.py: -------------------------------------------------------------------------------- 1 | cmd.do('load 4dgr.pdb;') 2 | cmd.do('# Make sure to rename map file so that ;') 3 | cmd.do('# the root filename differs from pdb root filename;') 4 | cmd.do('load 4dgr_2fofc.ccp4, 2fofc;') 5 | cmd.do('load 4dgr_fofc.ccp4, fofc;') 6 | cmd.do('select glycan, resid 200 or (resid 469:477);') 7 | cmd.do('volume mesh1, 2fofc, 1.0, glycan;') 8 | cmd.do('color density, mesh1;') 9 | cmd.do('volume mesh2, fofc, 3.0, glycan;') 10 | cmd.do('color green, mesh2;') 11 | cmd.do('volume mesh3, fofc, -3.0, glycan;') 12 | cmd.do('color red, mesh3;') 13 | -------------------------------------------------------------------------------- /FileIO/cblindCartoon.py: -------------------------------------------------------------------------------- 1 | CB; 2 | color cb_lightblue, ss h; 3 | color cb_vermillion, ss s; 4 | color lightorange, ss l+""; 5 | 6 | -------------------------------------------------------------------------------- /FileIO/fetchCIF.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 3nd4, type=cif, async=0;') 2 | -------------------------------------------------------------------------------- /FileIO/fetchFoFc.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 3nd4, 3nd4_fofc, type=fofc, async=0;') 2 | -------------------------------------------------------------------------------- /FileIO/loadPDBfile.py: -------------------------------------------------------------------------------- 1 | cmd.do('load my.pdb;') 2 | -------------------------------------------------------------------------------- /FileIO/printPath.py: -------------------------------------------------------------------------------- 1 | print(pymol.__path__) 2 | -------------------------------------------------------------------------------- /FileIO/saln.py: -------------------------------------------------------------------------------- 1 | cmd.do('python;') 2 | cmd.do('import datetime;') 3 | cmd.do('from pymol import cmd;') 4 | cmd.do('DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M");') 5 | cmd.do('s = str(DT);') 6 | cmd.do('cmd.save(stemName+s+".aln");') 7 | cmd.do('python end;') 8 | -------------------------------------------------------------------------------- /FileIO/salnpy.py: -------------------------------------------------------------------------------- 1 | import datetime; 2 | from pymol import cmd; 3 | DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M"); 4 | s = str(DT); 5 | cmd.save(stemName+s+".aln"); 6 | 7 | -------------------------------------------------------------------------------- /FileIO/savePNG.py: -------------------------------------------------------------------------------- 1 | cmd.do('png saveMe.png, 1920, 1920, 600, 1;') 2 | -------------------------------------------------------------------------------- /FileIO/sccp4.py: -------------------------------------------------------------------------------- 1 | cmd.do('python;') 2 | cmd.do('import datetime;') 3 | cmd.do('from pymol import cmd; ') 4 | cmd.do('DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M");') 5 | cmd.do('s = str(DT); ') 6 | cmd.do('cmd.save(stemName+s+".ccp4"); ') 7 | cmd.do('python end;') 8 | -------------------------------------------------------------------------------- /FileIO/sccp4py.py: -------------------------------------------------------------------------------- 1 | import datetime; 2 | from pymol import cmd; 3 | DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M"); 4 | s = str(DT); 5 | cmd.save(stemName+s+".ccp4"); 6 | -------------------------------------------------------------------------------- /FileIO/sdae.py: -------------------------------------------------------------------------------- 1 | import datetime; 2 | DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M"); 3 | s = str(DT); 4 | cmd.save(stemName+s+".dae"); 5 | 6 | -------------------------------------------------------------------------------- /FileIO/sdaepy.py: -------------------------------------------------------------------------------- 1 | import datetime; 2 | DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M"); 3 | s = str(DT); 4 | cmd.save(stemName+s+".dae"); 5 | 6 | -------------------------------------------------------------------------------- /FileIO/spng.py: -------------------------------------------------------------------------------- 1 | cmd.do('python;') 2 | cmd.do('import datetime;') 3 | cmd.do('from pymol import cmd; ') 4 | cmd.do('DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M");') 5 | cmd.do('s = str(DT); ') 6 | cmd.do('cmd.save(stemName+s+".png"); ') 7 | cmd.do('python end;') 8 | -------------------------------------------------------------------------------- /FileIO/spngpy.py: -------------------------------------------------------------------------------- 1 | import datetime; 2 | from pymol import cmd; 3 | DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M"); 4 | s = str(DT); 5 | cmd.save(stemName+s+".png"); 6 | 7 | -------------------------------------------------------------------------------- /FileIO/spse.py: -------------------------------------------------------------------------------- 1 | cmd.do('python;') 2 | cmd.do('import datetime;') 3 | cmd.do('from pymol import cmd; ') 4 | cmd.do('DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M");') 5 | cmd.do('s = str(DT); ') 6 | cmd.do('cmd.save(stemName+s+".pse"); ') 7 | cmd.do('python end;') 8 | -------------------------------------------------------------------------------- /FileIO/wallart.py: -------------------------------------------------------------------------------- 1 | cmd.do('# Reset hash_max from 100 to 2000 to enable the saving of images of large size for office wall hangings, eg. 30 x 30 inches. ') 2 | cmd.do('hash_max=2000') 3 | -------------------------------------------------------------------------------- /FileIO/wallartpy.py: -------------------------------------------------------------------------------- 1 | # Reset hash_max from 100 to 2000 to enable the saving of images of large size for office wall hangings, eg. 30 x 30 inches.; 2 | cmd.do("hash_max=2000"); 3 | -------------------------------------------------------------------------------- /H-bonds/distance.py: -------------------------------------------------------------------------------- 1 | cmd.do('# Edit the name for the ditance, the selection criteria for atom 1, and the selection criteria for atom 2.;') 2 | cmd.do('distance dist3, /rcsb074137//B/IOD`605/I`B, /rcsb074137//B/IOD`605/I`A;') 3 | -------------------------------------------------------------------------------- /H-bonds/drawHbonds.py: -------------------------------------------------------------------------------- 1 | cmd.do('hide everything, hydrogens;') 2 | cmd.do('hide labels;') 3 | cmd.do('# set the color of the dashed lines representing the H-bond.;') 4 | cmd.do('set dash_color, black;') 5 | cmd.do('set dash_gap, 0.4;') 6 | cmd.do('set dash_radius, 0.08;') 7 | -------------------------------------------------------------------------------- /H-bonds/hbonddash.py: -------------------------------------------------------------------------------- 1 | cmd.do('hide everything, hydrogens;') 2 | cmd.do('hide labels;') 3 | cmd.do('set dash_color, black; ') 4 | cmd.do('set dash_gap, 0.4;') 5 | cmd.do('set dash_radius, 0.08;') 6 | -------------------------------------------------------------------------------- /Help/cmddocs.py: -------------------------------------------------------------------------------- 1 | [help(i) for i in dir(cmd)]; 2 | -------------------------------------------------------------------------------- /Help/github.py: -------------------------------------------------------------------------------- 1 | cmd.do('https://github.com/MooersLab/pymolsnips/blob/master/README.md') 2 | -------------------------------------------------------------------------------- /Help/helpDocs.py: -------------------------------------------------------------------------------- 1 | cmd.do('help(help)') 2 | -------------------------------------------------------------------------------- /Help/presetDocs.py: -------------------------------------------------------------------------------- 1 | help(preset) 2 | -------------------------------------------------------------------------------- /Help/printDoc.py: -------------------------------------------------------------------------------- 1 | cmd.do('print my_func.__doc__;') 2 | -------------------------------------------------------------------------------- /Help/printDocpy.py: -------------------------------------------------------------------------------- 1 | print(my_func.__doc__); 2 | -------------------------------------------------------------------------------- /Help/pymoldocs.py: -------------------------------------------------------------------------------- 1 | [help(i) for i in dir(pymol)]; 2 | -------------------------------------------------------------------------------- /Help/pymoldocspy.py: -------------------------------------------------------------------------------- 1 | [help(i) for i in dir(pymol)]; 2 | -------------------------------------------------------------------------------- /Help/writeCommandReference2HTML.py: -------------------------------------------------------------------------------- 1 | cmd.write_html_ref("pymol-command-ref.html"); 2 | -------------------------------------------------------------------------------- /Jupyter/AO.py: -------------------------------------------------------------------------------- 1 | cmd.do("AO") 2 | -------------------------------------------------------------------------------- /Jupyter/AOBW.py: -------------------------------------------------------------------------------- 1 | cmd.do("AOBW") 2 | -------------------------------------------------------------------------------- /Jupyter/AOD.py: -------------------------------------------------------------------------------- 1 | cmd.do("AOD") 2 | -------------------------------------------------------------------------------- /Jupyter/AODBW.py: -------------------------------------------------------------------------------- 1 | cmd.do("AODBW") 2 | -------------------------------------------------------------------------------- /Jupyter/PE125.py: -------------------------------------------------------------------------------- 1 | cmd.do("PE125") 2 | -------------------------------------------------------------------------------- /Jupyter/PE25.py: -------------------------------------------------------------------------------- 1 | cmd.do("PE25") 2 | -------------------------------------------------------------------------------- /Jupyter/PE33.py: -------------------------------------------------------------------------------- 1 | cmd.do("PE33") 2 | -------------------------------------------------------------------------------- /Jupyter/PE50.py: -------------------------------------------------------------------------------- 1 | cmd.do("PE50") 2 | -------------------------------------------------------------------------------- /Jupyter/PE66.py: -------------------------------------------------------------------------------- 1 | cmd.do("PE66") 2 | -------------------------------------------------------------------------------- /Jupyter/PE75.py: -------------------------------------------------------------------------------- 1 | cmd.do("PE75") 2 | -------------------------------------------------------------------------------- /Jupyter/PE85.py: -------------------------------------------------------------------------------- 1 | cmd.do("PE85") 2 | -------------------------------------------------------------------------------- /Jupyter/cav.py: -------------------------------------------------------------------------------- 1 | cmd.do("cav") 2 | -------------------------------------------------------------------------------- /Jupyter/cntccp4emaps.py: -------------------------------------------------------------------------------- 1 | print("Count the number of ccp4 electron density files in current directory."); 2 | print("Usage: cntccp4s"); 3 | myPath = os.getcwd(); 4 | ccp4Counter = len(glob.glob1(myPath,"*.pse")); 5 | print("Number of number of ccp4 electron density files in the current directory: ", ccp4Counter); 6 | -------------------------------------------------------------------------------- /Jupyter/cntfiles.py: -------------------------------------------------------------------------------- 1 | print("Count the files in the directory.") 2 | print("Usage: cntfiles.") 3 | # simple version for working with CWD 4 | print("Number of files in current working directory: ", len([name for name in os.listdir(".") if os.path.isfile(name)])) 5 | -------------------------------------------------------------------------------- /Jupyter/cntlogs.py: -------------------------------------------------------------------------------- 1 | print("Count the number of log image files in current directory."); 2 | print("Usage: cntlogs"); 3 | myPath = os.getcwd(); 4 | logCounter = len(glob.glob1(myPath,"*.log")); 5 | print("Number of number of log image files in the current directory: ", logCounter); 6 | -------------------------------------------------------------------------------- /Jupyter/cntmtzs.py: -------------------------------------------------------------------------------- 1 | print("Count the number of mtz structure factor files in current directory."); 2 | print("Usage: cntmtzs"); 3 | myPath = os.getcwd(); 4 | mtzCounter = len(glob.glob1(myPath,"*.mtz")); 5 | print("Number of number of mtz structure factor files in the current directory: ", mtzCounter); 6 | -------------------------------------------------------------------------------- /Jupyter/cntpdbs.py: -------------------------------------------------------------------------------- 1 | print("Count the number of pdb files in the current directory.") 2 | print("Usage: cntpdb") 3 | myPath = os.getcwd() 4 | pdbCounter = len(glob.glob1(myPath,"*.pdb")) 5 | print("Number of pdb files in the current directory: ", pdbCounter) 6 | -------------------------------------------------------------------------------- /Jupyter/cntpmls.py: -------------------------------------------------------------------------------- 1 | print("Count the number of pml (Pymol macro language) files in current directory."); 2 | print("Usage: cntpmls"); 3 | myPath = os.getcwd(); 4 | pmlCounter = len(glob.glob1(myPath,"*.pml")); 5 | print("Number of pml files in the current directory: ", pmlCounter); 6 | -------------------------------------------------------------------------------- /Jupyter/cntpngs.py: -------------------------------------------------------------------------------- 1 | print("Count the number of png image files in current directory."); 2 | print("Usage: cntpngs"); 3 | myPath = os.getcwd(); 4 | pngCounter = len(glob.glob1(myPath,"*.png")); 5 | print("Number of number of png image files in the current directory: ", pngCounter); 6 | -------------------------------------------------------------------------------- /Jupyter/cntpses.py: -------------------------------------------------------------------------------- 1 | print("Count the number of *.pse (session) files in current directory."); 2 | print("Usage: cntpses"); 3 | myPath = os.getcwd(); 4 | pseCounter = len(glob.glob1(myPath,"*.pse")); 5 | print("Number of *.pse (session) files in the current directory: ", pseCounter); 6 | -------------------------------------------------------------------------------- /Jupyter/colorh1.py: -------------------------------------------------------------------------------- 1 | cmd.do("colorh1") 2 | -------------------------------------------------------------------------------- /Jupyter/colorh2.py: -------------------------------------------------------------------------------- 1 | cmd.do("colorh2") 2 | -------------------------------------------------------------------------------- /Jupyter/hb.py: -------------------------------------------------------------------------------- 1 | cmd.distance("hbonds", "all", "all", "3.2", mode="2") 2 | cmd.set("dash_gap","0.4") 3 | cmd.set("dash_color","grey30") 4 | cmd.set("dash_width","1.5") 5 | cmd.set("dash_length",".25") 6 | print("Enter 'rmhb' to remove the hbonds.") 7 | -------------------------------------------------------------------------------- /Jupyter/importIPythonDisplay.py: -------------------------------------------------------------------------------- 1 | from IPython.display import Image 2 | from IPython.core.display import HTML 3 | PATH = "/Users/blaine/" 4 | -------------------------------------------------------------------------------- /Jupyter/importPyMOLandShortcuts.py: -------------------------------------------------------------------------------- 1 | from pymol import cmd 2 | from IPython.display import Image 3 | PATH = "/Users/blaine/" 4 | cmd.do("run /Users/blaine/Scripts/PyMOLScripts/pymolshortcuts.py") 5 | -------------------------------------------------------------------------------- /Jupyter/importPyMOLcmd.py: -------------------------------------------------------------------------------- 1 | from pymol import cmd 2 | -------------------------------------------------------------------------------- /Jupyter/importShortcuts.py: -------------------------------------------------------------------------------- 1 | cmd.do("run /Users/blaine/Scripts/PyMOLScripts/pymolshortcuts.py") 2 | -------------------------------------------------------------------------------- /Jupyter/imports4PyMOLjupyter.py: -------------------------------------------------------------------------------- 1 | from pymol import cmd 2 | from IPython.display import Image 3 | from IPython.core.display import HTML 4 | PATH = "/Users/blaine/" 5 | -------------------------------------------------------------------------------- /Jupyter/ipymolProtein.py: -------------------------------------------------------------------------------- 1 | # Create a kernel for PyMOL"s python interpreter inside Jupyter; 2 | # See the kernel snippet for an example.; 3 | # See the README.md file on pymolsnips GItHub website; 4 | # https://github.com/MooersLab/pymilsnips; 5 | # for more details.; 6 | # Start pymol in terminal with pymol -R; 7 | # Select pymol.python as kernel in juptyer; 8 | from ipymol import viewer as ipv; 9 | # Start PyMOL RPC server; 10 | ipv.start(); 11 | ipv.do("fetch 1lw9"); 12 | ipv.do("rv"); 13 | # The double parentheses are required when set_view is run this way.; 14 | ipv.set_view((-0.13,-0.4,-0.91,0.89,-0.45,0.07,-0.44,-0.8,0.41,0.0,0.0,-182.47,35.13,11.48,9.72,149.64,215.3,-20.0)); 15 | ipv.do("AOD"); 16 | ipv.png("testipymolT4L.png"); 17 | -------------------------------------------------------------------------------- /Jupyter/ipymolStart.py: -------------------------------------------------------------------------------- 1 | from ipymol import viewer as ipv; 2 | ipv.start() # Start PyMOL RPC server; 3 | 4 | -------------------------------------------------------------------------------- /Jupyter/kernel.py: -------------------------------------------------------------------------------- 1 | framerule=2pt, 2 | framesep=2mm, 3 | framesep=2mm, 4 | breaklines=True, 5 | baselinestretch=1.2 6 | ]{bash 7 | { 8 | "argv": [ 9 | "/Applications/PyMOL.app/Contents/bin/python", 10 | "-m", 11 | "ipykernel_launcher", 12 | "-f", 13 | "{connection_file" 14 | ], 15 | "display_name": "pymol.python", 16 | "language": "python" 17 | 18 | -------------------------------------------------------------------------------- /Jupyter/loadImage.py: -------------------------------------------------------------------------------- 1 | Image(filename = PATH +"5da6orient.png", width=600, height=1000, unconfined=True); 2 | -------------------------------------------------------------------------------- /Jupyter/nmr.py: -------------------------------------------------------------------------------- 1 | cmd.do('set all_states, on') 2 | -------------------------------------------------------------------------------- /Jupyter/nmroff.py: -------------------------------------------------------------------------------- 1 | cmd.do('set all_states, off') 2 | -------------------------------------------------------------------------------- /Jupyter/nmroffpy.py: -------------------------------------------------------------------------------- 1 | cmd.do("set all_states, off") 2 | -------------------------------------------------------------------------------- /Jupyter/nmrpy.py: -------------------------------------------------------------------------------- 1 | cmd.do('cmd.do("set all_states, on")') 2 | -------------------------------------------------------------------------------- /Jupyter/rdkrpcChem.py: -------------------------------------------------------------------------------- 1 | import os; 2 | import rdkit; 3 | from rdkit import Chem; 4 | from rdkit.Chem import AllChem; 5 | from rdkit.Chem import PyMol; 6 | 7 | s = PyMOL.MolViewer(); 8 | mol = Chem.MolFromSmiles("CCOCCn1c(C2CC[NH+](CCc3ccc(C(C)(C)C(=O)[O-])cc3)CC2)nc2ccccc21"); 9 | mol = AllChem.AddHs(mol); 10 | AllChem.EmbedMolecule(mol); 11 | AllChem.MMFFOptimizeMolecule(mol); 12 | s.ShowMol(mol, name = "bilastine", showOnly = False); 13 | s.Zoom("bilastine"); 14 | s.SetDisplayStyle("bilastine", "sticks"); 15 | s.GetPNG(preDelay=5); 16 | -------------------------------------------------------------------------------- /Jupyter/rdkrpcProtein.py: -------------------------------------------------------------------------------- 1 | from rdkit.Chem import PyMol; 2 | 3 | Usage=""""Start pymol from command line with -R flag. 4 | Select the pymol.python kernel in Jupyter notebook. """; 5 | 6 | s = PyMol.MolViewer(); 7 | du = s.server.do; 8 | du("rein; bg_color white; fetch 1lw9, type=pdb, async=0, show;nb_spheres;set_view (0.46,-0.28,-0.84,0.74,-0.41,0.54,-0.49,-0.87,0.02,0.0,0.0,-155.16,35.13,11.48,9.72,122.33,187.99,-20.0);"); 9 | s.GetPNG(preDelay=3); 10 | du("png T4L600dpi.png, dpi=600"); 11 | -------------------------------------------------------------------------------- /Jupyter/rmd.py: -------------------------------------------------------------------------------- 1 | cmd.do("delete measure*") 2 | cmd.do("delete m*_*") 3 | cmd.do("delete dist*") 4 | -------------------------------------------------------------------------------- /Jupyter/rmhb.py: -------------------------------------------------------------------------------- 1 | cmd.delete("hbonds") 2 | -------------------------------------------------------------------------------- /Jupyter/rv.py: -------------------------------------------------------------------------------- 1 | cmd.do('rv') 2 | -------------------------------------------------------------------------------- /Jupyter/rvi.py: -------------------------------------------------------------------------------- 1 | def rvj(StoredView=0, decimal_places=2, outname="roundedview.txt"): 2 | """ 3 | rvj() is a modification of the the rv() function (aka the roundview.py) 4 | so that it can run in Jupyter notebooks with the ipymol.viewer. 5 | A set_view string is printed to the noteobook in a format that is ready 6 | for reuse. 7 | 8 | The ipymol module was developed by Carlos Hernandez: 9 | 10 | https://github.com/cxhernandez/ipymol 11 | 12 | The pre-requisites for installing ipymol are as follows: 13 | 14 | 1. Make a jupyter notebook kernel for Python interpreter inside of 15 | the Schrodinger PyMOL. See the PyMOL Snippets GitHub Page for 16 | a description of how to make one. 17 | 2. Install the following build of ipymol at the PyMOL prompt. 18 | You need to log into your GitHub account first. 19 | 20 | pip install git+pip install git+https://github.com/cxhernandez/ipymol.git@2a30d6ec1588434e6f0f72a1d572444f89ff535b 21 | 22 | 3. Make a bash alias to this PyMOL app file. 23 | 24 | 4. Launch the jupyter notebook and select the pymol.python kernel. 25 | 26 | 5. Open a terminal instance from the File pulldown in jupyter notebook. 27 | 28 | 6. Enter `pymol -Rq` to launch an interactive instance of PyMOL. 29 | 30 | 7. Enter the following code to load ipymol and conmect to PyMOL 31 | 32 | from ipymol import viewer as ipv 33 | ipv.start() # Start PyMOL RPC server 34 | 35 | Now you can change the scene manually and send the display as static 36 | image to a cell in the jupyter notebook. 37 | 38 | It is assumed that the viewer class of the ipymol moduel has been 39 | imported as ipv. 40 | 41 | I made the following modifications of roundview.py. 42 | The cmd.get_view was replaced with ipv.get_view. 43 | The cmd.extend was replaced with ipv.extend. 44 | The myRoundedList was returned for further processing. 45 | 46 | MIT License 47 | 48 | Copyright: 49 | Blaine Mooers and the OU Board of Regents 50 | Uniersity of Oklahoma Health Sciences Center 51 | Oklahoma City, OK 73104 52 | 53 | 29 April 2020 54 | 55 | """ 56 | 57 | 58 | StoredView = int(StoredView) 59 | decimal_places = int(decimal_places) 60 | 61 | #call the get_view function 62 | 63 | m = ipv.get_view(StoredView) 64 | 65 | 66 | #Make a list of the elements in the orientation matrix. 67 | 68 | myList = [m[0], m[1], m[2], m[3], m[4], m[5], m[6],m[7], m[8], m[9], 69 | m[10], m[11], m[12], m[13], m[14],m[15], m[16], m[17]] 70 | 71 | #Round off the matrix elements to two decimal places (two fractional places) 72 | #This rounding approach solved the problem of unwanted 73 | #whitespaces when I tried to use a string format statement 74 | 75 | myRoundedList = [round(elem, decimal_places) for elem in myList] 76 | 77 | #x is the string template for the output. The whitespace is required 78 | #between the "set_view" and "(" 79 | 80 | x = "set_view ({0,{1,{2,{3,{4,{5,{6,{7,{8,{9,{10,{11,{12,{13,{14,{15,{16,{17);" 81 | 82 | # Print to the command history window. 83 | print(x.format(*myRoundedList)) 84 | 85 | #Write to a text file. 86 | myFile = open("roundedview.txt", "a") 87 | myFile.write(x.format(*myRoundedList) + "") 88 | myFile.close() 89 | return myRoundedList 90 | ipv.extend("rv", rv) 91 | -------------------------------------------------------------------------------- /Jupyter/rvr.py: -------------------------------------------------------------------------------- 1 | def rvr(StoredView=0, decimal_places=2, outname="roundedview.txt"): 2 | """MIT License 3 | Copyright: 4 | Blaine Mooers and the OU Board of Regents 5 | University of Oklahoma Health Sciences Center 6 | Oklahoma City, OK 73104 7 | 30 April 2020 8 | 9 | First run the following: 10 | 11 | from rdkit.Chem import PyMol 12 | s = PyMol.MolViewer() 13 | du = s.server.do 14 | 15 | """ 16 | StoredView = int(StoredView) decimal_places = int(decimal_places) 17 | #call the get_view function 18 | m = s.get_view(StoredView) 19 | #Make a list of the elements in the orientation matrix. 20 | myList = [m[0], m[1], m[2], m[3], m[4], m[5], m[6],m[7], m[8], m[9], 21 | m[10], m[11], m[12], m[13], m[14],m[15], m[16], m[17]] 22 | #Round off the matrix elements to two decimal places (two fractional places) 23 | #This rounding approach solved the problem of unwanted 24 | #whitespaces when I tried to use a string format statement 25 | myRoundedList = [round(elem, decimal_places) for elem in myList] 26 | #x is the string template for the output. The whitespace is required 27 | #between the "set_view" and "(" 28 | x = "set_view ({0,{1,{2,{3,{4,{5,{6,{7,{8,{9,{10,{11,{12,{13,{14,{15,{16,{17);" 29 | # Print to the command history window. 30 | print(x.format(*myRoundedList)) 31 | #Write to a text file. 32 | myFile = open("roundedview.txt", "a") myFile.write(x.format(*myRoundedList) + "") myFile.close() 33 | return myRoundedList 34 | du.extend("rvr", rvr) 35 | 36 | -------------------------------------------------------------------------------- /Jupyter/timcolor.py: -------------------------------------------------------------------------------- 1 | cmd.do("timcolor") 2 | -------------------------------------------------------------------------------- /Jupyter/yrb.py: -------------------------------------------------------------------------------- 1 | cmd.do("yrb") 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Blaine Mooers and the University of Oklahoma Board of Regents 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Labels/centerpi.py: -------------------------------------------------------------------------------- 1 | cmd.do('pseudoatom pi_cent,/3nd3/A/U`15/cg+cz;') 2 | cmd.do('dist pi_cent////ps1, b/U`15/aaa;') 3 | -------------------------------------------------------------------------------- /Labels/displayFonts.py: -------------------------------------------------------------------------------- 1 | cmd.do('python;') 2 | cmd.do('for i in range(1,21):') 3 | cmd.do(' name = "label%d" % i;') 4 | cmd.do(' cmd.pseudoatom(name, label="label font id %d" % i, pos=(0,0,0));') 5 | cmd.do(' cmd.set("label_font_id", i, name);') 6 | cmd.do('python end;') 7 | cmd.do('cmd.set("label_size", 50);') 8 | cmd.do('cmd.set("grid_mode");') 9 | -------------------------------------------------------------------------------- /Labels/displayFontspy.py: -------------------------------------------------------------------------------- 1 | for i in range(1,21): 2 | name = "label%d" % i; 3 | cmd.pseudoatom(name, label="label font id %d" % i, pos=(0,0,0)); 4 | cmd.set("label_font_id", i, name); 5 | cmd.set("label_size", 50); 6 | cmd.set("grid_mode"); 7 | 8 | -------------------------------------------------------------------------------- /Labels/labelCAs.py: -------------------------------------------------------------------------------- 1 | cmd.do('label name CA,"%s%s" % (resn,resi);') 2 | -------------------------------------------------------------------------------- /Labels/labelMainChain.py: -------------------------------------------------------------------------------- 1 | cmd.do('label name n+c+o+ca,"%s%s%s" % (resn,resi,name);') 2 | -------------------------------------------------------------------------------- /Labels/labelResnResi.py: -------------------------------------------------------------------------------- 1 | cmd.do('label name ca, "%s%s" %(one_letter[resn],resi);') 2 | -------------------------------------------------------------------------------- /Labels/labelSS.py: -------------------------------------------------------------------------------- 1 | cmd.do('alter chain A, ss="helix";') 2 | cmd.do('label (%2),"%3";') 3 | -------------------------------------------------------------------------------- /Labels/labelWatersHOH.py: -------------------------------------------------------------------------------- 1 | cmd.do('label resn HOH ,"%s%s" % (resn,resi);') 2 | -------------------------------------------------------------------------------- /Labels/labelWatersW.py: -------------------------------------------------------------------------------- 1 | cmd.do('label resn HOH ,"W%s" % (resi);') 2 | -------------------------------------------------------------------------------- /Labels/oneLetter.py: -------------------------------------------------------------------------------- 1 | cmd.do('one_leVer%={"VAL":"V",%"ILE":"I",%"LEU":"L",%"GLU":"E",%"GLN":"Q","ASP":"D",%') 2 | cmd.do('"ASN":"N",%"HIS":"H",%"TRP":"W",%"PHE":"F",%"TYR":"Y",%"ARG":"R",%"LYS":"K",%') 3 | cmd.do('"SER":"S",%"THR":"T",%"MET":"M",%"ALA":"A",%"GLY":"G",%"PRO":"P",%"CYS":"C"%') 4 | -------------------------------------------------------------------------------- /Labels/pseudolabel.py: -------------------------------------------------------------------------------- 1 | cmd.do('pseudoatom forLabel;') 2 | cmd.do('label forLabel, "%0";') 3 | cmd.do('set label_color, red;') 4 | -------------------------------------------------------------------------------- /Labels/sigang.py: -------------------------------------------------------------------------------- 1 | cmd.do('set label_angle_digits, 2;') 2 | -------------------------------------------------------------------------------- /Labels/sigdihedral.py: -------------------------------------------------------------------------------- 1 | cmd.do('set label_dihedral_digits, 2;') 2 | -------------------------------------------------------------------------------- /Labels/sigdist.py: -------------------------------------------------------------------------------- 1 | cmd.do('set label_distance_digits, 2;') 2 | -------------------------------------------------------------------------------- /ListSnippets/lsSnips.py: -------------------------------------------------------------------------------- 1 | cmd.do('"""Tab trigger Description') 2 | cmd.do('--------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------') 3 | cmd.do('antialias Set antialias to get smooth edges') 4 | cmd.do('ao Ambient occlussion.') 5 | cmd.do('aveB4resiX AveBResiX, prints the resiude number and the average bfactor.') 6 | cmd.do(' Uses reduce and lambda, builtin Python functional porgramming functions.') 7 | cmd.do(' Note that you need to convert the length of the list of Bfactors from an integer to a float before division into the sum.') 8 | cmd.do('averageB Uses a regular list as opposed to PyMOL"s stored list. Edit the selection as needed.') 9 | cmd.do('bs Ball and stick representation.') 10 | cmd.do('bu Biological unit.') 11 | cmd.do('carvedDensity Carved electron density.') 12 | cmd.do('cblind Color blindness.') 13 | cmd.do('centerpi Center pi.') 14 | cmd.do('coordinate Coordinate covalent bonds to metals and H-bonds friom RNA.') 15 | cmd.do('cribbon Color ribbon H red, strand yellow, loop green.') 16 | cmd.do('cspheres Colored spheres.') 17 | cmd.do('discreteCartoonColoring Turn on discrete colors between secondary structure elements.') 18 | cmd.do('distance H-bond distances.') 19 | cmd.do('doubleBond Valence bond.') 20 | cmd.do('drawHbonds Draw H-bonds.') 21 | cmd.do('duplicateObject Duplicate object.') 22 | cmd.do('ellipcol Set ellipsoid color.') 23 | cmd.do('extractPartObj Create a new object from part of an existing object.') 24 | cmd.do('fasta Print Fasta from PDB file.') 25 | cmd.do('fetch2FoFc Fetch 2FoFc map.') 26 | cmd.do('fetchCIF Fetch cif file.') 27 | cmd.do('fetchFoFc Fetch fofc map.') 28 | cmd.do('fetchPath Set path for location to save fetched pdb files.') 29 | cmd.do('filledRing Filled rings in nucleic acids.') 30 | cmd.do('findHbonds Find hbonds around a residue.') 31 | cmd.do('fog Blur the background atoms.') 32 | cmd.do('getCoordinates Get coordinates.') 33 | cmd.do('hbond Hbond setup.') 34 | cmd.do('hbonddash H-bond dashes.') 35 | cmd.do('hideSelection Trun off magenta squares on current selection.') 36 | cmd.do('hidealtloc Hide alt loc.') 37 | cmd.do('internalGUImode2 Makes the background of the internal gui transparent with the viewport extended into this region of the gui. This may be a useful mode for workshops.') 38 | cmd.do('internalGUIwidth Set the width of the internal gui.') 39 | cmd.do('labelCAs Label the CA atoms with the Ala333 style format') 40 | cmd.do('labelMainChain Label the main chain atoms by resn,resi,atom name.') 41 | cmd.do('labelResnResi Label CA atom with residue name and residue number.') 42 | cmd.do('labelSS Label SS.') 43 | cmd.do('labelWatersHOH Label waters HOH.') 44 | cmd.do('labelWatersW Label waters W.') 45 | cmd.do('loadPDBbs Load PDB ball-and-stick.') 46 | cmd.do('loadPDBfile Load a pdb file in the current directory.') 47 | cmd.do('loadPDBnb Load PDB nb spheres.') 48 | cmd.do('lsSnips List all snips by tab trigger and description') 49 | cmd.do('lspymolrc Print list of active pymolrc files.') 50 | cmd.do('molscriptRibbon Molscript ribbons.') 51 | cmd.do('ms Measure surface area.') 52 | cmd.do('oneLetter One letter amino acid.') 53 | cmd.do('pearl The pearl effect is made with two spheres with the outer sphere being transparent.') 54 | cmd.do('printBs Print the B-factors of a residue.') 55 | cmd.do('printBs2digits Print B-values for a residue with the B"s rounded off to two decimal places.') 56 | cmd.do('printBspartB Print B factors of part B of a rsidues.') 57 | cmd.do('printDoc Print document string of a function.') 58 | cmd.do('printNameB4ResiX Print name and b-factor for a rsidue. You can change this to a named selection or a residue range ( e.g., resi 133:155). Use the noH variant if H atoms are present.') 59 | cmd.do('printResiResnNameB4ResiX Print resn, resi, atom name, and b-factor.') 60 | cmd.do('printResiResnNameB4ResiXNoH Print name and b-factor for a rsidue. You can change this to a named selection or a residue range ( e.g., resi 133:155). The noH variant.') 61 | cmd.do('pseudolabel Position label with pseudoatom.') 62 | cmd.do('puttyCartoon Create a putty cartoon.') 63 | cmd.do('ringMode Set the ring mode to a value between 0 and 6 in cartoons of nucleic acids.') 64 | cmd.do('rmwater Remove waters from molecular object.') 65 | cmd.do('rotate Rotate about axis.') 66 | cmd.do('rv Return settings in rounded format.') 67 | cmd.do('savePNG Save a png file of current scene to the current directory.') 68 | cmd.do('saxsEnvelope Display SAXS envelope') 69 | cmd.do('sc111 Display all symmetry mates in one unit cell. Asumes supercell.py (sse PyMOL Wiki) is in $HOME/Scripts/PyMOLscripts/.') 70 | cmd.do('sc222 Run Tom Holder"s supercell script to generate three cells in all directions.') 71 | cmd.do('scaleRadiusColor Scale the radius and color of atoms as spheres by property in the B-value column.') 72 | cmd.do('selectAllBut Select all nitrogen atom in a selelction except from lysine.') 73 | cmd.do('selectAtomsAround Select atoms within a radius around a ligand.') 74 | cmd.do('selectChain Select a chain.') 75 | cmd.do('selectElement Select atoms by elemnt.') 76 | cmd.do('selectHelices Select atoms by alpha helices.') 77 | cmd.do('selectLoops Select atoms by beta loops.') 78 | cmd.do('selectName Select atoms by name.') 79 | cmd.do('selectResi Select residues by a range of numbers.') 80 | cmd.do('selectResidues Select residues by name.') 81 | cmd.do('selectResiduesAround Select residues within a radius around a ligand.') 82 | cmd.do('selectStrands Select atoms by beta strands.') 83 | cmd.do('setcolor Set color name to a RGB code.') 84 | cmd.do('setpath Set additional path for PyMOL to search on startup') 85 | cmd.do('sidehChainHelper In cartoons, hide the backbone atoms of selected residues when showing then as sticks.') 86 | cmd.do('sigDigits Set number of decimals places to show in distance labels.') 87 | cmd.do('sigang Set angle labels to display 2 decimals places') 88 | cmd.do('sigdist set distance labels to display 2 decimals') 89 | cmd.do('solventRadius Set radius of ball used to make solvent accessible surface.') 90 | cmd.do('spng Save png flle with timestamp') 91 | cmd.do('spse Save pse flle with timestamp') 92 | cmd.do('stack Base-stacking figure.') 93 | cmd.do('stereoDraw Stereo draw.') 94 | cmd.do('stereoRay Stereo ray.') 95 | cmd.do('threeMaps Three electron density.') 96 | cmd.do('turnAboutAxis Turn about axis.') 97 | cmd.do('undoSelection Undo a selection.') 98 | cmd.do('volumeRamp Volume ramp.') 99 | cmd.do('writeCommandReference2HTML Write the command reference to html file in the present working directory."""') 100 | -------------------------------------------------------------------------------- /Measurements/listLigandProteinDistances.py: -------------------------------------------------------------------------------- 1 | from pymol import cmd 2 | """ 3 | Find all distances betwen all ligand atoms and all protein atoms. 4 | 5 | Adapted and updated from script by Dan Kulp posted here 6 | https://sourceforge.net/p/pymol/mailman/message/10097804/ 7 | 8 | There are probably better solutions like finding just the 9 | distances to proein atoms within a certain distance from 10 | the ligand. 11 | 12 | Due to the nested for loops, this script is takes several second 13 | to run on a medium-sized human protein. This script is a 14 | good candidate for vectorization. 15 | 16 | It is also a good candiate for becoming a function and a shortcut. 17 | 18 | """ 19 | 20 | # customize these lines to your protein. 21 | cmd.fetch("6NEC") 22 | cmd.select("prot","not resn XIN and not resn HOH and not chain C") 23 | cmd.select("lig", "resn XIN and not chain C") 24 | 25 | dist_list = { 26 | pro_atoms = cmd.get_model("prot") 27 | lig_atoms = cmd.get_model("lig") 28 | 29 | for l_at in lig_atoms.atom: 30 | for p_at in pro_atoms.atom: 31 | dist_list[str(l_at.resn) + 32 | ":" + 33 | str(l_at.resi) + 34 | " " + 35 | l_at.name + 36 | " ---- " + 37 | str(p_at.resn) + 38 | ":" + 39 | str(p_at.resi) + 40 | " " + 41 | p_at.name] = cmd.dist("foo", 42 | "index " + 43 | str(l_at.index),"index " + str(p_at.index)) 44 | cmd.delete("foo") 45 | print("List of all pairwise ligand--protein atom-atom distances:") 46 | # [print("Distance of " + d + " is " + str(dist_list[d])) for d in dist_list.keys()] 47 | 48 | # More compact print statement. Need an f-string format statement. 49 | [print( d + " " + str(dist_list[d])) for d in dist_list.keys()] 50 | -------------------------------------------------------------------------------- /Measurements/ms.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 3nd3, name=3nd3, type=pdb, async=0;') 2 | cmd.do('select temp, 3nd3 and chain A;') 3 | cmd.do('run /Users/blaine-mooers/Scripts/PyMOLScripts/msms_pymol.py;') 4 | cmd.do('calc_msms_area temp;') 5 | -------------------------------------------------------------------------------- /MolecularRepresentation/ao.py: -------------------------------------------------------------------------------- 1 | cmd.do('set_color oxygen, [1.0,0.4,0.4];') 2 | cmd.do('set_color nitrogen, [0.5,0.5,1.0];') 3 | cmd.do('remove solvent;') 4 | cmd.do('as spheres;') 5 | cmd.do('util.cbaw;') 6 | cmd.do('bg white;') 7 | cmd.do('set light_count,10;') 8 | cmd.do('set spec_count,1;') 9 | cmd.do('set shininess, 10;') 10 | cmd.do('set specular,0.25;') 11 | cmd.do('set ambient,0;') 12 | cmd.do('set direct,0;') 13 | cmd.do('set reflect,1.5;') 14 | cmd.do('set ray_shadow_decay_factor, 0.1;') 15 | cmd.do('set ray_shadow_decay_range, 2;') 16 | cmd.do('set depth_cue, 0;') 17 | cmd.do('ray;') 18 | -------------------------------------------------------------------------------- /MolecularRepresentation/aobw.py: -------------------------------------------------------------------------------- 1 | cmd.do('# Note: requires the gscale() function from pymolshortcuts.py.') 2 | cmd.do('# Download this script from http://GitHub.com/MooersLab/pymolshortcuts.') 3 | cmd.do('# Load the functions from this script with the command "run pymolshortcuts.py"') 4 | cmd.do('set_color oxygen, [1.0,0.4,0.4];') 5 | cmd.do('set_color nitrogen, [0.5,0.5,1.0];') 6 | cmd.do('remove solvent;') 7 | cmd.do('as spheres;') 8 | cmd.do('util.cbaw;') 9 | cmd.do('bg white;') 10 | cmd.do('gscale();') 11 | cmd.do('set light_count,10;') 12 | cmd.do('set spec_count,1;') 13 | cmd.do('set shininess, 10;') 14 | cmd.do('set specular,0.25;') 15 | cmd.do('set ambient,0;') 16 | cmd.do('set direct,0;') 17 | cmd.do('set reflect,1.5;') 18 | cmd.do('set ray_shadow_decay_factor, 0.1;') 19 | cmd.do('set ray_shadow_decay_range, 2;') 20 | cmd.do('set depth_cue, 0;') 21 | cmd.do('ray;') 22 | -------------------------------------------------------------------------------- /MolecularRepresentation/aod.py: -------------------------------------------------------------------------------- 1 | cmd.do('set_color oxygen, [1.0,0.4,0.4];') 2 | cmd.do('set_color nitrogen, [0.5,0.5,1.0];') 3 | cmd.do('remove solvent;') 4 | cmd.do('as spheres;') 5 | cmd.do('util.cbaw;') 6 | cmd.do('bg white;') 7 | cmd.do('set light_count,10;') 8 | cmd.do('set spec_count,1;') 9 | cmd.do('set shininess, 10;') 10 | cmd.do('set specular,0.25;') 11 | cmd.do('set ambient,0;') 12 | cmd.do('set direct,0;') 13 | cmd.do('set reflect,1.5;') 14 | cmd.do('set ray_shadow_decay_factor, 0.1;') 15 | cmd.do('set ray_shadow_decay_range, 2;') 16 | cmd.do('color gray00, symbol c') 17 | cmd.do('color gray90, symbol h') 18 | cmd.do('set depth_cue, 0;') 19 | cmd.do('ray;') 20 | -------------------------------------------------------------------------------- /MolecularRepresentation/aodbw.py: -------------------------------------------------------------------------------- 1 | cmd.do('set_color oxygen, [1.0,0.4,0.4];') 2 | cmd.do('set_color nitrogen, [0.5,0.5,1.0];') 3 | cmd.do('remove solvent;') 4 | cmd.do('as spheres;') 5 | cmd.do('util.cbaw;') 6 | cmd.do('bg white;') 7 | cmd.do('gscale();') 8 | cmd.do('set light_count,10;') 9 | cmd.do('set spec_count,1;') 10 | cmd.do('set shininess, 10;') 11 | cmd.do('set specular,0.25;') 12 | cmd.do('set ambient,0;') 13 | cmd.do('set direct,0;') 14 | cmd.do('set reflect,1.5;') 15 | cmd.do('set ray_shadow_decay_factor, 0.1;') 16 | cmd.do('set ray_shadow_decay_range, 2;') 17 | cmd.do('set depth_cue, 0;') 18 | cmd.do('ray;') 19 | -------------------------------------------------------------------------------- /MolecularRepresentation/bs.py: -------------------------------------------------------------------------------- 1 | cmd.do('show sticks;') 2 | cmd.do('set stick_radius, 0.12;') 3 | cmd.do('set stick_ball, on;') 4 | cmd.do('set stick_ball_ratio, 1.9;') 5 | cmd.do('show nb_spheres;') 6 | cmd.do('set nb_spheres_size=0.33;') 7 | -------------------------------------------------------------------------------- /MolecularRepresentation/bsfr.py: -------------------------------------------------------------------------------- 1 | cmd.do('# Edit the selection that is named ligand here.;') 2 | cmd.do('create ligand, /bluComplex/C/A/1101;') 3 | cmd.do('preset.ball_and_stick(selection="ligand");') 4 | cmd.do('util.cbaw ligand;') 5 | cmd.do('set stick_color, white, ligand;') 6 | cmd.do('set valence, off, ligand;') 7 | cmd.do('unset valence;') 8 | cmd.do('# above command is required after using preset;') 9 | cmd.do('set sphere_color, black, elem C and ligand;') 10 | cmd.do('set sphere_color, red, elem O and ligand;') 11 | cmd.do('set sphere_color, blue, elem N and ligand;') 12 | cmd.do('set sphere_color, lightblue, elem F and ligand;') 13 | cmd.do('set stick_radius, 0.12;') 14 | cmd.do('set sphere_quality, 4;') 15 | cmd.do('set cartoon_ring_finder, 4, ligand;') 16 | cmd.do('set cartoon_ring_mode, 3, ligand;') 17 | cmd.do('set cartoon_ring_width, 0.12, ligand;') 18 | cmd.do('set cartoon_ring_transparency, .0, ligand;') 19 | cmd.do('show cartoon, ligand;') 20 | -------------------------------------------------------------------------------- /MolecularRepresentation/bu.py: -------------------------------------------------------------------------------- 1 | cmd.do('# Edit the path to the file quat.py.;') 2 | cmd.do('# You may have to download it from the PyMOL Wiki page.;') 3 | cmd.do('run ~/Scripts/PyMOLScripts/quat.py; quat;') 4 | -------------------------------------------------------------------------------- /MolecularRepresentation/coordinate.py: -------------------------------------------------------------------------------- 1 | cmd.do('viewport 900,600;') 2 | cmd.do('fetch 3nd4, type=pdb, async=0;') 3 | cmd.do('run ~/Scripts/PyMOLScripts/quat.py;') 4 | cmd.do('quat 3nd4;') 5 | cmd.do('show sticks;') 6 | cmd.do('set stick_radius=0.125;') 7 | cmd.do('hide everything, name H*;') 8 | cmd.do('bg_color white;') 9 | cmd.do('create coorCov, (3nd4_1 and (resi 19 or resi 119 or resi 219 or resi 319 or resi 419 or resi 519 or (resi 3 and name N7)));') 10 | cmd.do('bond (coorCov//A/NA`19/NA),(coorCov//A/A`3/N7);') 11 | cmd.do('bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`119/O);') 12 | cmd.do('bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`219/O);') 13 | cmd.do('bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`319/O);') 14 | cmd.do('bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`519/O);') 15 | cmd.do('distance (3nd4_1 and chain Aand resi 19 and name NA), (3nd4_1 and chain A and resi 519);') 16 | cmd.do('distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 419);') 17 | cmd.do('distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 319);') 18 | cmd.do('distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 219);') 19 | cmd.do('show nb_spheres; ') 20 | cmd.do('set nb_spheres_size, .35;') 21 | cmd.do('distance hbond1,/3nd4_1/1/A/HOH`119/O, /3nd4_1/1/A/A`3/OP2;') 22 | cmd.do('distance hbond2,/3nd4_1/1/A/HOH`319/O, /3nd4_1/1/A/A`3/OP2;') 23 | cmd.do('distance hbond3,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/HOH`119/O;') 24 | cmd.do('distance hbond4,/3nd4_1/1/A/G`4/N7,/3nd4_1/1/A/HOH`91/O;') 25 | cmd.do('distance hbond5,/3nd4_1/1/A/G`4/O6, /3nd4_1/1/A/HOH`419/O;') 26 | cmd.do('distance hbond6,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2;') 27 | cmd.do('distance hbond7,/3nd4_1/1/A/HOH`319/O,/3nd4_1/1/A/G`2/OP2;') 28 | cmd.do('distance hbond9,/3nd4_1/1/A/HOH`419/O,/3nd4_2/2/A/HOH`74/O;') 29 | cmd.do('distance hbond10,/3nd4_2/2/A/C`15/O2,/3nd4_1/1/A/G`2/N2;') 30 | cmd.do('distance hbond11, /3nd4_2/2/A/C`15/N3,/3nd4_1/1/A/G`2/N1;') 31 | cmd.do('distance hbond12,/3nd4_2/2/A/C`15/N4,/3nd4_1/1/A/G`2/O6;') 32 | cmd.do('distance hbond13, /3nd4_2/2/A/U`14/N3,/3nd4_1/1/A/A`3/N1;') 33 | cmd.do('distance hbond14,3nd4_2/2/A/U`14/O4,/3nd4_1/1/A/A`3/N6;') 34 | cmd.do('distance hbond15, /3nd4_2/2/A/C`13/N4,/3nd4_1/1/A/G`4/O6;') 35 | cmd.do(' distance hbond16,/3nd4_2/2/A/C`13/N3, /3nd4_1/1/A/G`4/N1;') 36 | cmd.do('distance hbond17, /3nd4_1/1/A/G`4/N2,/3nd4_2/2/A/C`13/O2;') 37 | cmd.do('distance hbond18,/3nd4_1/1/A/G`2/N2,/3nd4_2/2/A/C`15/O2;') 38 | cmd.do('distance hbond19,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2; ') 39 | cmd.do('set depth_cue=0;') 40 | cmd.do('set ray_trace_fog=0;') 41 | cmd.do('set dash_color, black;') 42 | cmd.do('set label_font_id, 5;') 43 | cmd.do('set label_size, 36;') 44 | cmd.do('set label_position, (0.5, 1.0, 2.0);') 45 | cmd.do('set label_color, black;') 46 | cmd.do('set dash_gap, 0.2;') 47 | cmd.do('set dash_width, 2.0;') 48 | cmd.do('set dash_length, 0.2;') 49 | cmd.do('set label_color, black;') 50 | cmd.do('set dash_gap, 0.2;') 51 | cmd.do('set dash_width, 2.0;') 52 | cmd.do('set dash_length, 0.2;') 53 | cmd.do('select carbon, element C;') 54 | cmd.do('color yellow, carbon;') 55 | cmd.do('disable carbon;') 56 | cmd.do('set_view(-0.9,0.34,-0.26,0.33,0.18,-0.93,-0.27,-0.92,-0.28,-0.07,-0.23,-27.83,8.63,19.85,13.2,16.0,31.63,-20.0)') 57 | -------------------------------------------------------------------------------- /MolecularRepresentation/cspheres.py: -------------------------------------------------------------------------------- 1 | cmd.do('as spheres;') 2 | cmd.do('color gray30, chain A;') 3 | cmd.do('color white, chain B;') 4 | cmd.do('color green, name CL;') 5 | cmd.do('color brown, resn NAG;') 6 | cmd.do('color red, resi 381;') 7 | cmd.do('remove solvent;') 8 | cmd.do('set specular, 0;') 9 | cmd.do('set ray_trace_gain, 0;') 10 | cmd.do('set ray_trace_mode, 3;') 11 | cmd.do('bg_color white;') 12 | cmd.do('set ray_trace_color, black;') 13 | cmd.do('set depth_cue,0;') 14 | -------------------------------------------------------------------------------- /MolecularRepresentation/discreteCartoonColoring.py: -------------------------------------------------------------------------------- 1 | cmd.do('set cartoon_discrete_colors, on;') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/doubleBond.py: -------------------------------------------------------------------------------- 1 | cmd.do('set valence, 1; ') 2 | cmd.do('set valence_mode, 1;') 3 | -------------------------------------------------------------------------------- /MolecularRepresentation/drawLinks.py: -------------------------------------------------------------------------------- 1 | cmd.do('draw_links mol1 & chain A & name CA & resi 1+6+7+8, mol1 & chain A& name CA & resi 10+16+17+18;') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/ellipcol.py: -------------------------------------------------------------------------------- 1 | cmd.do('set ellipsoid_color, red;') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/filledRing.py: -------------------------------------------------------------------------------- 1 | cmd.do('show sticks;set cartoon_ring_mode, 3;') 2 | cmd.do('set cartoon_ring_finder, 1;') 3 | cmd.do('set cartoon_ladder_mode, 1;') 4 | cmd.do('set cartoon_nucleic_acid_mode, 4;') 5 | cmd.do('set cartoon_ring_transparency, 0.5;') 6 | cmd.do('as cartoon;') 7 | -------------------------------------------------------------------------------- /MolecularRepresentation/fog.py: -------------------------------------------------------------------------------- 1 | cmd.do('set fog, 0;') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/grayscalepy.py: -------------------------------------------------------------------------------- 1 | def grayscale(selection="all"): 2 | """Apply by entering grayscale()""" 3 | cmd.color("grey64", "elem Ac") 4 | cmd.color("grey67", "elem Al") 5 | cmd.color("grey39", "elem Am") 6 | cmd.color("grey46", "elem Sb") 7 | cmd.color("grey75", "elem Ar") 8 | cmd.color("grey58", "elem As") 9 | cmd.color("grey33", "elem At") 10 | cmd.color("grey56", "elem Ba") 11 | cmd.color("grey40", "elem Bk") 12 | cmd.color("grey87", "elem Be") 13 | cmd.color("grey40", "elem Bi") 14 | cmd.color("grey20", "elem Bh") 15 | cmd.color("grey77", "elem B") 16 | cmd.color("grey26", "elem Br") 17 | cmd.color("grey86", "elem Cd") 18 | cmd.color("grey76", "elem Ca") 19 | cmd.color("grey34", "elem Cf") 20 | cmd.color("grey77", "elem C") 21 | cmd.color("grey98", "elem Ce") 22 | cmd.color("grey17", "elem Cs") 23 | cmd.color("grey70", "elem Cl") 24 | cmd.color("grey60", "elem Cr") 25 | cmd.color("grey64", "elem Co") 26 | cmd.color("grey54", "elem Cu") 27 | cmd.color("grey42", "elem Cm") 28 | cmd.color("grey89", "elem D") 29 | cmd.color("grey19", "elem Db") 30 | cmd.color("grey79", "elem Dy") 31 | cmd.color("grey29", "elem Es") 32 | cmd.color("grey67", "elem Er") 33 | cmd.color("grey85", "elem Eu") 34 | cmd.color("grey28", "elem Fm") 35 | cmd.color("grey93", "elem F") 36 | cmd.color("grey8", "elem Fr") 37 | cmd.color("grey82", "elem Gd") 38 | cmd.color("grey60", "elem Ga") 39 | cmd.color("grey52", "elem Ge") 40 | cmd.color("grey80", "elem Au") 41 | cmd.color("grey68", "elem Hf") 42 | cmd.color("grey20", "elem Hs") 43 | cmd.color("grey96", "elem He") 44 | cmd.color("grey75", "elem Ho") 45 | cmd.color("grey89", "elem H") 46 | cmd.color("grey49", "elem In") 47 | cmd.color("grey16", "elem I") 48 | cmd.color("grey29", "elem Ir") 49 | cmd.color("grey48", "elem Fe") 50 | cmd.color("grey65", "elem Kr") 51 | cmd.color("grey76", "elem La") 52 | cmd.color("grey19", "elem Lr") 53 | cmd.color("grey34", "elem Pb") 54 | cmd.color("grey60", "elem Li") 55 | cmd.color("grey48", "elem Lu") 56 | cmd.color("grey83", "elem Mg") 57 | cmd.color("grey52", "elem Mn") 58 | cmd.color("grey20", "elem Mt") 59 | cmd.color("grey23", "elem Md") 60 | cmd.color("grey72", "elem Hg") 61 | cmd.color("grey62", "elem Mo") 62 | cmd.color("grey93", "elem Nd") 63 | cmd.color("grey85", "elem Ne") 64 | cmd.color("grey43", "elem Np") 65 | cmd.color("grey67", "elem Ni") 66 | cmd.color("grey69", "elem Nb") 67 | cmd.color("grey25", "elem N") 68 | cmd.color("grey23", "elem No") 69 | cmd.color("grey36", "elem Os") 70 | cmd.color("grey44", "elem O") 71 | cmd.color("grey33", "elem Pd") 72 | cmd.color("grey57", "elem P") 73 | cmd.color("grey82", "elem Pt") 74 | cmd.color("grey37", "elem Pu") 75 | cmd.color("grey40", "elem Po") 76 | cmd.color("grey35", "elem K") 77 | cmd.color("grey95", "elem Pr") 78 | cmd.color("grey90", "elem Pm") 79 | cmd.color("grey52", "elem Pa") 80 | cmd.color("grey35", "elem Ra") 81 | cmd.color("grey46", "elem Rn") 82 | cmd.color("grey43", "elem Re") 83 | cmd.color("grey39", "elem Rh") 84 | cmd.color("grey27", "elem Rb") 85 | cmd.color("grey47", "elem Ru") 86 | cmd.color("grey19", "elem Rf") 87 | cmd.color("grey89", "elem Sm") 88 | cmd.color("grey90", "elem Sc") 89 | cmd.color("grey20", "elem Sg") 90 | cmd.color("grey66", "elem Se") 91 | cmd.color("grey80", "elem Si") 92 | cmd.color("grey75", "elem Ag") 93 | cmd.color("grey46", "elem Na") 94 | cmd.color("grey71", "elem Sr") 95 | cmd.color("grey76", "elem S") 96 | cmd.color("grey60", "elem Ta") 97 | cmd.color("grey53", "elem Tc") 98 | cmd.color("grey51", "elem Te") 99 | cmd.color("grey81", "elem Tb") 100 | cmd.color("grey39", "elem Tl") 101 | cmd.color("grey59", "elem Th") 102 | cmd.color("grey61", "elem Tm") 103 | cmd.color("grey48", "elem Sn") 104 | cmd.color("grey75", "elem Ti") 105 | cmd.color("grey50", "elem W") 106 | cmd.color("grey47", "elem U") 107 | cmd.color("grey65", "elem V") 108 | cmd.color("grey54", "elem Xe") 109 | cmd.color("grey55", "elem Yb") 110 | cmd.color("grey91", "elem Y") 111 | cmd.color("grey51", "elem Zn") 112 | cmd.color("grey81", "elem Zr") 113 | cmd.extend("grayscale",grayscale) 114 | -------------------------------------------------------------------------------- /MolecularRepresentation/his31asp70.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 1lw9, async=0; ') 2 | cmd.do('zoom (resi 31 or resi 70); ') 3 | cmd.do('preset.technical(selection='all'); ') 4 | cmd.do('bg_color gray70; ') 5 | cmd.do('clip slab, 7,(resi 31 or resi 70);') 6 | cmd.do('rock;') 7 | -------------------------------------------------------------------------------- /MolecularRepresentation/loadPDBbs.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 3nd3,name=3nd3, type=pdb, async=0;') 2 | cmd.do('hide (name H*);') 3 | cmd.do('hide lines;') 4 | cmd.do('show sticks;') 5 | cmd.do('set stick_radius, 1.2;') 6 | cmd.do('set nb_sphere_radius, 0.35;') 7 | cmd.do('orient;') 8 | -------------------------------------------------------------------------------- /MolecularRepresentation/loadPDBnb.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 3nd3, name=3nd3, type=pdb, async=0;') 2 | cmd.do('orient;') 3 | cmd.do('set stick_radius, 1.2;') 4 | cmd.do('hide (name H*);') 5 | cmd.do('set nb_sphere_size, 0.35;') 6 | cmd.do('set nb_spheres_quality, 1;') 7 | cmd.do('show nb_spheres;') 8 | -------------------------------------------------------------------------------- /MolecularRepresentation/molscriptRibbon.py: -------------------------------------------------------------------------------- 1 | cmd.do('set cartoon_highlight_color, grey;') 2 | cmd.do('show cartoon;') 3 | cmd.do('set cartoon_flat_sheets, 0;') 4 | cmd.do('set cartoon_smooth_loops, 0;') 5 | cmd.do('set cartoon_fancy_helices, 1;') 6 | -------------------------------------------------------------------------------- /MolecularRepresentation/oneBondThicknessColor.py: -------------------------------------------------------------------------------- 1 | cmd.do('set_bond stick_color, yellow, index 2, index 3;') 2 | cmd.do('set_bond stick_radius, 0.2, index 2, index 3;') 3 | -------------------------------------------------------------------------------- /MolecularRepresentation/pearl.py: -------------------------------------------------------------------------------- 1 | cmd.do('create sodium2, sodium1;') 2 | cmd.do('set sphere_transparency, 0.4, sodium2;') 3 | cmd.do('set sphere_scale, 1.05, sodium2;') 4 | cmd.do('ray;') 5 | -------------------------------------------------------------------------------- /MolecularRepresentation/puttyCartoon.py: -------------------------------------------------------------------------------- 1 | cmd.do('show cartoon;') 2 | cmd.do('cartoon putty;') 3 | cmd.do('set cartoon_smooth_loops, 0;') 4 | cmd.do('# The command below may be needed if the above setting does not work.') 5 | cmd.do('# This can happen if using the presets.') 6 | cmd.do('# unset cartoon_smooth_loops; ') 7 | cmd.do('set cartoon_flat_sheets, 0;') 8 | cmd.do('# The command below may be needed if the above setting does not work.') 9 | cmd.do('# This can happen if using the presets.') 10 | cmd.do('# unset cartoon_smooth_loops; ') 11 | cmd.do('set cartoon_smooth_loops,0;') 12 | cmd.do('# The command below may be needed if the above setting does not work.') 13 | cmd.do('# This can happen if using the presets.') 14 | cmd.do('## unset cartoon_smooth_loops;') 15 | -------------------------------------------------------------------------------- /MolecularRepresentation/ringMode.py: -------------------------------------------------------------------------------- 1 | cmd.do('show cartoon, rna; set cartoon_ring_mode, 3;') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/rmwater.py: -------------------------------------------------------------------------------- 1 | cmd.do('remove resn HOH;') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/sas.py: -------------------------------------------------------------------------------- 1 | cmd.do('set surface_solvent, on') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/saxsEnvelope.py: -------------------------------------------------------------------------------- 1 | cmd.do('alter refine_A_Ave_SM_015_0_370-374-0r, vdw=3.0;') 2 | cmd.do('set solvent_radius = 3.0;') 3 | -------------------------------------------------------------------------------- /MolecularRepresentation/scaleRadiusColor.py: -------------------------------------------------------------------------------- 1 | cmd.do('bg_color white;') 2 | cmd.do('hide everything;') 3 | cmd.do('show spheres;') 4 | cmd.do('set stick_radius = 0.1;') 5 | cmd.do('hide everything, HET;') 6 | cmd.do('show spheres, HET;') 7 | cmd.do('set sphere_quality=3;') 8 | cmd.do('show sticks, resi 1102;') 9 | cmd.do('from pymol import stored;') 10 | cmd.do('# set the stored array equal to the b−values or use your own values; ') 11 | cmd.do('stored.bb = [ ];') 12 | cmd.do('iterate all, stored.bb.append(b);') 13 | cmd.do('# execute a python−block;') 14 | cmd.do('python;') 15 | cmd.do('# scale the b−values;') 16 | cmd.do('M = max(stored.bb);') 17 | cmd.do('scaledBB = map(lambda x: float (x/M), stored.bb);') 18 | cmd.do('count = 0;') 19 | cmd.do('# set the sphere radii independently;') 20 | cmd.do('#[(cmd.set("sphere_scale", x ,"ID %s"%count); count = count + 1) for x in scaledBB];') 21 | cmd.do('for x in scaledBB:') 22 | cmd.do(' cmd.set("sphere_scale", x ,"ID %s"%count)') 23 | cmd.do(' count = count + 1') 24 | cmd.do('python end;') 25 | cmd.do('spectrum b, selection=4gdx;') 26 | cmd.do('space cmyk;') 27 | cmd.do('set specular_intensity , 0.25;') 28 | -------------------------------------------------------------------------------- /MolecularRepresentation/scaleRadiusColorPythonInsertpy.py: -------------------------------------------------------------------------------- 1 | # scale the b−values; 2 | M = max(stored.bb); 3 | scaledBB = map(lambda x: float (x/M), stored.bb); 4 | count = 0; 5 | # set the sphere radii independently; 6 | #[(cmd.set("sphere_scale", x ,"ID %s"%count); count = count + 1) for x in scaledBB] 7 | for x in scaledBB: 8 | cmd.set("sphere_scale", x ,"ID %s"%count) 9 | count = count + 1 10 | -------------------------------------------------------------------------------- /MolecularRepresentation/scaleRadiusColorpy.py: -------------------------------------------------------------------------------- 1 | cmd.do("bg_color white;") 2 | cmd.do("hide everything;") 3 | cmd.do("show spheres;") 4 | cmd.do("set stick_radius = 0.1;") 5 | cmd.do("hide everything, HET;") 6 | cmd.do("show spheres, HET;") 7 | cmd.do("set sphere_quality=3;") 8 | cmd.do("show sticks, resi 1102;") 9 | cmd.do("from pymol import stored;") 10 | cmd.do("# set the stored array equal to the b−values or use your own values; ") 11 | cmd.do("stored.bb = [ ];") 12 | cmd.do("iterate all, stored.bb.append(b);") 13 | # scale the b−values; 14 | cmd.do("M = max(stored.bb);") 15 | cmd.do("scaledBB = map(lambda x: float (x/M), stored.bb);") 16 | count = 0; 17 | # set the sphere radii independently; 18 | for x in scaledBB: 19 | cmd.set("sphere_scale", x ,"ID %s"%count) 20 | count = count + 1 21 | cmd.do("spectrum b, selection=4gdx;") 22 | cmd.do("space cmyk;") 23 | cmd.do("set specular_intensity , 0.25;") 24 | -------------------------------------------------------------------------------- /MolecularRepresentation/setLigandValenceOn.py: -------------------------------------------------------------------------------- 1 | cmd.do('set valence, on, resn RZS; set valence, off, not resn RZS;') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/setcolor.py: -------------------------------------------------------------------------------- 1 | cmd.do('set_color bark, [0.1, 0.1, 0.1];') 2 | cmd.do('color bark, protein;') 3 | -------------------------------------------------------------------------------- /MolecularRepresentation/sidehChainHelper.py: -------------------------------------------------------------------------------- 1 | cmd.do('set cartoon_side_chain_helper, on;') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/solventRadius.py: -------------------------------------------------------------------------------- 1 | cmd.do('set solvent_radius, 1.55;') 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/stack.py: -------------------------------------------------------------------------------- 1 | cmd.do('delete all;') 2 | cmd.do('fetch 4PCO, type=pdb,async=0;') 3 | cmd.do('select G2G3, ( ((resi 2 or resi 3) and chain A) or ((resi 8 or resi 9) and chain B) );') 4 | cmd.do('hide everything, element h; ') 5 | cmd.do('remove not G2G3;') 6 | cmd.do('bg_color white;') 7 | cmd.do('show sticks;') 8 | cmd.do('set stick_radius=0.14;') 9 | cmd.do('set stick_ball, on; ') 10 | cmd.do('set stick_ball_ratio,1.9;') 11 | cmd.do('set_view (-0.75,0.09,0.66,-0.2,0.92,-0.35,-0.64,-0.39,-0.67,-0.0,-0.0,-43.7,7. 24,9.55,11.78,29.46,57.91,-20.0);') 12 | cmd.do('hide everything, element H;') 13 | cmd.do('select carbon1, element C and (resi 3 or resi 8); ') 14 | cmd.do('# select lower base pair;') 15 | cmd.do('select carbon2, element C and (resi 2 or resi 9);') 16 | cmd.do('#select upper base pair;') 17 | cmd.do('color gray70,carbon1;') 18 | cmd.do('color gray10,carbon2;') 19 | cmd.do('space cmyk;') 20 | cmd.do('distance hbond1,/4PCO//B/U`9/N3,/4PCO//A/G`2/O6;') 21 | cmd.do('distance hbond2,/4PCO//B/U`9/O2,/4PCO//A/G`2/N1;') 22 | cmd.do('distance hbond3,/4PCO//A/U`3/N3,/4PCO//B/G`8/O6;') 23 | cmd.do('distance hbond4,/4PCO//A/U`3/O2,/4PCO//B/G`8/N1;') 24 | cmd.do('color black, hbond1;') 25 | cmd.do('color black, hbond2;') 26 | cmd.do('color gray70, hbond3;') 27 | cmd.do('color gray70, hbond4;') 28 | cmd.do('show nb_spheres;') 29 | cmd.do('set nb_spheres_size, 0.35;') 30 | cmd.do('hide labels;') 31 | cmd.do('ray 1600,1000;') 32 | cmd.do('png 4PCO.png') 33 | -------------------------------------------------------------------------------- /MolecularRepresentation/stateOne.py: -------------------------------------------------------------------------------- 1 | cmd.create("newobject", "oldobject", "1", "1"); 2 | -------------------------------------------------------------------------------- /MolecularRepresentation/waterTriple.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch lw9, async=0; ') 2 | cmd.do('zoom resi 313; ') 3 | cmd.do('preset.technical(selection="all", mode=1);') 4 | -------------------------------------------------------------------------------- /NucleicAcids/basePairStacking.py: -------------------------------------------------------------------------------- 1 | cmd.do('delete all;') 2 | cmd.do('fetch 4PCO, type=pdb, async=0;') 3 | cmd.do('select G2G3, ( ((resi 2 or resi 3) and chain A) or ((resi 8 or resi 9) and chain B));') 4 | cmd.do('remove not G2G3;') 5 | cmd.do('bg_color white;') 6 | cmd.do('show sticks;') 7 | cmd.do('set stick_radius=0.14;') 8 | cmd.do('set stick_ball, on; ') 9 | cmd.do('set stick_ball_ratio,1.9;') 10 | cmd.do('set_view (-0.75,0.09,0.66,-0.2,0.92,-0.35,-0.64,-0.39,-0.67,-0.0,-0.0,-43.7,7.24,9.55,11.78,29.46,57.91,-20.0);') 11 | cmd.do('remove name H*;') 12 | cmd.do('select carbon1, element C and (resi 3 or resi 8) ') 13 | cmd.do('# select lower base pair;') 14 | cmd.do('select carbon2, element C and (resi 2 or resi 9) ') 15 | cmd.do('#select upper base pair;') 16 | cmd.do('color gray70, carbon1;') 17 | cmd.do('color gray10, carbon2;') 18 | cmd.do('show sticks;') 19 | cmd.do('space cmyk;') 20 | cmd.do('distance hbond1, /4PCO//B/U`9/N3,/4PCO//A/G`2/O6;') 21 | cmd.do('distance hbond2, /4PCO//B/U`9/O2,/4PCO//A/G`2/N1;') 22 | cmd.do('distance hbond3, /4PCO//A/U`3/N3,/4PCO//B/G`8/O6;') 23 | cmd.do('distance hbond4, /4PCO//A/U`3/O2,/4PCO//B/G`8/N1;') 24 | cmd.do('color black, hbond1;') 25 | cmd.do('color black, hbond2;') 26 | cmd.do('color gray70, hbond3;') 27 | cmd.do('color gray70, hbond4;') 28 | cmd.do('show nb_spheres;') 29 | cmd.do('set nb_spheres_size, 0.35;') 30 | cmd.do('hide labels;') 31 | cmd.do('ray 1600,1000;') 32 | cmd.do('png 4PCO.png;') 33 | -------------------------------------------------------------------------------- /NucleicAcids/brokenNucleicBackbone.py: -------------------------------------------------------------------------------- 1 | [cmd.bond(f"/5fur//E/{i/O3"", f"/5fur//E/{i+1/P") for i in range(1, 80)]; 2 | [cmd.bond(f"/5fur//F/{i/O3"", f"/5fur//F/{i+1/P") for i in range(81, 160)]; 3 | -------------------------------------------------------------------------------- /NucleicAcids/dssrBlock1.py: -------------------------------------------------------------------------------- 1 | cmd.do('reinitialize;') 2 | cmd.do('run /Users/blaine/.pymol/startup/dssr_block.py;') 3 | cmd.do('fetch 1ehz, async=0;') 4 | cmd.do('as cartoon;') 5 | cmd.do('set cartoon_ladder_radius, 0.1;') 6 | cmd.do('set cartoon_ladder_color, gray;') 7 | cmd.do('set cartoon_nucleic_acid_mode, 1;') 8 | cmd.do('set cartoon_nucleic_acid_color, orange;') 9 | cmd.do('orient;turn z,30; translate [0,5,0]') 10 | cmd.do('dssr_block;') 11 | cmd.do('png ~/dssrBlock1.png 1600,1600') 12 | -------------------------------------------------------------------------------- /NucleicAcids/dssrBlock2.py: -------------------------------------------------------------------------------- 1 | cmd.do('reinitialize;') 2 | cmd.do('run /Users/blaine/.pymol/startup/dssr_block.py;') 3 | cmd.do('set cartoon_nucleic_acid_color, orange;') 4 | cmd.do('fetch 1ehz, async=0;') 5 | cmd.do('dssr_block block_file=wc') 6 | -------------------------------------------------------------------------------- /NucleicAcids/dssrBlock3.py: -------------------------------------------------------------------------------- 1 | cmd.do('reinitialize;') 2 | cmd.do('run "/Users/blaine/.pymol/startup/dssr_block.py";') 3 | cmd.do('fetch 2n2d, async=0;') 4 | cmd.do('dssr_block 2n2d, 0;') 5 | cmd.do('set all_states;') 6 | -------------------------------------------------------------------------------- /NucleicAcids/dssrBlock4.py: -------------------------------------------------------------------------------- 1 | cmd.do('reinitialize;') 2 | cmd.do('run /Users/blaine/.pymol/startup/dssr_block.py;') 3 | cmd.do('fetch 1msy, async=0;') 4 | cmd.do('set cartoon_nucleic_acid_color, orange;') 5 | cmd.do('dssr_block block_color=N red | minor 0.9 | major yellow;') 6 | -------------------------------------------------------------------------------- /NucleicAcids/nucleicAcidBackboneTubesSticks.py: -------------------------------------------------------------------------------- 1 | cmd.do('set bg_rgb, white;') 2 | cmd.do('hide everything, all;') 3 | cmd.do('# Change to the name of your molecular object.;') 4 | cmd.do('show cartoon, 3nd3;') 5 | cmd.do('set cartoon_sampling,1;') 6 | cmd.do('set cartoon_tube_radius, 0.5;') 7 | cmd.do('set cartoon_ladder_mode, 0;') 8 | cmd.do('# Set to 0.0 to turn off transparency;') 9 | cmd.do('set cartoon_transparency, 0.65;') 10 | cmd.do('# The default strick radisu is 0.25. I think it is too thick.;') 11 | cmd.do('set stick_radius 0.12;') 12 | cmd.do('show sticks;') 13 | cmd.do('hide sticks, element H;') 14 | -------------------------------------------------------------------------------- /NucleicAcids/nucleicAcidCartoon.py: -------------------------------------------------------------------------------- 1 | cmd.do('set cartoon_ladder_radius, 0.2;') 2 | cmd.do('set cartoon_nucleic_acid_color, red;') 3 | cmd.do('# The cartoon ring modes range from 0 to 4.;') 4 | cmd.do('set cartoon_ring_mode, 2;') 5 | -------------------------------------------------------------------------------- /NucleicAcids/nucleicAcidCartoon2Strands.py: -------------------------------------------------------------------------------- 1 | cmd.do('fetch 3nd3, 3nd3, type=pdb1;') 2 | cmd.do('set all_states, on;') 3 | cmd.do('create chA, 3nd3, 1, 1;') 4 | cmd.do('create chB, 3nd3, 2, 1;') 5 | cmd.do('# colors only the backbone;') 6 | cmd.do('set cartoon_nucleic_acid_color, magenta, chA;') 7 | cmd.do('set cartoon_nucleic_acid_color, orange, chB;') 8 | cmd.do('# color the bases;') 9 | cmd.do('set cartoon_ladder_color, density, chA;') 10 | cmd.do('set cartoon_ladder_color, yellow, chB;') 11 | -------------------------------------------------------------------------------- /NucleicAcids/nucleicAcidCartoonFilledRings.py: -------------------------------------------------------------------------------- 1 | cmd.do('bg_color white;') 2 | cmd.do('show sticks;') 3 | cmd.do('set cartoon_ring_mode, 3;') 4 | cmd.do('set cartoon_ring_finder, 1;') 5 | cmd.do('set cartoon_ladder_mode, 1;') 6 | cmd.do('set cartoon_nucleic_acid_mode, 4;') 7 | cmd.do('set cartoon_ring_transparency, 0.5;') 8 | cmd.do('as cartoon;') 9 | -------------------------------------------------------------------------------- /NucleicAcids/nucleicAcidColorbySequence.py: -------------------------------------------------------------------------------- 1 | cmd.do('select rna_A, resn A;') 2 | cmd.do('select rna_C, resn C;') 3 | cmd.do('select rna_G, resn G;') 4 | cmd.do('select rna_U, resn U;') 5 | cmd.do('select dna_T, resn T;') 6 | cmd.do('color yellow, rna_A;') 7 | cmd.do('color red, rna_C; ') 8 | cmd.do('color gray40, rna_G;') 9 | cmd.do('color palecyan, rna_U;') 10 | cmd.do('color brown, dna_T;') 11 | -------------------------------------------------------------------------------- /NucleicAcids/nucleicAcidDumbellCartoonColorbySequence.py: -------------------------------------------------------------------------------- 1 | cmd.do('bg_color white;') 2 | cmd.do('set cartoon_oval_length, 1.85') 3 | cmd.do('set cartoon_oval_width, 0.5') 4 | cmd.do('cartoon oval;') 5 | cmd.do('cartoon dumbbell;') 6 | cmd.do('set cartoon_dumbbell_width, 0.2;') 7 | cmd.do('set cartoon_dumbbell_radius, 0.4;') 8 | cmd.do('set cartoon_ring_mode, 3;') 9 | cmd.do('# set the color of the backbone oval') 10 | cmd.do('set cartoon_nucleic_acid_color, blue;') 11 | cmd.do('select rna_A, resn A;') 12 | cmd.do('select rna_C, resn C;') 13 | cmd.do('select rna_G, resn G;') 14 | cmd.do('select rna_U, resn U;') 15 | cmd.do('select dna_T, resn T;') 16 | cmd.do('color yellow, rna_A;') 17 | cmd.do('color red, rna_C; ') 18 | cmd.do('color gray40, rna_G;') 19 | cmd.do('color palecyan, rna_U;') 20 | cmd.do('color brown, dna_T;') 21 | cmd.do('as cartoon;') 22 | -------------------------------------------------------------------------------- /NucleicAcids/nucleicAcidFlatRibbonColorbySequence.py: -------------------------------------------------------------------------------- 1 | cmd.do('bg_color white;') 2 | cmd.do('set cartoon_oval_length, 1.85;') 3 | cmd.do('set cartoon_oval_width, 0.5;') 4 | cmd.do('cartoon oval;') 5 | cmd.do('set cartoon_ring_mode, 3;') 6 | cmd.do('# set the color of the backbone oval;') 7 | cmd.do('set cartoon_nucleic_acid_color, blue;') 8 | cmd.do('select rna_A, resn A;') 9 | cmd.do('select rna_C, resn C;') 10 | cmd.do('select rna_G, resn G;') 11 | cmd.do('select rna_U, resn U;') 12 | cmd.do('select dna_T, resn T;') 13 | cmd.do('color yellow, rna_A;') 14 | cmd.do('color red, rna_C; ') 15 | cmd.do('color gray40, rna_G;') 16 | cmd.do('color palecyan, rna_U;') 17 | cmd.do('color brown, dna_T;') 18 | cmd.do('as cartoon;') 19 | -------------------------------------------------------------------------------- /Objects/allPairs.py: -------------------------------------------------------------------------------- 1 | [[optAlignRNA(x, y) for x in cmd.get_names()] for y in cmd.get_names()]; 2 | -------------------------------------------------------------------------------- /Objects/listObjects.py: -------------------------------------------------------------------------------- 1 | cmd.do('objList = cmd.get_names("objects");print(objList);') 2 | -------------------------------------------------------------------------------- /Objects/loadAndAlignManyFiles1.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2004 Robert L. Campbell 2 | # 3 | # Modified for use with Python3. 4 | # Jan. 29, 2020 5 | # Blaine Mooers, PhD 6 | # Univ. of Oklahoma Health Sciences Center 7 | # 8 | # 9 | from pymol import cmd 10 | import glob 11 | 12 | def loadFiles(files): 13 | """ 14 | load_files 15 | 16 | loads multiple files (using filename globbing) 17 | into a multiple objects named as the files are (e.g. collection of 18 | downloaded PDB files). 19 | 20 | e.g. load_files prot_*.pdb 21 | """ 22 | file_list = glob.glob(files) 23 | if file_list: 24 | file_list.sort() 25 | for i in file_list: 26 | #obj_name = i.replace('.pdb','') 27 | #cmd.load(file_list[i],obj_name) 28 | cmd.load(i) 29 | else: 30 | print("No files found for pattern %s" % files) 31 | 32 | cmd.extend('loadFiles',loadFiles) 33 | 34 | -------------------------------------------------------------------------------- /Objects/loadAndAlignManyFiles2.py: -------------------------------------------------------------------------------- 1 | cmd.do('# Yes, this construct is a list comprehension inside a list comprehension!;') 2 | cmd.do('run ~/Scripts/optAlignRNA.py;') 3 | cmd.do('[[optAlignRNA(x, y) for x in cmd.get_names()] for y in cmd.get_names()];') 4 | -------------------------------------------------------------------------------- /Objects/loadAndAlignManyFiles3.py: -------------------------------------------------------------------------------- 1 | cmd.do('from pymol import cmd') 2 | cmd.do('import glob') 3 | cmd.do('import re') 4 | cmd.do('') 5 | cmd.do('') 6 | cmd.do('def saveSep(prefix=''):') 7 | cmd.do(' """') 8 | cmd.do(' Saves multiple objects into multiple files using an optional prefix name.') 9 | cmd.do(' This function is can save time.') 10 | cmd.do(' ') 11 | cmd.do(' Usage in PyMOL:') 12 | cmd.do(' ') 13 | cmd.do(' saveSep ') 14 | cmd.do(' ') 15 | cmd.do(' Usage in pymol's Python API:') 16 | cmd.do(' ') 17 | cmd.do(' cmd.do("saveSep ")') 18 | cmd.do(' ') 19 | cmd.do('') 20 | cmd.do(' e.g. saveSep prefix') 21 | cmd.do(' """') 22 | cmd.do(' obj_list = cmd.get_names("all")') 23 | cmd.do('') 24 | cmd.do(' if obj_list:') 25 | cmd.do(' for i in range(len(obj_list)):') 26 | cmd.do(' obj_name = "%s%s.pdb" % (prefix, obj_list[i])') 27 | cmd.do(' cmd.save(obj_name, obj_list[i])') 28 | cmd.do(' print("Saving %s" % obj_name)') 29 | cmd.do(' else:') 30 | cmd.do(' print("No objects found")') 31 | cmd.do('') 32 | cmd.do('') 33 | cmd.do('cmd.extend('saveSep', saveSep)') 34 | cmd.do(' ') 35 | -------------------------------------------------------------------------------- /Objects/loadManyFiles.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2004 Robert L. Campbell 2 | # 3 | # Modified for use with Python3. 4 | # Jan. 29, 2020 5 | # Blaine Mooers, PhD 6 | # Univ. of Oklahoma Health Sciences Center 7 | # 8 | # 9 | from pymol import cmd 10 | import glob 11 | 12 | def loadFiles(files): 13 | """ 14 | load_files 15 | 16 | loads multiple files (using filename globbing) 17 | into a multiple objects named as the files are (e.g. collection of 18 | downloaded PDB files). 19 | 20 | e.g. load_files prot_*.pdb 21 | """ 22 | file_list = glob.glob(files) 23 | if file_list: 24 | file_list.sort() 25 | for i in file_list: 26 | #obj_name = i.replace(".pdb","") 27 | #cmd.load(file_list[i],obj_name) 28 | cmd.load(i) 29 | else: 30 | print("No files found for pattern %s" % files) 31 | 32 | cmd.extend("loadFiles",loadFiles) 33 | -------------------------------------------------------------------------------- /Objects/optAlignRNA.py: -------------------------------------------------------------------------------- 1 | python 2 | ############################################################################## 3 | # 4 | # @SUMMARY: -- QKabsch.py. A python implementation of the optimal superposition 5 | # of two sets of vectors as proposed by Kabsch 1976 & 1978. 6 | # 7 | # @AUTHOR: Jason Vertrees 8 | # @COPYRIGHT: Jason Vertrees (C), 2005-2007 9 | # @LICENSE: Released under GPL: 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2 of the License, or 13 | # (at your option) any later version. 14 | # This program is distributed in the hope that it will be useful, but WITHOUT 15 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along with 19 | # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 20 | # Street, Fifth Floor, Boston, MA 02110-1301, USA 21 | # 22 | # DATE : 2007-01-01 23 | # REV : 2 24 | # REQUIREMENTS: numpy 25 | # 26 | # 27 | # Modified optAlign.py to use C1' carbon atoms of RNA for alignment. 28 | # Jan. 29, 2020 29 | # Blaine Mooers, PhD 30 | # Univ. of Oklahoma Health Sciences Center 31 | # 32 | ############################################################################# 33 | from array import * 34 | 35 | # system stuff 36 | import os 37 | import copy 38 | 39 | # pretty printing 40 | import pprint 41 | 42 | # for importing as a plugin into PyMol 43 | from pymol import cmd 44 | from pymol import stored 45 | from pymol import selector 46 | 47 | # using numpy for linear algebra 48 | import numpy 49 | 50 | def optAlignRNA( sel1, sel2 ): 51 | """ 52 | optAlignRNA performs the Kabsch alignment algorithm upon the C1' carbons of two selections. 53 | Example: optAlignRNA 1JU7 and i. 1-16 and n. C1', 1CLL and i. 4-146 and n. C1' 54 | 55 | Two RMSDs are returned. One comes from the Kabsch algorithm and the other from 56 | PyMOL based upon your selections. 57 | 58 | This function can be run in a for loop to fit multiple structures with a common prefix name: 59 | 60 | for x in cmd.get_names(): optAlignRNA(x, "1JU7_0001") 61 | 62 | or get the rmsds for all combinations, do the following: 63 | 64 | [[optAlignRNA(x, y) for x in cmd.get_names()] for y in cmd.get_names()] 65 | 66 | """ 67 | cmd.reset() 68 | 69 | # make the lists for holding coordinates 70 | # partial lists 71 | stored.sel1 = [] 72 | stored.sel2 = [] 73 | # full lists 74 | stored.mol1 = [] 75 | stored.mol2 = [] 76 | 77 | # -- CUT HERE 78 | sel1 += " and N. C1'" 79 | sel2 += " and N. C1'" 80 | # -- CUT HERE 81 | 82 | # Get the selected coordinates. We 83 | # align these coords. 84 | cmd.iterate_state(1, selector.process(sel1), "stored.sel1.append([x,y,z])") 85 | cmd.iterate_state(1, selector.process(sel2), "stored.sel2.append([x,y,z])") 86 | 87 | # get molecule name 88 | mol1 = cmd.identify(sel1,1)[0][0] 89 | mol2 = cmd.identify(sel2,1)[0][0] 90 | 91 | # Get all molecule coords. We do this because 92 | # we have to rotate the whole molcule, not just 93 | # the aligned selection 94 | cmd.iterate_state(1, mol1, "stored.mol1.append([x,y,z])") 95 | cmd.iterate_state(1, mol2, "stored.mol2.append([x,y,z])") 96 | 97 | # check for consistency 98 | assert len(stored.sel1) == len(stored.sel2) 99 | L = len(stored.sel1) 100 | assert L > 0 101 | 102 | # must alway center the two proteins to avoid 103 | # affine transformations. Center the two proteins 104 | # to their selections. 105 | COM1 = numpy.sum(stored.sel1,axis=0) / float(L) 106 | COM2 = numpy.sum(stored.sel2,axis=0) / float(L) 107 | stored.sel1 -= COM1 108 | stored.sel2 -= COM2 109 | 110 | # Initial residual, see Kabsch. 111 | E0 = numpy.sum( numpy.sum(stored.sel1 * stored.sel1,axis=0),axis=0) + numpy.sum( numpy.sum(stored.sel2 * stored.sel2,axis=0),axis=0) 112 | 113 | # 114 | # This beautiful step provides the answer. V and Wt are the orthonormal 115 | # bases that when multiplied by each other give us the rotation matrix, U. 116 | # S, (Sigma, from SVD) provides us with the error! Isn't SVD great! 117 | V, S, Wt = numpy.linalg.svd( numpy.dot( numpy.transpose(stored.sel2), stored.sel1)) 118 | 119 | # we already have our solution, in the results from SVD. 120 | # we just need to check for reflections and then produce 121 | # the rotation. V and Wt are orthonormal, so their det's 122 | # are +/-1. 123 | reflect = float(str(float(numpy.linalg.det(V) * numpy.linalg.det(Wt)))) 124 | 125 | if reflect == -1.0: 126 | S[-1] = -S[-1] 127 | V[:,-1] = -V[:,-1] 128 | 129 | RMSD = E0 - (2.0 * sum(S)) 130 | RMSD = numpy.sqrt(abs(RMSD / L)) 131 | 132 | #U is simply V*Wt 133 | U = numpy.dot(V, Wt) 134 | 135 | # rotate and translate the molecule 136 | stored.sel2 = numpy.dot((stored.mol2 - COM2), U) 137 | stored.sel2 = stored.sel2.tolist() 138 | # center the molecule 139 | stored.sel1 = stored.mol1 - COM1 140 | stored.sel1 = stored.sel1.tolist() 141 | 142 | # let PyMol know about the changes to the coordinates 143 | cmd.alter_state(1,mol1,"(x,y,z)=stored.sel1.pop(0)") 144 | cmd.alter_state(1,mol2,"(x,y,z)=stored.sel2.pop(0)") 145 | 146 | #print("Moved: %s Reference: %s RMSD = %f" % mol1, mol2, RMSD) 147 | print("% s, % s,% 5.3f" % (mol1, mol2, RMSD)) 148 | 149 | # make the alignment OBVIOUS 150 | cmd.hide("everything") 151 | cmd.show("ribbon", sel1 + " or " + sel2) 152 | cmd.color("gray70", mol1 ) 153 | cmd.color("magenta", mol2 ) 154 | cmd.color("red", "visible") 155 | cmd.show("ribbon", "not visible") 156 | cmd.center("visible") 157 | cmd.orient() 158 | cmd.zoom("visible") 159 | 160 | cmd.extend("optAlignRNA", optAlignRNA) 161 | python end 162 | -------------------------------------------------------------------------------- /Objects/saveSeppy.py: -------------------------------------------------------------------------------- 1 | from pymol import cmd 2 | import glob 3 | import re 4 | 5 | def saveSep(prefix=""): 6 | """ 7 | save_sep 8 | 9 | saves multiple objects into multiple files using an optional prefix name. 10 | 11 | e.g. save_sep prefix 12 | """ 13 | obj_list = cmd.get_names("all") 14 | 15 | if obj_list: 16 | for i in range(len(obj_list)): 17 | obj_name = "%s%s.pdb" % (prefix, obj_list[i]) 18 | cmd.save(obj_name, obj_list[i]) 19 | print("Saving %s" % obj_name) 20 | else: 21 | print("No objects found") 22 | 23 | cmd.extend("saveSep",saveSep) 24 | -------------------------------------------------------------------------------- /Print/aveB4resiX.py: -------------------------------------------------------------------------------- 1 | cmd.do('') 2 | cmd.do('# ; ') 3 | cmd.do('Bfactors = [];') 4 | cmd.do('# edit the selection below, which is a range of residue numbers here.;') 5 | cmd.do('iterate (resi 133), Bfactors.append(b);') 6 | cmd.do('print( "Average B-factor of residue ", %{1:133 , " = ", "%.2f" %(reduce(lambda x, y: x + y, Bfactors) / float(len(Bfactors))) );') 7 | -------------------------------------------------------------------------------- /Print/aveB4resiXpy.py: -------------------------------------------------------------------------------- 1 | # AveBResiX, prints the resiude number and the average bfactor.; 2 | # Uses reduce and lambda, builtin Python functional porgramming functions.; 3 | # Note that you need to convert the length of the list of Bfactors from an integer to a float before division into the sum.; 4 | Bfactors = []; 5 | # edit the selection below, which is a range of residue numbers here.; 6 | iterate (resi 133), Bfactors.append(b); 7 | print( "Average B-factor of residue ", %{1:133 , " = ", "%.2f" %(reduce(lambda x, y: x + y, Bfactors) / float(len(Bfactors))) ); 8 | -------------------------------------------------------------------------------- /Print/averageB.py: -------------------------------------------------------------------------------- 1 | cmd.do('Bfactors = []; ') 2 | cmd.do('# >>> edit the selection below, which is a range of residue numbers here.;') 3 | cmd.do('iterate (resi 133), Bfactors.append(b);') 4 | cmd.do('print("Sum = ", "%.2f" % (sum(Bfactors)));') 5 | cmd.do('print("Number of atoms = ", len(Bfactors));') 6 | cmd.do('print( "Average B =" , "%.2f" % ( sum(Bfactors)/float(len(Bfactors))));') 7 | -------------------------------------------------------------------------------- /Print/fasta.py: -------------------------------------------------------------------------------- 1 | cmd.do('print cmd.get_fastastr("all")') 2 | -------------------------------------------------------------------------------- /Print/fastapy.py: -------------------------------------------------------------------------------- 1 | # Get the sequences of all molecular objects.; 2 | print(cmd.get_fastastr("all")); 3 | -------------------------------------------------------------------------------- /Print/findHbonds.py: -------------------------------------------------------------------------------- 1 | cmd.do('remove element h; distance hbonds, all, all, 3.2, mode=2;') 2 | -------------------------------------------------------------------------------- /Print/getCoordinates.py: -------------------------------------------------------------------------------- 1 | cmd.do('print cmd.get_atom_coords("/4PCO//B/G`8/OP2");') 2 | -------------------------------------------------------------------------------- /Print/getCoordinatespy.py: -------------------------------------------------------------------------------- 1 | print(cmd.get_atom_coords("/4PCO//B/G`8/OP2")); 2 | -------------------------------------------------------------------------------- /Print/numResiNucleic.py: -------------------------------------------------------------------------------- 1 | sel = "polymer.nucleic"; print(len(set([(i.resi, i.resn) for i in cmd.get_model(sel).atom]))); 2 | -------------------------------------------------------------------------------- /Print/numResiNucleicChainA.py: -------------------------------------------------------------------------------- 1 | sel = "chain A and polymer.nucleic"; print(len(set([(i.resi, i.resn) for i in cmd.get_model(sel).atom]))); 2 | -------------------------------------------------------------------------------- /Print/numResiProtein.py: -------------------------------------------------------------------------------- 1 | sel = "polymer.protein"; print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))); 2 | -------------------------------------------------------------------------------- /Print/numResiProteinChainA.py: -------------------------------------------------------------------------------- 1 | sel = "chain A and polymer.protein"; print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))); 2 | -------------------------------------------------------------------------------- /Print/printBs.py: -------------------------------------------------------------------------------- 1 | cmd.do('remove element h; iterate resi 1:13, print(resi, name,b);') 2 | -------------------------------------------------------------------------------- /Print/printBs2digits.py: -------------------------------------------------------------------------------- 1 | cmd.do('iterate (resi 133), print(name + " %.2f" % b);') 2 | -------------------------------------------------------------------------------- /Print/printBspartB.py: -------------------------------------------------------------------------------- 1 | cmd.do('iterate resi 38 and altloc B, print resi, name, alt, b;') 2 | -------------------------------------------------------------------------------- /Print/printNameB4ResiX.py: -------------------------------------------------------------------------------- 1 | Bfac_dict = { 'Bfactors3' : [] ;cmd.iterate("(resi 133)","Bfactors3.append((name, b))", space=Bfac_dict); for i,j in Bfac_dict['Bfactors3']: print("%s %.2f" % (i,j)); 2 | -------------------------------------------------------------------------------- /Print/printPathpy.py: -------------------------------------------------------------------------------- 1 | print(pymol.__path__) 2 | -------------------------------------------------------------------------------- /Print/printResiResnNameB4ResiX.py: -------------------------------------------------------------------------------- 1 | Bfac_dict = { "Bfactors3" : [] ;cmd.iterate("(resi 133)","Bfactors3.append((resn,resi,name, b))", space=Bfac_dict); for i,j,k,l in Bfac_dict["Bfactors3"]: print("%s %s %s %.2f" % (i,j,k,l)); 2 | -------------------------------------------------------------------------------- /Print/printResiResnNameB4ResiXNoH.py: -------------------------------------------------------------------------------- 1 | Bfac_dict = { "Bfactors3" : [] ;cmd.iterate("(resi 133 and not elem H)","Bfactors3.append((resn,resi,name, b))", space=Bfac_dict); for i,j,k,l in Bfac_dict["Bfactors3"]: print("%s %s %s %.2f" % (i,j,k,l)); 2 | -------------------------------------------------------------------------------- /Programming/emacsjupyterSourceBlock.py: -------------------------------------------------------------------------------- 1 | #+BEGIN_SRC jupyter-python :session py :kernel pymol.python :exports both :results raw drawer 2 | from pymol import cmd 3 | cmd.do("reinitialize") 4 | cmd.bg_color("white") 5 | cmd.do("fetch 6VXX") 6 | cmd.do("zoom (resi 614 and chain A)") 7 | cmd.label(selection="chain A and resi 614 and name CB", expression=""%s-%s" % (resn,resi)") 8 | cmd.do("set label_color, black; set label_size, 48") 9 | cmd.do("set stick_radius, 0.12") 10 | cmd.do("hide cartoon; show sticks") 11 | cmd.do("set ray_shadows, 0") 12 | cmd.do("draw") 13 | cmd.do("png /Users/blaine/D614Gipython3.png, 600, 360, dpi=600") 14 | from IPython.display import Image 15 | from IPython.core.display import HTML 16 | PATH = "/Users/blaine/" 17 | Image(filename = PATH + "D614Gipython3.png", width=600, unconfined=True) 18 | #+END_SRC 19 | 20 | #+RESULTS: 21 | -------------------------------------------------------------------------------- /Programming/obipythonSourceBlock.py: -------------------------------------------------------------------------------- 1 | #+BEGIN_SRC ipython :session py :kernel pymol.python :exports both :results raw drawer 2 | from pymol import cmd 3 | cmd.do("reinitialize") 4 | cmd.bg_color("white") 5 | cmd.do("fetch 6VXX") 6 | cmd.do("zoom (resi 614 and chain A)") 7 | cmd.label(selection="chain A and resi 614 and name CB", expression=""%s-%s" % (resn,resi)") 8 | cmd.do("set label_color, black; set label_size, 48") 9 | cmd.do("set stick_radius, 0.12") 10 | cmd.do("hide cartoon; show sticks") 11 | cmd.do("set ray_shadows, 0") 12 | cmd.do("draw") 13 | cmd.do("png /Users/blaine/D614Gipython3.png, 600, 360, dpi=600") 14 | from IPython.display import Image 15 | from IPython.core.display import HTML 16 | PATH = "/Users/blaine/" 17 | Image(filename = PATH + "D614Gipython3.png", width=600, unconfined=True) 18 | #+END_SRC 19 | 20 | #+RESULTS: 21 | -------------------------------------------------------------------------------- /Programming/printAtomNames.py: -------------------------------------------------------------------------------- 1 | cmd.do('iterate (resi 101), print(name);') 2 | -------------------------------------------------------------------------------- /Programming/printAtomNumbers.py: -------------------------------------------------------------------------------- 1 | cmd.do('iterate (resi 1), print(name + " %i5" % ID);') 2 | -------------------------------------------------------------------------------- /Programming/printBfactors.py: -------------------------------------------------------------------------------- 1 | cmd.do('iterate (resi 101), print(name + " %.2f" % b);') 2 | -------------------------------------------------------------------------------- /Programming/printCoordinates.py: -------------------------------------------------------------------------------- 1 | stored.coords = []; 2 | iterate_state 1, (resi 101), stored.coords.append([x,y,z]); 3 | [print(i) for i in stored.coords]; 4 | -------------------------------------------------------------------------------- /Programming/printNamesCoordinates.py: -------------------------------------------------------------------------------- 1 | cmd.do('stored.coords = []; iterate_state 1, (resi 101), stored.coords.append([x,y,z]); ') 2 | cmd.do('stored.names = []; iterate_state 1, (resi 101), stored.names.append([name]);') 3 | cmd.do('stored.names3 = [tuple(i) for i in stored.names];') 4 | cmd.do('[print(i,j) for i,j in(zip(stored.names3, stored.coords)];') 5 | -------------------------------------------------------------------------------- /Programming/printVDWradii.py: -------------------------------------------------------------------------------- 1 | cmd.do('iterate (resi 101), print(name + " %.2f" % vdw);') 2 | -------------------------------------------------------------------------------- /Programming/renameChain.py: -------------------------------------------------------------------------------- 1 | cmd.do('alter 3fa0 and chain A, chain="C";') 2 | cmd.do('sort;') 3 | -------------------------------------------------------------------------------- /Programming/renumAtoms.py: -------------------------------------------------------------------------------- 1 | cmd.do('alter {$1:3fa0, ID=ID+100;') 2 | cmd.do('sort;') 3 | -------------------------------------------------------------------------------- /Programming/renumResi.py: -------------------------------------------------------------------------------- 1 | cmd.do('alter 3fa0, resi=str(int(resi)+100);sort;') 2 | -------------------------------------------------------------------------------- /Programming/synch.py: -------------------------------------------------------------------------------- 1 | cmd.sync(timeout=1.0,poll=0.05); 2 | -------------------------------------------------------------------------------- /Pymolrc/antialias.py: -------------------------------------------------------------------------------- 1 | cmd.do('set antialias, 1;') 2 | -------------------------------------------------------------------------------- /Pymolrc/fetchPath.py: -------------------------------------------------------------------------------- 1 | cmd.do('set fetch_path, /Users/blaine/pdbFiles;') 2 | -------------------------------------------------------------------------------- /Pymolrc/lspymolrc.py: -------------------------------------------------------------------------------- 1 | cmd.do('print invocation.options.deferred;') 2 | -------------------------------------------------------------------------------- /Pymolrc/lspymolrcpy.py: -------------------------------------------------------------------------------- 1 | print(invocation.options.deferred); 2 | -------------------------------------------------------------------------------- /Pymolrc/setpath.py: -------------------------------------------------------------------------------- 1 | os.environ["PATH"] += os.pathsep + "/Applications/ATSAS/bin"; 2 | -------------------------------------------------------------------------------- /Pymolrc/sigDigits.py: -------------------------------------------------------------------------------- 1 | cmd.do('set label_distance_digits, 2;') 2 | cmd.do('set label_angle_digits, 2;') 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jupyterlabpymolpysnips: Templates for writing and running PyMOL in Jupyter Notebooks. 2 | 3 | [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) 4 | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4429717.svg)](https://doi.org/10.5281/zenodo.4429717) 5 | ![Version](https://img.shields.io/static/v1?label=jupyterlabpymolpysnips&message=0.3&color=brightcolor) 6 | 7 | There are many ways to get PyMOL running in JupyterLab. For details on installing both, go to the [GitHub Page](https://mooerslab.github.io/jupyterlabpymolpysnips/) associated with this project. 8 | Go to this project's [GitHub Page](https://mooerslab.github.io/jupyterlabpymolpysnips/) for a list of the snippets and their descriptions. 9 | 10 |

Table of Contents

11 | 12 | * [Motivation](#motivation) 13 | * [New to scripting in PyMOL](#new) 14 | * [Tech Stack](#technology-stack) 15 | * [Installation](#installation) 16 | * [Configuration Setup](#configuration-setup) 17 | * [Usage](#usage) 18 | * [Testing](#testing) 19 | * [Requests for new snippets and text editors](#requests) 20 | * [Bug reports](#bugreports) 21 | * [Roadmaps](#roadmap) 22 | * [License](#license) 23 | * [Contact Information](#contact-information) 24 | * [How to cite](#citation) 25 | 26 | 27 |

Motivations for this project

28 | 29 | ### Use jupyterlabpymolpysnips to be more productive while running PyMOL in Jupyter 30 | 31 | 32 |

The animation below demonstrates the use of the ao.py snippet in JupyterLab to insert 17 lines of code for generating the ambient occlusion effect.

33 | 34 |

35 | 36 | 37 | The result of applying a variant of the above code to a 27-nucleotide RNA hairpin is shown below. 38 | 39 |

HTML5 Icon

40 | 41 | There is no option in a pulldown menu in **PyMOL** to make such an image. 42 | A script file with 17 commands is required. 43 | This code can be applied to any molecular object that has been loaded into **PyMOL**. 44 | 45 | [Return to Table of Contents](#table-of-contents) 46 | 47 | 48 | ### Why run PyMOL in a Jupyter Notebook? 49 | 50 | 51 | #### Streamlines the management of images for a project 52 | You can store the images generated by PyMOL in one **Jupyter Notebook** file instead of having dozens of script and image files squirreled away in dozens of subfolders. 53 | Using one file makes it easier to find the code to make a particular figure because the code can be placed above the image. 54 | This ability to quickly find the required code at a later time reduces the resistance to remaking a figure for manuscript resubmission, journal cover artwork, posters, platform presentations, lectures, book chapters, review articles, websites, and wall hangings. 55 | 56 | #### Ease the sharing of images with collaborators 57 | Using one file also eases sharing images with collaborators because only one file needs to be shared. 58 | If your collaborators are not PyMOL or Jupyter Notebook users, you can reformat the notebook as a static HTML or PDF file. 59 | 60 | 61 | #### Facilitates combining PyMOL with other software in molecular structure analysis 62 | 63 | During a molecular structure analysis project, you can run additional software from the same notebook (e.g., bio3d, ProDy, cctbx, phenix, ccp4, ccpem, XDS). 64 | This can improve the reproducibility of the computational aspects of your research. 65 | 66 | The primary caveat is that the nonPython software will require different kernels. 67 | This caveat means that you will have to switch kernels to use these packages in the same notebook and that you cannot run software with different kernels in the same cell. 68 | These are minor limitations. 69 | 70 | A secondary caveat is that some heavily used structural biology programs have yet to migrate from Python2 to Python3. 71 | You may have trouble running a Python2 kernel in **JupyterLab** installed to run with Python3. 72 | Fortunately, you can run many of these programs by using the shell magic in the notebook. 73 | This cell magic allows you to store the input and output in the notebook. 74 | This workaround enables you to carry on with your modern reproducible research practices with legacy code. 75 | 76 | [Return to Table of Contents](#table-of-contents) 77 | 78 | 79 | ### But I will miss the interactive viewport in PyMOL! 80 | 81 | 1. There is nothing stopping you from running the PyMOL GUI next to your **JupyterLab** session. You can adjust the molecule's orientation manually, run the **get_view** command, copy the output in the command history window from PyMOL, and paste it into a cell in the **Jupyter Notebook**. The one line of settings returned by the **rv** shortcut is much easier to use. The **rv** shortcut is in the [pymolshortcuts.py](https://github.com/MooersLab/pymolshortcuts) script. 82 | 83 | 2. **You will discover that you really do not need the PyMOL viewport.** With 10-15 minutes of practice, you can master the rapid iterating of the rotate and translate commands to adjust the molecule's orientation with much greater precision than via manipulation of the mouse. Iteratively issuing the rotate and the translate commands is less likely to cause repetitive stress injury than the use of the mouse to reorient the molecule. These injuries occur frequently when generating numerous molecular graphics images up against a deadline. 84 | 85 | [Return to Table of Contents](#table-of-contents) 86 | 87 | 88 |

New to PyMOL scripting?

89 | 90 | If you are not ready to write PyMOL scripts, please consider using [PyMOL shortcuts](https://github.com/MooersLab/pymolshortcuts) to enhance your productivity in **PyMOL** interactive sessions. 91 | For example, the above ambient occlusion effect can be invoked at any time by entering `AO` at the **PyMOL** prompt if the *pymolshortcuts.py* file has been loaded. 92 | These shortcuts can also be invoked in a **Jupyter Notebook** by submitting them as arguments to the cmd.do() method, (e.g., cmd.do("AO") to generate the ambient occlusion effect.) 93 | 94 | ## Application Description 95 | 96 | The **jupyterlabpymolpysnips** library contains 260 code fragments (i.e., templates or snippets) written in Python to run PyMOL in **JupyterLab** via **PyMOL**'s **Python** API. 97 | This API is only available for recent versions of **PyMOL** that depend on Python3. 98 | This API is available for both the incentive and open-source versions of **PyMOL**. 99 | 100 | [Return to Table of Contents](#table-of-contents) 101 | 102 | 103 |

Technology Stack for

104 | 105 | | Technology | Version | Description | 106 | |--------------------------------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------| 107 | | [PyMOL](https://pymol.org/2/) | 2.4.0 | Molecular graphics program | 108 | | Python | 3.7-3.8 | Programming language | 109 | | [JupyterLab](https://pypi.org/project/jupyterlab/) | >=2.0 | A IDE for editing Jupyter Notebooks. | 110 | | [jupyterlab-snippets](https://github.com/QuantStack/jupyterlab-snippets) | 0.4.0 or 0.4.1 | Required extension | 111 | | Node.js | >=10.0.0 | Required by Jupyter and many extensions. | 112 | | git | 2.25.1 | Eases the downloading and updating of the libraries. | 113 | 114 | 115 | ## or use this alternate set of programs 116 | 117 | You may have to create a new conda env to install the older version of JupyterLab. 118 | 119 | | Technology | Version | Description | 120 | |--------------------------------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------| 121 | | [PyMOL](https://pymol.org/2/) | >2.4.0 | Molecular graphics program | 122 | | Python | 3.7-3.8 | Programming language 123 | | [JupyterLab](https://pypi.org/project/jupyterlab/) | >2.2.0 | A IDE for editing Jupyter Notebooks. Version 3.0 does not work with jupyterlab-snippets-multimenus | 124 | | [jupyterlab-snippets-multimenus](https://github.com/QuantStack/jupyterlab-snippets ) | 0.4.0 | Required extension | 125 | | Node.js | >=10.0.0 | Required by Jupyter and many extensions. | 126 | | git | 2.25.1 | Eases the downloading and updating of the libraries. | 127 | 128 | 129 | Some of the snippets are limited to Python3 code. 130 | Suppose you use an outdated version of **PyMOL** that relies on Python2. In that case, you can buy a license to the current version of **PyMOL**; install a free, open-source version of **PyMOL** that depends on Python3 (See the [PyMOL Wiki](https://pymolwiki.org/index.php/Main_Page)); or you can rewrite the snippet's code to be Python2 compliant. 131 | The latter task involves replacing print statements in Python2 with print() functions in Python3. 132 | The command-line program **2to3** automates this process. 133 | Note that multiple versions of **PyMOL** can operate side-by-side on a computer, so you do not have to delete that old version of **PyMOL**. 134 | 135 | JupyterLab can use the **jupyterlab-snippets** extension to make the snippets available via the **snippets** pull-down menu. 136 | Conda, pip, or the extension manager in **Jupyter Lab** can install the extension. 137 | 138 | Assuming that **JupyterLab**, **jupyterlab-snippets**, and **PyMOL** are already installed, run the following commands one line at a time, 139 | 140 | ```bash 141 | jupyter --path 142 | cd ~/.local/share/jupyter # change as per output from prior line. Use cd ~/Library/Jupyter on the Mac. 143 | mkdir snippets 144 | cd snippets 145 | git clone https://github.com/MooersLab/jupyterlabpymolpysnips.git pymol 146 | git clone https://github.com/MooersLab/jupyterlabpymolpysnipsplus.git pymol+ 147 | ``` 148 | 149 | When you open **JupyterLab**, you will find a **snippet** pull-down menu on the JupyterLab menu bar. 150 | There will be a **pymol** sub-menu and a **pymol+** sub-menu under this pull-down. 151 | 152 | JupyterLab needs to be version >=2.2.0 for **jupyterlab-snippets** to run. 153 | The current version of **JupyterLab** is 3.3.4. 154 | 155 | You can install **Node.js** from the Node.js developer's website or with a package manager. 156 | It needs to be more recent than version 10.0.0. 157 | Beware that Anaconda has in the past installed ancient versions of Node, and you may have to set the version number to install a newer version of Node via Anaconda. 158 | You may have better luck using the installer from the developer. 159 | Run it in the active conda env where you want to run jupyterlab. 160 | 161 | [Return to Table of Contents](#table-of-contents) 162 | 163 |

Installation of the snippet library

164 | 165 | Alternatively, you can use the **jupyterlab-snippets-multimenus** package. 166 | The package will appear on the menu bar as separate pull-down menus: **pymol** and **pymol+**. 167 | This approach removes a layer of hierarchy in the pull-down menus, allowing users to select the snippet of interest faster. 168 | The downside is that you must use an older version of JupyterLab. 169 | 170 | Assuming that **JupyterLab**, **jupyterlab-snippets-multimenus**, and PyMOL are already installed, run the following commands one line at a time: 171 | 172 | ```bash 173 | jupyter --path 174 | cd ~/.local/share/jupyter # change as per output from prior line. Use cd ~/Library/Jupyter on the Mac. 175 | mkdir multimenus_snippets 176 | cd multimenus_snippets 177 | git clone https://github.com/MooersLab/jupyterlabpymolpysnips.git pymol 178 | git clone https://github.com/MooersLab/jupyterlabpymolpysnipsplus.git pymol+ 179 | ``` 180 | 181 | The snippets in the **pymolpysnips+** library have a second copy of the code in a comment with the tab stops marked as follows `${1:default value}`. 182 | Tab stops are sites of parameter values that may need to be edited to customize the snippet. 183 | In most text editors, you hit the tab to advance to the next tab stop. 184 | **JupyterLab** does not yet support tab stops. 185 | (If you want to use tab stops in a text editor, visit the [pymolsnips project](https://github.com/MooersLab/pymolsnips)). 186 | Use the **pymol+** library when you need guidance in editing a snippet. 187 | The content of the active part of the snippet is the same in both libraries. 188 | The commented code in the **pymol+** snip library may annoy experienced users who do not need help with editing. 189 | 190 | 191 | Alternatively, you can download the repository as a zip file by clicking on the green **code** button above. 192 | However, **git** eases the updating of the libraries are a later time. 193 | You would navigate to the `multimenus_snippets/pymol` folder and then enter `git pull` to update the library. 194 | This is far less painful than down downloading the library as a zip file. 195 | Repeat for `pymol+` if needed. 196 | Navigate back to your home directory before running **JupyterLab** (e.g., `cd` or `cd ~/`). 197 | 198 | Now, fire up **JupyterLab**. 199 | 200 | ```bash 201 | jupyter lab 202 | ``` 203 | 204 | 205 | [Return to Table of Contents](#table-of-contents) 206 | 207 | 208 |

Configuration Setup

209 | 210 | The snippet library is independent of PyMOL. 211 | No modification of PyMOL is required. 212 | 213 | [Return to Table of Contents](#table-of-contents) 214 | 215 | 216 |

Usage

217 | 218 | The animation at the top of the page conveys the essential knowledge for usage. 219 | 220 | [Return to Table of Contents](#table-of-contents) 221 | 222 | 223 |

Testing

224 | 225 | Try the **ao.py** snippet. You should get a result similar to the one should in the animation above. 226 | 227 | [Return to Table of Contents](#table-of-contents) 228 | 229 | 230 |

Requests for new snippets

231 | 232 | Please use the **Issues tab** above to request support for additional snippets or to ask questions. 233 | Alternatively, you can send [e-mail](#contact-information) to me. 234 | 235 | Questions about PyMOL should be directed to the [PyMOL Mailing List](https://pymolwiki.org/index.php/PyMOL_mailing_list). 236 | 237 | [Return to Table of Contents](#table-of-contents) 238 | 239 | 240 |

Contributing

241 | 242 | Snippets of new code are most welcome. Send to [e-mail](#contact-information). 243 | 244 | - Submit the Python code in a plain text file. 245 | - Write the filenames and function names in camelCase. 246 | - Provide a description of what the code does in one to several sentences, an examples of usage, and any citations or links to further information. 247 | 248 | [Return to Table of Contents](#table-of-contents) 249 | 250 | 251 |

Bug reports

252 | 253 | Use the **Issues tab** above to report bugs or send [e-mail](#contact-information) to me. 254 | 255 | [Return to Table of Contents](#table-of-contents) 256 | 257 | 258 |

Roadmap

259 | 260 | I plan to expand the library to cover with examples the 500 commands and 600 settings in PyMOL. 261 | 262 | [Return to Table of Contents](#table-of-contents) 263 | 264 | 265 |

License

266 | 267 | We use the permissive MIT license. 268 | The license information for this project is found in the *License.txt* file above. 269 | 270 | [Return to Table of Contents](#table-of-contents) 271 | 272 | 273 |

Contact Information

274 | 275 | I can be reached via the Issue tab above or via e-mail: `blaine-mooers at ouhsc.edu`. 276 | 277 | [Return to Table of Contents](#table-of-contents) 278 | 279 | 280 |

Citation

281 | 282 | If you use this library to make figures for publication, please see the *Citation.md* file above. 283 | 284 | A paper describing this library was published in April 2021. 285 | 286 | 287 | ```bibtex 288 | @Article{Mooers2021APyMOLSnippetLibraryForJupyterToBoostResearcherProductivity, 289 | author = {Mooers, Blaine HM}, 290 | journal = {Computing in Science \& Engineering}, 291 | title = {A PyMOL snippet library for Jupyter to boost researcher productivity}, 292 | year = {2021}, 293 | pages = {47-53}, 294 | volume = {23}, 295 | publisher = {IEEE}, 296 | doi = {10.1109/MCSE.2021.3059536}, 297 | } 298 | ``` 299 | 300 | [Return to Table of Contents](#table-of-contents) 301 | 302 | ## Related Repos 303 | 304 | - [easypymol](https://github.com/MooersLab/EasyPyMOL/edit/master/README.md) 305 | - [pymolshortcuts](https://github.com/MooersLab/pymolshortcuts) 306 | - [pymolsnips](https://github.com/MooersLab/pymolsnips) 307 | - [orgpymolpysnips](https://github.com/MooersLab/orgpymolpysnips) 308 | - [rstudiopymolpysnips](https://github.com/MooersLab/rstudiopymolpysnips) 309 | - [taggedpymolpysnips](https://github.com/MooersLab/taggedpymolpysnips) 310 | - [colabOpenSourcePyMOLpySnips](https://github.com/MooersLab/colabOpenSourcePyMOLpySnips) 311 | - [colabPyMOLpySnips](https://github.com/MooersLab/colabPyMOLpySnips) 312 | - [PyMOLwallhangings](https://github.com/MooersLab/PyMOLwallhangings) 313 | 314 | - [jupyterlabpymolpysnips](https://github.com/MooersLab/jupyterlabpymolpysnips) PyMOL Python snippets for use in JupyterLab with the jupyterlab-snippets extension. 315 | - [jupyternbclassicpymolpysnipsplus](https://github.com/MooersLab/jupyternbclassicpymolpysnipsplus) 316 | - [taggedpymolpysnips](https://github.com/MooersLab/taggedpymolpysnips) 317 | - [taggedpymolpysnipspymolpysnipsplus](https://github.com/MooersLab/taggedpymolpysnipspymolpysnipsplus) 318 | - [jupyter-vsc-pymolpysnips](https://github.com/MooersLab/jupyter-vsc-pymolpysnips) 319 | - [jupyter-st3-pymolpysnips](https://github.com/MooersLab/jupyter-st3-pymolpysnips) 320 | - [jupyter-emacs-pymolpysnips](https://github.com/MooersLab/jupyter-emacs-pymolpysnips) 321 | - [jupyter-ultisnips-pymolpysnips](https://github.com/MooersLab/jupyter-ultisnips-pymolpysnips) 322 | - [jupyter-snipmate-pymolpysnips](https://github.com/MooersLab/jupyter-snipmate-pymolpysnips) 323 | - [jupyter-neosnippets-pymolpysnips](https://github.com/MooersLab/jupyter-neosnippets-pymolpysnips) 324 | - [jupyter-atom-pymolpysnips](https://github.com/MooersLab/jupyter-atom-pymolpysnips) 325 | 326 | 327 | ## Update history 328 | |Version | Changes | Date | 329 | |:-----------:|:------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------:| 330 | | Version 0.3 | Added funding and update table. Corrected typos in README.md file | 2024 May 9 | 331 | 332 | 333 | ## Funding 334 | - NIH: R01 CA242845, R01 AI088011 335 | - NIH: P30 CA225520 (PI: R. Mannel); P20GM103640 and P30GM145423 (PI: A. West) 336 | -------------------------------------------------------------------------------- /Selection/duplicateObject.py: -------------------------------------------------------------------------------- 1 | cmd.do('create t4l, 1lw9;') 2 | -------------------------------------------------------------------------------- /Selection/extractPartObj.py: -------------------------------------------------------------------------------- 1 | cmd.do('extract new_obj, chain A;') 2 | -------------------------------------------------------------------------------- /Selection/hideSelection.py: -------------------------------------------------------------------------------- 1 | cmd.do('indicate none') 2 | -------------------------------------------------------------------------------- /Selection/ligandSelect.py: -------------------------------------------------------------------------------- 1 | cmd.do('select ligand, organic;') 2 | -------------------------------------------------------------------------------- /Selection/selectAllBut.py: -------------------------------------------------------------------------------- 1 | cmd.do('select select1, elem N and chain A and not resn LYS;') 2 | -------------------------------------------------------------------------------- /Selection/selectAtomsAround.py: -------------------------------------------------------------------------------- 1 | cmd.do('select nearby, resn drug around 5;') 2 | -------------------------------------------------------------------------------- /Selection/selectChain.py: -------------------------------------------------------------------------------- 1 | cmd.do('select rna, chain B;') 2 | -------------------------------------------------------------------------------- /Selection/selectElement.py: -------------------------------------------------------------------------------- 1 | cmd.do('select oxygen, elem O;') 2 | -------------------------------------------------------------------------------- /Selection/selectHelices.py: -------------------------------------------------------------------------------- 1 | cmd.do('select helices, ss h; ') 2 | -------------------------------------------------------------------------------- /Selection/selectLoops.py: -------------------------------------------------------------------------------- 1 | cmd.do('select loops, ss l;') 2 | -------------------------------------------------------------------------------- /Selection/selectName.py: -------------------------------------------------------------------------------- 1 | cmd.do('select oxygen2, name O2;') 2 | -------------------------------------------------------------------------------- /Selection/selectResi.py: -------------------------------------------------------------------------------- 1 | cmd.do('select ${!:se; resi 1:100;') 2 | -------------------------------------------------------------------------------- /Selection/selectResidues.py: -------------------------------------------------------------------------------- 1 | cmd.do('select aromatic, resn phe+tyr+trp;') 2 | -------------------------------------------------------------------------------- /Selection/selectResiduesAround.py: -------------------------------------------------------------------------------- 1 | cmd.do('select nearby, br. resn drug around 5;') 2 | -------------------------------------------------------------------------------- /Selection/selectStrands.py: -------------------------------------------------------------------------------- 1 | cmd.do('select strands, ss s; ') 2 | -------------------------------------------------------------------------------- /Selection/undoSelection.py: -------------------------------------------------------------------------------- 1 | cmd.do('disable sele; ') 2 | -------------------------------------------------------------------------------- /Settings/listSettings.py: -------------------------------------------------------------------------------- 1 | [print("%s => %s" % (name, setting.get_setting_text(name))) for name in setting.get_name_list()]; 2 | -------------------------------------------------------------------------------- /Settings/listSettings2.py: -------------------------------------------------------------------------------- 1 | list = setting.get_name_list();[print("%s => %s" % (name, setting.get_setting_text(name))) for name in list]; 2 | -------------------------------------------------------------------------------- /Stereo/stereoDraw.py: -------------------------------------------------------------------------------- 1 | cmd.do('stereo walleye; ') 2 | cmd.do('set ray_shadow, off; ') 3 | cmd.do('#draw 3200,2000;') 4 | cmd.do('draw 1600,1000; ') 5 | cmd.do('png aaa.png;') 6 | -------------------------------------------------------------------------------- /Stereo/stereoRay.py: -------------------------------------------------------------------------------- 1 | cmd.do('stereo; ') 2 | cmd.do('set ray_shadow, off;') 3 | cmd.do('ray 2400,1200;') 4 | cmd.do('png aaa.png;') 5 | -------------------------------------------------------------------------------- /Stereo/stereokb.py: -------------------------------------------------------------------------------- 1 | cmd.set_key("F1",lambda:cmd.stereo({"on":0,"off":1[cmd.get("stereo")])); 2 | -------------------------------------------------------------------------------- /Trajectories/loadAmberTrajs.py: -------------------------------------------------------------------------------- 1 | cmd.do('load file.top, protein;') 2 | cmd.do('load file.rst, protein;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/addAxis.py: -------------------------------------------------------------------------------- 1 | python 2 | from pymol.cgo import * # get constants 3 | from pymol import cmd 4 | 5 | import math 6 | 7 | class Counter: 8 | """ 9 | draw_line 10 | source https://www.pymolwiki.org/index.php/Symmetry_Axis 11 | 12 | Pymol script copyright Matthew O"Meara and Xavier Ambroggio 2007 13 | 14 | Under GNU Free Documentation License 1.2 15 | 16 | Example: 17 | 18 | draw_axis(x=18.232, y=17.150, z=9.488,i=-.226639, j=0.708772, k=-.668039, r=1, b=0, g=0, width=1, length=100) 19 | 20 | Updated 15 June 2020 21 | Blaine Mooers 22 | 23 | Notes: 24 | 1) Could be useful for the adding a symmery axis, a ncs axis, or scale bar to a scene. 25 | 2) The postion (xyz) is the middle of the line, not one end as expected for a vector. 26 | 3) Another example: draw_axis(x=0, y=0, z=0,i=0, j=0, k=1, r=1, b=0, g=0, width=300, length=96) 27 | 4) Changed print statement to Python3 print function. 28 | 5) Replaced cmd.extend() with function generator. 29 | """ 30 | def __init__(self): 31 | self.state = 1 32 | counter = Counter() 33 | 34 | @cmd.extend 35 | def draw_axis(x=None, y=None, z=None, i=None, j=None, k=None, length=20.0, r=1.0, g=1.0, b=1.0, width=1.0 ): 36 | if x == None or y == None or z == None or i == None or j == None or k== None : 37 | print("Usage: draw_axis x,y,z, i,k,j, length, r,g,b, width") 38 | print("draw a line centered at (x,y,z) with the direction vector (i,j,k)") 39 | print("length, color (r,g,b), and width arguments are optional") 40 | # print "For a fun example of the command, run draw_axis_example" 41 | else : 42 | x,y,z = float(x), float(y), float(z) 43 | i,j,k = float(i), float(j), float(k) 44 | r,g,b = float(r), float(g), float(b) 45 | width = float(width) 46 | length = float(length) / 2.0 47 | 48 | x1,y1,z1 = (x+i*length,y+j*length,z+k*length) 49 | x2,y2,z2 = (x-i*length,y-j*length,z-k*length) 50 | 51 | obj = [ 52 | LINEWIDTH, width, 53 | BEGIN, LINES, 54 | 55 | COLOR, r, g, b, 56 | VERTEX, x1, y1, z1, 57 | VERTEX, x2, y2, z2, 58 | 59 | END 60 | ] 61 | 62 | cmd.load_cgo(obj,"axis"+str(counter.state)) 63 | counter.state += 1 64 | python end 65 | 66 | -------------------------------------------------------------------------------- /UnitCellDisplay/addAxispy.py: -------------------------------------------------------------------------------- 1 | from pymol.cgo import * # get constants 2 | from pymol import cmd 3 | 4 | import math 5 | 6 | class Counter: 7 | """ 8 | draw_line 9 | source https://www.pymolwiki.org/index.php/Symmetry_Axis 10 | 11 | Pymol script copyright Matthew O"Meara and Xavier Ambroggio 2007 12 | 13 | Under GNU Free Documentation License 1.2 14 | 15 | Example: 16 | 17 | draw_axis(x=18.232, y=17.150, z=9.488,i=-.226639, j=0.708772, k=-.668039, r=1, b=0, g=0, width=1, length=100) 18 | 19 | Updated 15 June 2020 20 | Blaine Mooers 21 | 22 | Notes: 23 | 1) Could be useful for the adding a symmery axis, a ncs axis, or scale bar to a scene. 24 | 2) The postion (xyz) is the middle of the line, not one end as expected for a vector. 25 | 3) Another example: draw_axis(x=0, y=0, z=0,i=0, j=0, k=1, r=1, b=0, g=0, width=300, length=96) 26 | 4) Changed print statement to Python3 print function. 27 | 5) Replaced cmd.extend() with function generator. 28 | """ 29 | def __init__(self): 30 | self.state = 1 31 | counter = Counter() 32 | 33 | @cmd.extend 34 | def draw_axis(x=None, y=None, z=None, i=None, j=None, k=None, length=20.0, r=1.0, g=1.0, b=1.0, width=1.0 ): 35 | if x == None or y == None or z == None or i == None or j == None or k== None : 36 | print("Usage: draw_axis x,y,z, i,k,j, length, r,g,b, width") 37 | print("draw a line centered at (x,y,z) with the direction vector (i,j,k)") 38 | print("length, color (r,g,b), and width arguments are optional") 39 | # print "For a fun example of the command, run draw_axis_example" 40 | else : 41 | x,y,z = float(x), float(y), float(z) 42 | i,j,k = float(i), float(j), float(k) 43 | r,g,b = float(r), float(g), float(b) 44 | width = float(width) 45 | length = float(length) / 2.0 46 | 47 | x1,y1,z1 = (x+i*length,y+j*length,z+k*length) 48 | x2,y2,z2 = (x-i*length,y-j*length,z-k*length) 49 | 50 | obj = [ 51 | LINEWIDTH, width, 52 | BEGIN, LINES, 53 | 54 | COLOR, r, g, b, 55 | VERTEX, x1, y1, z1, 56 | VERTEX, x2, y2, z2, 57 | 58 | END 59 | ] 60 | 61 | cmd.load_cgo(obj,"axis"+str(counter.state)) 62 | counter.state += 1 63 | 64 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc111.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 1, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc112.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 1, 2, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc113.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 1, 3, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc114.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 1, 4, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc121.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 2, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc122.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 2, 2, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc131.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 3, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc133.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 3, 3, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc141.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 4, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc144.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 4, 4, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc211.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 2, 1, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc212.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 2, 1, 2, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc221.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 2, 2, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc222.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 2, 2, 2, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc233.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 2, 3, 3, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc311.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 3, 1, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc313.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 3, 1, 3, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc323.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 1, 1, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc331.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 3, 3, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc332.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 3, 3, 2, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc333.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 3, 3, 3, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc411.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 4, 1, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc414.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 4, 1, 4, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc441.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 4, 4, 1, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/sc444.py: -------------------------------------------------------------------------------- 1 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py;') 2 | cmd.do('supercell 4, 4, 4, , orange, supercell1, 1;') 3 | -------------------------------------------------------------------------------- /UnitCellDisplay/symexp.py: -------------------------------------------------------------------------------- 1 | cmd.do('symexp symm, 3fa0, (3fa0), 20,1;') 2 | -------------------------------------------------------------------------------- /UnitCellDisplay/unitCellEdgesColorBlack.py: -------------------------------------------------------------------------------- 1 | # show the unit cell; 2 | show cell; 3 | color black, 1lw9; 4 | # color by atom with carbons colored green, 5 | util.cbag; 6 | set cgo_line_width, 2.5; 7 | png testCell3.png, 1600,1600;600;0 8 | -------------------------------------------------------------------------------- /Workshop/internalGUImode2.py: -------------------------------------------------------------------------------- 1 | cmd.do('internal_gui_mode=2;') 2 | -------------------------------------------------------------------------------- /Workshop/internalGUIwidth.py: -------------------------------------------------------------------------------- 1 | cmd.do('set internal_gui_width=0;') 2 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /gifs/aoUbuntu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MooersLab/jupyterlabpymolpysnips/79adfb09c0c1c7e4c893ac219ef877740ca54dc6/gifs/aoUbuntu.gif -------------------------------------------------------------------------------- /images/5d99AOD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MooersLab/jupyterlabpymolpysnips/79adfb09c0c1c7e4c893ac219ef877740ca54dc6/images/5d99AOD.png --------------------------------------------------------------------------------