\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{leilaP} \pdfinfo{ /Title (pymol-basic.pdf) /Creator (Cheatography) /Author (leilaP) /Subject (Pymol\_Basic Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Pymol\_Basic Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{leilaP} via \textcolor{DarkBackground}{\uline{cheatography.com/36664/cs/11524/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}leilaP \\ \uline{cheatography.com/leilap} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 20th April, 2017.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{5.12 cm} x{2.88 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Set up}} \tn % Row 0 \SetRowColor{LightBackground} Set working directory & `cd C:\textbackslash{}Users\textbackslash{}...` \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Load pdb file from pdb website & `fetch 1ubq` \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Load pdb file from local disk & `load 1ubq.pdb` \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.16 cm} x{3.84 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Log files}} \tn % Row 0 \SetRowColor{LightBackground} new log file & `log\_open file\_name.pml` \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} save and quit log file & `log\_close` \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} comment & \# \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} record the view coordinate & `get\_view` \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} run a log as a script & `@file\_name.pml \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{resume log file = run then edit at the end \newline append log file = edit at the end without running} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.56 cm} x{3.44 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Selection}} \tn % Row 0 \SetRowColor{LightBackground} select selection\_name, selection\_expression & `select carbon\_beta, n. cb` \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} select selection\_name= (selection expression) & `select carbon\_beta = (n; cb)` \tn % Row Count 6 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{logical operator: and (/), not, or. !order of precedence -{}-\textgreater{} use ()} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{5.472 cm} p{0.988 cm} p{1.14 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{Selection - single word}} \tn % Row 0 \SetRowColor{LightBackground} All atoms & all & * \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} No atoms & none & none \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} All hydrogen atoms & hydro & h. \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} All atoms from HETATM record & het & \seqsplit{hetatm} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{5.852 cm} p{0.988 cm} p{0.76 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{Porperty selector identifiers}} \tn % Row 0 \SetRowColor{LightBackground} Atom by chemical symbol \{\{nl\}\} ex: Oxygen = O & \seqsplit{symbol} & e. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Atom/nucleic acid by code \{\{nl\}\} ex: Cα = ca, Cβ = cb & name & n \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Aa/nucleic acid by code \{\{nl\}\}ex: Asparagine = asp / adenosine = a & resn & r \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} residue identifier (1-9999) & resi & i \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} PDB chain identifier (check in PDB file if letter or number ID) & chain & c \tn % Row Count 11 (+ 3) % Row 5 \SetRowColor{white} Secondary structure: \{\{nl\}\} α helix = 'H', β strand = "S", Loop = 'L' & ss & ss \tn % Row Count 14 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{8.4cm}}{carbon α : first carbon bond to the side chain \newline carbon β : second carbon bond to the side chain} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{selection macros}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\seqsplit{/object−name/segi−identifier/chain−identifier/resi−identifier/name−identifier}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{start by "/": start from the top of the hierarchie (object-name)} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{end by "/": start from the bottom of the hierarchie (name-id)} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{// :skip one level of hierarchie} \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{ex: `select lys, /helix\_alpha///lys` \{\{nl\}\} select all the residue of lysine from the object "helix\_alpha"} \tn % Row Count 10 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.92 cm} x{4.08 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Diplay}} \tn % Row 0 \SetRowColor{LightBackground} show the selection as this diplay type & `show\_as lines, selection\_name` \{\{nl\}\}`cmd.show\_as("lines", "selection\_name")` \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} add this display type of the selection & `show lines, selection\_name`\{\{nl\}\}`cmd.show("lines", "selection\_name")` \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} hide this display type of the selection & `hide lines, selection\_name`\{\{nl\}\}`cmd.hide("lines", "selection\_name")` \tn % Row Count 12 (+ 4) % Row 3 \SetRowColor{white} color the selection & `coloc color\_name, selection\_name` \tn % Row Count 14 (+ 2) % Row 4 \SetRowColor{LightBackground} zoom on the selection & zoom selection\_name \tn % Row Count 16 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Show (S button) - Hide (H button) - Color (C button) \newline display type: lines, ribbon, cartoon, stick, label, nonbonded, mainchain, sidechain} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{7.12 cm} p{0.88 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Structure modification}} \tn % Row 0 \SetRowColor{LightBackground} adds hydrogens in the appropriate places & h\_add \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.72 cm} x{3.28 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{get information}} \tn % Row 0 \SetRowColor{LightBackground} count the number of atome of the selection & `count\_atoms \seqsplit{selection\_name`} \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.104 cm} x{1.976 cm} x{1.52 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{selection algebra}} \tn % Row 0 \SetRowColor{LightBackground} Selects atoms that are not included in s1 & `not s1` & `! s1` \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Selects atoms included in both s1 and s2 & `s1 and s2` & `s1 \& s2` \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Selects atoms included in either s1 or s2 & `s1 or s2` & `s1 | s2` \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Selects atoms in s1 whose identifiers name, resi, resn, chain and segi all match atoms in s2 & `s1 in s2` & `s1 in s2` \tn % Row Count 11 (+ 5) % Row 4 \SetRowColor{LightBackground} Selects atoms in s1 whose identifiers name and resi match atoms in s2 & `s1 like s2` & `s1 l. s2` \tn % Row Count 15 (+ 4) % Row 5 \SetRowColor{white} Selects all atoms whose van der Waals radii are separated from the van der Waals radii of s1 by a minimum of X Angstroms. & `s1 gap X` & `s1 gap X` \tn % Row Count 21 (+ 6) % Row 6 \SetRowColor{LightBackground} Selects atoms with centers within X Angstroms of the center of any atom in s1 & `s1 around X` & `s1 a. X` \tn % Row Count 25 (+ 4) % Row 7 \SetRowColor{white} Expands s1 by all atoms within X Angstroms of the center of any atom in s1 & `s1 expand X` & `s1 e. X` \tn % Row Count 29 (+ 4) % Row 8 \SetRowColor{LightBackground} Selects atoms in s1 that are within X Angstroms of the s2 & `s1 within X of s2` & `s1 w. X of s2` \tn % Row Count 32 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4.104 cm} x{1.976 cm} x{1.52 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{selection algebra (cont)}} \tn % Row 9 \SetRowColor{LightBackground} Expands selection to complete residues & `byres s1` & `br. s1` \tn % Row Count 2 (+ 2) % Row 10 \SetRowColor{white} Expands selection to complete objects & `byobject s1 ` & `bo. s1` \tn % Row Count 4 (+ 2) % Row 11 \SetRowColor{LightBackground} Selects atoms directly bonded to s1 & `neighbor s1` & `nbr. s1` \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}