# Draw a 2-D representation of a protein with cpssp LaTeX

I have a MacBookAir and I want to draw a two-dimensional representation of a protein's secondary structure with cpssp in LaTeX. I have installed cpssp and MacTeX. I also created my ~/Library/texmf/tex/latex/cpssp. Next I have run the Python script which I called from my terminal like

python cpssp.py -s seq.fasta -u ss.fasta -w 14 -i 1.5 -t 20 -o test


I get the test.tex file but I don't know how to use LaTeX to convert those coordinates into the actual image. I have read how to create a basic LaTeX and it works but when I try with the package cpssp it does not work.

Can someone help me PLEASE. Any tip, advise or something will be appreciated.

TeX file:

\cpsspLabel{-0.0}{pf_0111000}
\cpsspStartRes{-0.0}{1.5}{1}
\cpsspBend{-0.0}{1.5}{2.0}
\cpsspPiHelix{-0.0}{2.0}{2.25}
\cpsspSheet{-0.0}{2.25}{2.5}
\cpsspCoil{-0.0}{2.5}{3.75}
\cpsspSheet{-0.0}{3.75}{5.5}
\cpsspCoil{-0.0}{5.5}{6.75}
\cpsspAlphaHelix{-0.0}{6.75}{7.75}
\cpsspCoil{-0.0}{7.75}{8.75}
\cpsspSheet{-0.0}{8.75}{10.25}
\cpsspCoil{-0.0}{10.25}{10.75}
\cpsspSheet{-0.0}{10.75}{12.25}
\cpsspCoil{-0.0}{12.25}{14.0}
\cpsspEndRes{-0.0}{14.0}{50}
\cpsspLabel{-1.5}{pf_0111000}
\cpsspStartRes{-1.5}{1.5}{51}
\cpsspAlphaHelix{-1.5}{1.5}{2.75}
\cpsspCoil{-1.5}{2.75}{4.25}
\cpsspSheet{-1.5}{4.25}{5.0}
\cpsspCoil{-1.5}{5.0}{5.5}
\cpsspSheet{-1.5}{5.5}{6.0}
\cpsspCoil{-1.5}{6.0}{7.5}
\cpsspAlphaHelix{-1.5}{7.5}{11.75}
\cpsspCoil{-1.5}{11.75}{12.75}
\cpsspSheetT{-1.5}{12.75}{14.0}
\cpsspEndRes{-1.5}{14.0}{100}
\cpsspLabel{-3.0}{pf_0111000}
\cpsspStartRes{-3.0}{1.5}{101}
\cpsspSheet{-3.0}{1.5}{1.75}
\cpsspCoil{-3.0}{1.75}{3.75}
\cpsspSheet{-3.0}{3.75}{4.5}
\cpsspCoil{-3.0}{4.5}{6.5}
\cpsspAlphaHelix{-3.0}{6.5}{10.25}
\cpsspCoil{-3.0}{10.25}{11.5}
\cpsspSheetT{-3.0}{11.5}{14.0}
\cpsspEndRes{-3.0}{14.0}{150}
\cpsspLabel{-4.5}{pf_0111000}
\cpsspStartRes{-4.5}{1.5}{151}
\cpsspSheet{-4.5}{1.5}{2.0}
\cpsspCoil{-4.5}{2.0}{5.75}
\cpsspSheet{-4.5}{5.75}{6.75}
\cpsspCoil{-4.5}{6.75}{8.0}
\cpsspSheet{-4.5}{8.0}{8.75}
\cpsspCoil{-4.5}{8.75}{9.75}
\cpsspSheet{-4.5}{9.75}{10.5}
\cpsspCoil{-4.5}{10.5}{11.25}
\cpsspAlphaHelix{-4.5}{11.25}{14.0}
\cpsspEndRes{-4.5}{14.0}{200}
\cpsspLabel{-6.0}{pf_0111000}
\cpsspStartRes{-6.0}{1.5}{201}
\cpsspAlphaHelix{-6.0}{1.5}{1.75}
\cpsspCoil{-6.0}{1.75}{6.0}
\cpsspSheet{-6.0}{6.0}{9.0}
\cpsspCoil{-6.0}{9.0}{10.5}
\cpsspSheet{-6.0}{10.5}{13.5}
\cpsspCoil{-6.0}{13.5}{14.0}
\cpsspEndRes{-6.0}{14.0}{250}
\cpsspLabel{-7.5}{pf_0111000}
\cpsspStartRes{-7.5}{1.5}{251}
\cpsspCoil{-7.5}{1.5}{6.0}
\cpsspEndRes{-7.5}{6.0}{268}

-
Welcome to TeX.sx! –  Peter Jansson Mar 29 '13 at 15:35
could you please post the generated tex file here? –  michal.h21 Mar 29 '13 at 16:38

You should read Section 4.2 of the documentation about the inclusion of cpssp files. I never used cpssp, but I believe something like

\documentclass{standalone}
\usepackage{cpssp}
\begin{document}
\cpsspinput{filename}
\end{document}


should do.

-
yes I have run it as you say the first time it complains that i do not have the cpssp.sty, then i run cpssp.in file and that generated the cpssp.sty file but then when I run I get a new error: ! Missing $inserted. <inserted text>$ l.2 \cpsspLabel{-0.0}{pf_0111000} ? –  Diana G Mar 29 '13 at 19:06
! Missing $inserted. <inserted text>$ l.2 \cpsspLabel{-0.0}{pf_0111000} ? –  Diana G Mar 29 '13 at 19:16
@DianaG Subscripts require math mode by default. Otherwise you need \textsubscript. See tex.stackexchange.com/questions/1013/… for more details –  percusse Mar 29 '13 at 19:34
! Undefined control sequence. l.4 \textsubscript –  Diana G Mar 29 '13 at 20:41
@VincentNivoliers It's available with fixltx2e which is good to add anyways. –  percusse Mar 29 '13 at 23:16