<div dir="ltr">Beautifully written in one line. Cheers. </div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 16, 2017 at 2:00 AM, João Rodrigues <span dir="ltr"><<a href="mailto:j.p.g.l.m.rodrigues@gmail.com" target="_blank">j.p.g.l.m.rodrigues@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi there,<div><br></div><div>Try <a href="http://residue.id" target="_blank">residue.id</a>[1]. The residue number is the second item in the id tuple, first being the HETATM/Water flag, and third the altloc.</div><div><br></div><div>In short: resids = [<a href="http://r.id" target="_blank">r.id</a>[1] for r in structure.get_residues()]</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2017-04-15 16:27 GMT-07:00 Ahmad Abdelzaher <span dir="ltr"><<a href="mailto:underoath006@gmail.com" target="_blank">underoath006@gmail.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi,</div><div><br></div><div>I know I can get residue names like this:<br></div><div><br></div><div>name = '1gdw.pdb'<br></div><div><div>structure=p.get_structure(name<wbr>, name)</div><div>residue_name = []</div><div>for model in structure:</div><div> for chain in model:</div><div> for i in <b>residue_number</b>:</div><div> residue_name.append(chain[i].r<wbr>esname)</div></div><div><br></div><div>However, I don't know of a way to get a list of <b>residue_number,</b> so I use Pymol to do it! <br><br></div><div>import __main__</div><div>__main__.pymol_argv = ['pymol','-qc']</div><div>import pymol</div><div>from pymol import cmd, stored</div><div>pymol.finish_launching()</div><div>cmd.delete('all')</div><div>cmd.load(name)</div><div>stored.residues = []</div><div>cmd.iterate('name ca', 'stored.residues.append(resi)'<wbr>)</div><div>residue_number = [ int(x) for x in stored.residues ]</div><div><br></div><div>What is the biopython way of getting the residue numbers? </div><div><br></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Biopython mailing list - <a href="mailto:Biopython@mailman.open-bio.org" target="_blank">Biopython@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biopython" rel="noreferrer" target="_blank">http://mailman.open-bio.org/ma<wbr>ilman/listinfo/biopython</a><br></blockquote></div><br></div>
</blockquote></div><br></div>