Discussion:
[PyMOL] How to export secondary structure information from a PDB using PyMol?
ZHANG Cheng
2016-05-13 20:30:53 UTC
Permalink
Dear PyMol friends,
I would like to export the secondary structure of individual residues from a PDB. Can I ask if I can use PyMol to do that?


I would like something like this:


Residue 1: alpha-helix
Residue 2: beta-sheet
......






I think "http://webclu.bio.wzw.tum.de/cgi-bin/stride/stridecgi.py" can also do that. However, I found that one residue is loop in Pymol but is indicated as "strand" in the website. So I wonder if Pymol can output the secondary structure of individual residues from a PDB?


Thank you.
Tsjerk Wassenaar
2016-05-13 21:24:24 UTC
Permalink
Hi Zhang Cheng,

If you replace SELECTION with a proper selection statement (with quotes),
then something like:

open("ss.dat","w").writelines( ["Residue %d: %s\n"%(a.resi,a.ss) for a in
cmd.get_model(SELECTION+" and n. ca").atom] )

It will write the results to a file called ss.dat. Do mind all
parentheses/brackets.

Hope it helps,

Tsjerk
Post by ZHANG Cheng
Dear PyMol friends,
I would like to export the secondary structure of individual residues from
a PDB. Can I ask if I can use PyMol to do that?
Residue 1: alpha-helix
Residue 2: beta-sheet
......
I think "http://webclu.bio.wzw.tum.de/cgi-bin/stride/stridecgi.py" can
also do that. However, I found that one residue is loop in Pymol but is
indicated as "strand" in the website. So I wonder if Pymol can output the secondary
structure of individual residues from a PDB?
Thank you.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data
untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
--
Tsjerk A. Wassenaar, Ph.D.
ZHANG Cheng
2016-05-14 11:44:57 UTC
Permalink
Dear Dr Tsjerk,
Thank you very much!.


For example, I have a structure of "protein.pdb". I tried but seems not work:


PyMOL>open("ss.dat","w").writelines(["Residue %d: %s\n"%(a.resi,a.ss) for a in cmd.get_model("protein"+" and n. ca").atom])
Traceback (most recent call last):
File "D:\Program Files (x86)\PyMOL\PyMOL/modules\pymol\parser.py", line 464, in parse
exec(layer.com2+"\n",self.pymol_names,self.pymol_names)
File "<string>", line 1, in <module>
TypeError: int argument required


Can I ask how to modify that?


Thank you!





------------------ Original ------------------
From: "Tsjerk Wassenaar";<***@gmail.com>;
Date: Sat, May 14, 2016 05:24 AM
To: "ZHANG Cheng"<***@qq.com>;
Cc: "pymol-users"<pymol-***@lists.sourceforge.net>;
Subject: Re: [PyMOL] How to export secondary structure information from a PDBusing PyMol?



Hi Zhang Cheng,

If you replace SELECTION with a proper selection statement (with quotes), then something like:


open("ss.dat","w").writelines( ["Residue %d: %s\n"%(a.resi,a.ss) for a in cmd.get_model(SELECTION+" and n. ca").atom] )


It will write the results to a file called ss.dat. Do mind all parentheses/brackets.


Hope it helps,


Tsjerk


On Fri, May 13, 2016 at 10:30 PM, ZHANG Cheng <***@qq.com> wrote:
Dear PyMol friends,
I would like to export the secondary structure of individual residues from a PDB. Can I ask if I can use PyMol to do that?


I would like something like this:


Residue 1: alpha-helix
Residue 2: beta-sheet
......






I think "http://webclu.bio.wzw.tum.de/cgi-bin/stride/stridecgi.py" can also do that. However, I found that one residue is loop in Pymol but is indicated as "strand" in the website. So I wonder if Pymol can output the secondary structure of individual residues from a PDB?


Thank you.

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
PyMOL-users mailing list (PyMOL-***@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-***@lists.sourceforge.net





--
Tsjerk A. Wassenaar, Ph.D.
Tsjerk Wassenaar
2016-05-14 11:49:02 UTC
Permalink
Hi Zhang Chen,

Oh, I guess that the %d should be %s then. Sorry.

Cheers,

Tsjerk
Post by ZHANG Cheng
Dear Dr Tsjerk,
Thank you very much!.
PyMOL>open("ss.dat","w").writelines(["Residue %d: %s\n"%(a.resi,a.ss) for
a in cmd.get_model("protein"+" and n. ca").atom])
File "D:\Program Files (x86)\PyMOL\PyMOL/modules\pymol\parser.py", line 464, in parse
exec(layer.com2+"\n",self.pymol_names,self.pymol_names)
File "<string>", line 1, in <module>
TypeError: int argument required
Can I ask how to modify that?
Thank you!
------------------ Original ------------------
*Date: * Sat, May 14, 2016 05:24 AM
*Subject: * Re: [PyMOL] How to export secondary structure information
from a PDBusing PyMol?
Hi Zhang Cheng,
If you replace SELECTION with a proper selection statement (with quotes),
open("ss.dat","w").writelines( ["Residue %d: %s\n"%(a.resi,a.ss) for a in
cmd.get_model(SELECTION+" and n. ca").atom] )
It will write the results to a file called ss.dat. Do mind all
parentheses/brackets.
Hope it helps,
Tsjerk
Post by ZHANG Cheng
Dear PyMol friends,
I would like to export the secondary structure of individual residues
from a PDB. Can I ask if I can use PyMol to do that?
Residue 1: alpha-helix
Residue 2: beta-sheet
......
I think "http://webclu.bio.wzw.tum.de/cgi-bin/stride/stridecgi.py" can
also do that. However, I found that one residue is loop in Pymol but is
indicated as "strand" in the website. So I wonder if Pymol can output the secondary
structure of individual residues from a PDB?
Thank you.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
--
Tsjerk A. Wassenaar, Ph.D.
ZHANG Cheng
2016-05-14 11:55:08 UTC
Permalink
Dear Dr Tsjerk,
Thank you very much. Now it works!


There are only L, S, H


So,
L: loop
S: beta-strand
H: alpha-helix


Is that right?


Thank you.


Cheng




------------------ Original ------------------
From: "Tsjerk Wassenaar";<***@gmail.com>;
Date: Sat, May 14, 2016 07:49 PM
To: "ZHANG Cheng"<***@qq.com>;
Cc: "pymol-users"<pymol-***@lists.sourceforge.net>;
Subject: Re: [PyMOL] How to export secondary structure information from aPDBusing PyMol?




Hi Zhang Chen,

Oh, I guess that the %d should be %s then. Sorry.

Cheers,

Tsjerk
On May 14, 2016 13:45, "ZHANG Cheng" <***@qq.com> wrote:
Dear Dr Tsjerk,
Thank you very much!.


For example, I have a structure of "protein.pdb". I tried but seems not work:


PyMOL>open("ss.dat","w").writelines(["Residue %d: %s\n"%(a.resi,a.ss) for a in cmd.get_model("protein"+" and n. ca").atom])
Traceback (most recent call last):
File "D:\Program Files (x86)\PyMOL\PyMOL/modules\pymol\parser.py", line 464, in parse
exec(layer.com2+"\n",self.pymol_names,self.pymol_names)
File "<string>", line 1, in <module>
TypeError: int argument required


Can I ask how to modify that?


Thank you!





------------------ Original ------------------
From: "Tsjerk Wassenaar";<***@gmail.com>;
Date: Sat, May 14, 2016 05:24 AM
To: "ZHANG Cheng"<***@qq.com>;
Cc: "pymol-users"<pymol-***@lists.sourceforge.net>;
Subject: Re: [PyMOL] How to export secondary structure information from a PDBusing PyMol?



Hi Zhang Cheng,

If you replace SELECTION with a proper selection statement (with quotes), then something like:


open("ss.dat","w").writelines( ["Residue %d: %s\n"%(a.resi,a.ss) for a in cmd.get_model(SELECTION+" and n. ca").atom] )


It will write the results to a file called ss.dat. Do mind all parentheses/brackets.


Hope it helps,


Tsjerk


On Fri, May 13, 2016 at 10:30 PM, ZHANG Cheng <***@qq.com> wrote:
Dear PyMol friends,
I would like to export the secondary structure of individual residues from a PDB. Can I ask if I can use PyMol to do that?


I would like something like this:


Residue 1: alpha-helix
Residue 2: beta-sheet
......






I think "http://webclu.bio.wzw.tum.de/cgi-bin/stride/stridecgi.py" can also do that. However, I found that one residue is loop in Pymol but is indicated as "strand" in the website. So I wonder if Pymol can output the secondary structure of individual residues from a PDB?


Thank you.

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
PyMOL-users mailing list (PyMOL-***@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-***@lists.sourceforge.net





--
Tsjerk A. Wassenaar, Ph.D.
Tsjerk Wassenaar
2016-05-14 12:08:44 UTC
Permalink
Hi Zhang Chen,

Yes, Pymol only recognizes Helix (3-,alpha,pi), Sheet and Loop (including
turns and such).

Best,

Tsjerk
Post by ZHANG Cheng
Dear Dr Tsjerk,
Thank you very much. Now it works!
There are only L, S, H
So,
L: loop
S: beta-strand
H: alpha-helix
Is that right?
Thank you.
Cheng
------------------ Original ------------------
*Date: * Sat, May 14, 2016 07:49 PM
*Subject: * Re: [PyMOL] How to export secondary structure information
from aPDBusing PyMol?
Hi Zhang Chen,
Oh, I guess that the %d should be %s then. Sorry.
Cheers,
Tsjerk
Post by ZHANG Cheng
Dear Dr Tsjerk,
Thank you very much!.
PyMOL>open("ss.dat","w").writelines(["Residue %d: %s\n"%(a.resi,a.ss) for
a in cmd.get_model("protein"+" and n. ca").atom])
File "D:\Program Files (x86)\PyMOL\PyMOL/modules\pymol\parser.py", line 464, in parse
exec(layer.com2+"\n",self.pymol_names,self.pymol_names)
File "<string>", line 1, in <module>
TypeError: int argument required
Can I ask how to modify that?
Thank you!
------------------ Original ------------------
*Date: * Sat, May 14, 2016 05:24 AM
*Subject: * Re: [PyMOL] How to export secondary structure information
from a PDBusing PyMol?
Hi Zhang Cheng,
If you replace SELECTION with a proper selection statement (with quotes),
open("ss.dat","w").writelines( ["Residue %d: %s\n"%(a.resi,a.ss) for a in
cmd.get_model(SELECTION+" and n. ca").atom] )
It will write the results to a file called ss.dat. Do mind all parentheses/brackets.
Hope it helps,
Tsjerk
Post by ZHANG Cheng
Dear PyMol friends,
I would like to export the secondary structure of individual residues
from a PDB. Can I ask if I can use PyMol to do that?
Residue 1: alpha-helix
Residue 2: beta-sheet
......
I think "http://webclu.bio.wzw.tum.de/cgi-bin/stride/stridecgi.py" can
also do that. However, I found that one residue is loop in Pymol but is
indicated as "strand" in the website. So I wonder if Pymol can output the secondary
structure of individual residues from a PDB?
Thank you.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
--
Tsjerk A. Wassenaar, Ph.D.
ZHANG Cheng
2016-05-14 12:18:19 UTC
Permalink
Hi Tsjerk,
Thank you very much!


Yours sincerely
Cheng




------------------ Original ------------------
From: "Tsjerk Wassenaar";<***@gmail.com>;
Date: Sat, May 14, 2016 08:08 PM
To: "ZHANG Cheng"<***@qq.com>;
Cc: "pymol-users"<pymol-***@lists.sourceforge.net>;
Subject: Re: [PyMOL] How to export secondary structure information fromaPDBusing PyMol?




Hi Zhang Chen,

Yes, Pymol only recognizes Helix (3-,alpha,pi), Sheet and Loop (including turns and such).

Best,

Tsjerk
On May 14, 2016 13:55, "ZHANG Cheng" <***@qq.com> wrote:
Dear Dr Tsjerk,
Thank you very much. Now it works!


There are only L, S, H


So,
L: loop
S: beta-strand
H: alpha-helix


Is that right?


Thank you.


Cheng




------------------ Original ------------------
From: "Tsjerk Wassenaar";<***@gmail.com>;
Date: Sat, May 14, 2016 07:49 PM
To: "ZHANG Cheng"<***@qq.com>;
Cc: "pymol-users"<pymol-***@lists.sourceforge.net>;
Subject: Re: [PyMOL] How to export secondary structure information from aPDBusing PyMol?




Hi Zhang Chen,

Oh, I guess that the %d should be %s then. Sorry.

Cheers,

Tsjerk
On May 14, 2016 13:45, "ZHANG Cheng" <***@qq.com> wrote:
Dear Dr Tsjerk,
Thank you very much!.


For example, I have a structure of "protein.pdb". I tried but seems not work:


PyMOL>open("ss.dat","w").writelines(["Residue %d: %s\n"%(a.resi,a.ss) for a in cmd.get_model("protein"+" and n. ca").atom])
Traceback (most recent call last):
File "D:\Program Files (x86)\PyMOL\PyMOL/modules\pymol\parser.py", line 464, in parse
exec(layer.com2+"\n",self.pymol_names,self.pymol_names)
File "<string>", line 1, in <module>
TypeError: int argument required


Can I ask how to modify that?


Thank you!





------------------ Original ------------------
From: "Tsjerk Wassenaar";<***@gmail.com>;
Date: Sat, May 14, 2016 05:24 AM
To: "ZHANG Cheng"<***@qq.com>;
Cc: "pymol-users"<pymol-***@lists.sourceforge.net>;
Subject: Re: [PyMOL] How to export secondary structure information from a PDBusing PyMol?



Hi Zhang Cheng,

If you replace SELECTION with a proper selection statement (with quotes), then something like:


open("ss.dat","w").writelines( ["Residue %d: %s\n"%(a.resi,a.ss) for a in cmd.get_model(SELECTION+" and n. ca").atom] )


It will write the results to a file called ss.dat. Do mind all parentheses/brackets.


Hope it helps,


Tsjerk


On Fri, May 13, 2016 at 10:30 PM, ZHANG Cheng <***@qq.com> wrote:
Dear PyMol friends,
I would like to export the secondary structure of individual residues from a PDB. Can I ask if I can use PyMol to do that?


I would like something like this:


Residue 1: alpha-helix
Residue 2: beta-sheet
......






I think "http://webclu.bio.wzw.tum.de/cgi-bin/stride/stridecgi.py" can also do that. However, I found that one residue is loop in Pymol but is indicated as "strand" in the website. So I wonder if Pymol can output the secondary structure of individual residues from a PDB?


Thank you.

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
PyMOL-users mailing list (PyMOL-***@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-***@lists.sourceforge.net





--
Tsjerk A. Wassenaar, Ph.D.
Julian Heinrich
2016-05-17 17:37:32 UTC
Permalink
Hi,

in case you haven't solved this yet, the following command prints the
residue number and secondary structure:

iterate n. CA, print resi + ':' + ss

Cheers,
Julian
Post by ZHANG Cheng
Dear PyMol friends,
I would like to export the secondary structure of individual residues from
a PDB. Can I ask if I can use PyMol to do that?
Residue 1: alpha-helix
Residue 2: beta-sheet
......
I think "http://webclu.bio.wzw.tum.de/cgi-bin/stride/stridecgi.py" can
also do that. However, I found that one residue is loop in Pymol but is
indicated as "strand" in the website. So I wonder if Pymol can output the secondary
structure of individual residues from a PDB?
Thank you.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data
untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
ZHANG Cheng
2016-05-17 17:45:11 UTC
Permalink
Hi Julian,
Thank you so much. I just tested it and it worked as well!


Yours sincerely
Cheng




------------------ Original ------------------
From: "Julian Heinrich";<***@joules.de>;
Date: Wed, May 18, 2016 01:37 AM
To: "ZHANG Cheng"<***@qq.com>; "pymol-users"<pymol-***@lists.sourceforge.net>;

Subject: Re: [PyMOL] How to export secondary structure information from a PDBusing PyMol?



Hi,

in case you haven't solved this yet, the following command prints the residue number and secondary structure:


iterate n. CA, print resi + ':' + ss



Cheers,
Julian


On Fri, May 13, 2016 at 10:40 PM ZHANG Cheng <***@qq.com> wrote:

Dear PyMol friends,
I would like to export the secondary structure of individual residues from a PDB. Can I ask if I can use PyMol to do that?


I would like something like this:


Residue 1: alpha-helix
Residue 2: beta-sheet
......






I think "http://webclu.bio.wzw.tum.de/cgi-bin/stride/stridecgi.py" can also do that. However, I found that one residue is loop in Pymol but is indicated as "strand" in the website. So I wonder if Pymol can output the secondary structure of individual residues from a PDB?


Thank you.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j_______________________________________________
PyMOL-users mailing list (PyMOL-***@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-***@lists.sourceforge.net
Loading...