Package: nightshift
nightshiftA python library and command line program for plotting simulated 2D and 3D NMR spectra from assigned chemical shifts from theBMRBPeak assignments are pulled using the BMRB API (https://github.com/uwbmrb/BMRB-API) and plotted with matplotlib. Spectra produced by this script do not always reflect reality, as many entries do not have 100% assignments. Be sure to know what assignments are contained in the entry beforehand.CitationIf you find this code useful please cite our paper:Fucci, I.J. and Byrd, R.A. (2021), nightshift: A Python program for plotting simulated NMR spectra from assigned chemical shifts from the Biological Magnetic Resonance Data Bank. Protein Science. Accepted Author Manuscript.https://doi.org/10.1002/pro.4181InstallationI recommend installing in avirtualenvto avoid any conflicts with your python installation.
nightshift is available on thePyPIand can be installed withpip:pip install nightshiftTo install a local version downloaded from GitHub, use:pip install /path/to/nightshiftUsageYou will need to know your protein of interest's BMRB entry number. You can use nightshift's search command to find entry numbers:nightshift search ubiquitinWe'll use4493Solution structure of the designed hydrophobic core mutant of ubiquitin, 1D7for our examples.Basic spectraTwo major use cases are getting an idea what a amide or methyl spectrum of your protein would look likeTo simulate 1H-15N HSQC spetra can be plotted using the--amideflag:nightshift get 4493 --amideTo show Asn and Gln side chain amides on the spectrum pass the optional--sidechainsflag:nightshift get 4493 --amide --sidechainsA simulated 1H-13C HMQC spetra can be plotted using the--methylflag, additionally
providing the optionalproSorproRwill filter LV atoms by prochirality:nightshift get 4493 --methyl --proSAll plots can be filtered based on residue type by passing the--residuesor-rflag and providing one-letter amino acid codes. For instance an ILV methyl labeled spectrum can be plotted using:nightshift get 4493 --methyl -r ILVCustom correlationsFor arbitrary correlations use the--customflag followed by two atom names. Consider yourself warned that labeling schemes and/or experiments to produce these correlations may not (currently) exist. Atoms for custom correlations are specified using standard PDB atom names: H for amide proton, N for amide nitrogen, C for carbonyl carbon, CA for alpha carbon, HA for alpha proton and so on. For particular residues two or more atoms may exist at a position (i.e. CG for Val could be CG1 or CG2). To specify both CG1 and CG2 for Val pass CG:nightshift get 4493 --custom CG CA -r Vor specify the full atom name to only get those atoms:nightshift get 4493 --custom CG1 CA -r VTwo special atom names also exist for custom correlations:HmethylandCmethyl. Which correspond to these atoms in MILVAT residues and are the same atoms selected by using the--methylflag. The flags--proSand--proRcan be used withHmethylandCmethylResidueHmethylCmethylMetHE1CEIleHD11CD1LeuHD11, HD21CD1,CD2ValHG11, HG21CG1,CG2AlaHB1CBThrCG2HG21This allows for correlations of methyl groups to any other atom to be plotted. For instance Cmethyl to CA:nightshift get 4493 --custom Cmethyl CA -r ILVAdding '-' or '+' and any number to the end of a custom atom name allows correlation to thei+/-numresidue. For instance correlation of the CO of thei-1 residue to the amide N of theiresidue:nightshift get 4493 --custom C-1 N3D correlationsThe--customoption also allows for 3D correlations to be plotted. The matplotlib window will show 2D slices of the simulated spectrum. Scrolling the mouse wheel will switch between each slice:nightshift get 4493 --custom H N CABy default 16 slices are generated, this can be altered with the--slicesoption (i.e.slices 32orslices 1for a 2D projection). The--projectparameter can take a value of 1, 2 or 3 which chooses which dimension to project on. For a 3D HNCA (NOTE: you must escape with double quotes):nightshift get 4493 --custom "H N (CA CA-1)" --project 2 --slices 32Plus and minus can also be used on 3D correlations:nightshift get 4493 --custom HA N+1 CA+2 --project 1Other optionsBy default plots are generated in matplotlib and are interactive. To save directly to an image file use the--outputor-oflag and provide a file name and extension (.eps, .pdf, .pgf, .png, .ps, .raw, .rgba, .svg, and .svgz are all acceptable).Formatting options include:--showlegendto add a legend--nolabelsto remove the residue/atom name and numbers from the plot, also shows the legend--offsetto add a constant to the indices used by BMRB (to reflect the numbering you are used to)--colortakes a color such asredwhich will color all residues one color or a matplotlib colormap name such asviridisortab20which will color each residue with a differen color on the colormapA csv file containing the label and chemical shifts of both atoms can be saved using the--csvflag and providing a file name:nightshift get 4493 --methyl -r ILV --csv output.csvthis can be opened in other software to generate plots with different formatting.
Also the auxiliary scriptplot_outputs.pycan be used to overlay multiple spectra (i.e. different domains of the same protein or a protein complex).This example is nonsense, but illustrates how it could be done.
First, generate two output files:nightshift get 4493 --amide --csv output1.csvnightshift get 3433 --amide --csv output2.csvThen plot their overlay:nightshift open output1.csv output2.csvIf two labels are the same between the proteins (labels are residue type and sequence number), you can visualize tahe CSP using--showcsp, which will draw a line between the two.
This works for 4493 and 3433, but is not very informative.nightshift open output1.csv output2.csv --showcspAlso accepts the--showlegendand--nolabelsflags.--colorstakes a list of color names or list of colormaps and works like--colorfor individual plots.Interesting examplesILV methyl spectrum:nightshift get 4493 --methyl -r ILVILV methyl spectrum with proR LV:nightshift get 4493 --methyl proR -r ILVAmide spectrum of only lysines and arginines:nightshift get 4493 --amide -r KR2D HMBC-HMQC (intra-residue methyl-methyl correlations):nightshift get 4493 --custom Cmethyl Cmethyl -r LV2D NCO:nightshift get 4493 --custom C-1 N2D CANnightshift get 4493 --custom "(CA CA-1) N" --label 13D HNCACBnightshift get 4493 --custom "H N (CA CA-1 CB CB-1)" --project 2 --label 3 --slices 323D 15N TOCSY HSQCnightshift get 4493 --custom "H H# N" --slices 64Arg/Lys side chain carbon correlations (a laPritchard and Hansen, 2019)nightshift get 4493 --custom CG CD -r R --csv 4493_arg.csvnightshift get 4493 --custom CD CE -r K --csv 4493_lys.csvnightshift open 4493_arg.csv 4493_lys.csv --showlegend