Re: Access chain letter and residue number from Atom object

Jose Duarte <[email protected]> Fri, 12 May 2017 07:12:35 -0700
Newsgroups gmane.comp.java.bio.general
Message-ID <CAHhO=JFLNwVPNC7dKRbf+mT0o7=AbWZ9U6p09ApnFOm+hNam0g@mail.gmail.com>
--===============6392391029265096096==
Content-Type: multipart/alternative; boundary="001a11c021241a2ca4054f544c62"

--001a11c021241a2ca4054f544c62
Content-Type: text/plain; charset="UTF-8"

All you need is to get the group (residue) and then the chain:

atom.getGroup().getChain().getChainID(); // gives you the author chain id
(biojava 4+)

In biojava 5 (currently in development, but some alpha versions have been
released) it would be slightly different:

atom.getGroup().getChain().getName(); // for the author chain id

atom.getGroup().getChain().getId(); // for the asym_id (internal chain
identifier in mmcif files)


For the residue number you can do:

atom.getGroup().getResidueNumber();

Hope that helps

Jose



On Fri, May 12, 2017 at 3:07 AM, Enrico Morelli <[email protected]>
wrote:

> Dear,
>
> I'm using BioJava for a project. After some filtering operations I've
> an Atom list, but I've to know the chain and the residue number for
> each atom.
>
> My PDB has the following format:
>
> HETATM 1661 MG    MG A 580      69.222  44.815  33.339  1.00
> 61.74          MG
>
> Through an Atom object seems that should not possible to access to the
> chain (A) and residue number (580). There is a way to do that?
>
> Thanks
>
> --
> -------------------------------------------------------------
>   Enrico Morelli
>   System Administrator | Programmer | Web Developer
>
>   CERM - Polo Scientifico
>   Via Sacconi, 6 - 50019 Sesto Fiorentino (FI) - ITALY
>   phone: +39 055 457 4269
>   fax:   +39 055 457 4927
> -------------------------------------------------------------
> _______________________________________________
> Biojava-l mailing list  -  [email protected]
> http://mailman.open-bio.org/mailman/listinfo/biojava-l
>

--001a11c021241a2ca4054f544c62
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">All you need is to get the group (residue) and then the ch=
ain:<div>







<p class=3D"gmail-p1"><span class=3D"gmail-s1">atom</span>.getGroup().getCh=
ain().<span class=3D"gmail-s2">getChainID</span><span class=3D"gmail-s3">()=
; // gives you the author chain id (biojava 4+)</span></p><p class=3D"gmail=
-p1"><span class=3D"gmail-s3">In biojava 5 (currently in development, but s=
ome alpha versions have been released) it would be slightly different:</spa=
n></p><p class=3D"gmail-p1">







</p><p class=3D"gmail-p1"><span class=3D"gmail-s1">atom</span>.getGroup().g=
etChain().<span class=3D"gmail-s2">getName(); // for the author chain id</s=
pan></p><p class=3D"gmail-p1"><span class=3D"gmail-s2">







</span></p><p class=3D"gmail-p1"><span class=3D"gmail-s1">atom</span>.getGr=
oup().getChain().<span class=3D"gmail-s2">getId</span><span class=3D"gmail-=
s3">(); // for the asym_id (internal chain identifier in mmcif files)</span=
></p><p class=3D"gmail-p1"><br></p><p class=3D"gmail-p1">For the residue nu=
mber you can do:</p><p class=3D"gmail-p1"><span class=3D"gmail-s1">atom</sp=
an>.getGroup().getResidueNumber();</p><p class=3D"gmail-p1">Hope that helps=
<br></p><p class=3D"gmail-p1"><span class=3D"gmail-s3">Jose</span></p><p cl=
ass=3D"gmail-p1"><span class=3D"gmail-s3"><br></span></p></div></div><div c=
lass=3D"gmail_extra"><br><div class=3D"gmail_quote">On Fri, May 12, 2017 at=
 3:07 AM, Enrico Morelli <span dir=3D"ltr">&lt;<a href=3D"mailto:morelli@ce=
rm.unifi.it" target=3D"_blank">[email protected]</a>&gt;</span> wrote:<=
br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left=
:1px #ccc solid;padding-left:1ex">Dear,<br>
<br>
I&#39;m using BioJava for a project. After some filtering operations I&#39;=
ve<br>
an Atom list, but I&#39;ve to know the chain and the residue number for<br>
each atom.<br>
<br>
My PDB has the following format:<br>
<br>
HETATM 1661 MG=C2=A0 =C2=A0 MG A 580=C2=A0 =C2=A0 =C2=A0 69.222=C2=A0 44.81=
5=C2=A0 33.339=C2=A0 1.00<br>
61.74=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MG<br>
<br>
Through an Atom object seems that should not possible to access to the<br>
chain (A) and residue number (580). There is a way to do that?<br>
<br>
Thanks<br>
<br>
--<br>
------------------------------<wbr>------------------------------<wbr>-<br>
=C2=A0 Enrico Morelli<br>
=C2=A0 System Administrator | Programmer | Web Developer<br>
<br>
=C2=A0 CERM - Polo Scientifico<br>
=C2=A0 Via Sacconi, 6 - 50019 Sesto Fiorentino (FI) - ITALY<br>
=C2=A0 phone: +39 055 457 4269<br>
=C2=A0 fax:=C2=A0 =C2=A0+39 055 457 4927<br>
------------------------------<wbr>------------------------------<wbr>-<br>
______________________________<wbr>_________________<br>
Biojava-l mailing list=C2=A0 -=C2=A0 <a href=3D"mailto:[email protected]=
en-bio.org">[email protected]</a><br>
<a href=3D"http://mailman.open-bio.org/mailman/listinfo/biojava-l" rel=3D"n=
oreferrer" target=3D"_blank">http://mailman.open-bio.org/<wbr>mailman/listi=
nfo/biojava-l</a><br>
</blockquote></div><br></div>

--001a11c021241a2ca4054f544c62--

--===============6392391029265096096==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Biojava-l mailing list  -  [email protected]
http://mailman.open-bio.org/mailman/listinfo/biojava-l
--===============6392391029265096096==--