论坛: 公开讨论 (Thread #34823)

Display amino acid name with number (2013-12-14 07:20 by skumar #71041)

Hi,
I would like to display amino acid name with its number like ALA12... by using amino acid id.
Is this possible??

Thanks

Re: Display amino acid name with number (2013-12-14 07:33 by biochem_fan #71042)

Yes, but it is in beta version.
Could you please study source codes of
https://github.com/biochem-fan/GLmol/tree/labelling ?

Demo is at:
http://webglmol.sourceforge.jp/labelling/viewer.html

> Hi,
> I would like to display amino acid name with its number like ALA12... by using amino acid id.
> Is this possible??
>
> Thanks
回复到 #71041

Re: Display amino acid name with number (2013-12-14 07:34 by biochem_fan #71043)

I forgot to mention what it does.
When you click somewhere on the protein, labels will be displayed.
回复到 #71042

Re: Display amino acid name with number (2013-12-18 06:30 by skumar #71076)

[メッセージ #71043 への返信]
> I forgot to mention what it does.
> When you click somewhere on the protein, labels will be displayed.


Hi,
Thanks for giving me link but not able to get it labelling information.
from where I can get beta version of glmol?
Is it possible to replace my old glmol with new beta version to work this labelling feature or I have to change something in code.

Thanks
回复到 #71043

Re: Display amino acid name with number (2013-12-18 06:52 by biochem_fan #71077)

> Thanks for giving me link but not able to get it labelling information.

What do you mean?
Is the demo not working?

> from where I can get beta version of glmol?

https://github.com/biochem-fan/GLmol/tree/labelling

> Is it possible to replace my old glmol with new beta version to work this labelling feature or I have to change something in code.

You have to change codes.
(Sorry, but this is BETA version.)
回复到 #71076

Re: Display amino acid name with number (2013-12-18 07:30 by skumar #71078)

Please let me know what should I change to enable labelling in this code.

<script type="text/javascript">
var P1 = [12,13,14];
var glmol01 = new GLmol('glmol01', true);
glmol01.defineRepresentation = function() {
var all = this.getAllAtoms();
var hetatm = this.removeSolvents(this.getHetatms(all));
this.colorByAtom(all, {});
this.colorByStructure(all);
this.colorAtoms(this.getResiduesById(this.getChain(all, ['A','B']), P1), 0xFF0000);

var asu = new THREE.Object3D();
this.drawBondsAsStick(asu, hetatm, this.cylinderRadius / 2.0, this.cylinderRadius, true, true, 0.3);

this.drawCartoon(asu, all, this.curveWidth, this.thickness);

this.drawSymmetryMates2(this.modelGroup, asu, this.protein.biomtMatrices);
this.modelGroup.add(asu);

};

glmol01.loadMolecule();

</script>

回复到 #71077

Re: Display amino acid name with number (2013-12-18 07:37 by biochem_fan #71079)

Do you want to dynamically show labels?
Or do you want to show labels for some fixed residues?

Please study codes around
https://github.com/biochem-fan/GLmol/blob/labelling/src/js/GLmol.js#L1726

回复到 #71078

Re: Display amino acid name with number (2013-12-18 07:41 by skumar #71080)

I would like to show lable for some fixed residues.

回复到 #71079

Re: Display amino acid name with number (2013-12-18 08:06 by biochem_fan #71081)

> I would like to show lable for some fixed residues.

Then you need to get atom object from this.atomlist

var atom = this.getResiduesById(this.getChain(all, ['A']), [10])[0]

You have to do this one by one.
Then,

var bb = this.billboard(this.createTextTex(atom.chain + ":" + atom.resn + ":" + atom.resi + ":" + atom.atom, "30", "#ffffff"));
bb.position.set(atom.x, atom.y, atom.z);
this.modelGroup.add(bb);

Yes, I need to add user-friendly wrapper to add labels more
easily.
回复到 #71080

Re: Display amino acid name with number (2013-12-18 08:24 by skumar #71082)

Thanks.
if I would like to show label dynamically. then what I have to do...
回复到 #71081

Re: Display amino acid name with number (2013-12-18 08:26 by biochem_fan #71083)

[メッセージ #71082 への返信]
> Thanks.
> if I would like to show label dynamically. then what I have to do...

See the event handler I pointed out before.
回复到 #71082

Re: Display amino acid name with number (2013-12-20 08:27 by skumar #71103)

Thanks for your help.
Now it is working fine.

In this labelling code what does it mean by "30" and one more thing if I change color code ("#000000") then it doesn't work, always comes white. Also is there way to increase label font size??

var bb = this.billboard(this.createTextTex(atom.chain + ":" + atom.resn + ":" + atom.resi + ":" + atom.atom, "30", "#ffffff"));

thanks
回复到 #71083

Re: Display amino acid name with number (2013-12-20 08:31 by biochem_fan #71104)

> In this labelling code what does it mean by "30" and one more thing if I change color code ("#000000") then it doesn't work, always comes white. Also is there way to increase label font size??
>
> var bb = this.billboard(this.createTextTex(atom.chain + ":" + atom.resn + ":" + atom.resi + ":" + atom.atom, "30", "#ffffff"));

30 is the font size. It must be given as a STRING.
(Yes, this is a bad design! I must fix.)

There is a bug in coloring; you cannot change color yet.
Now I am working on NDKmol. When I finish, I wil come
back to GLmol.
回复到 #71103

Re: Display amino acid name with number (2013-12-20 09:06 by skumar #71106)

Thanks..
回复到 #71104

Re: Display amino acid name with number (2013-12-21 05:16 by skumar #71115)

I found problem in labelling in safari 6.0 and firefox version. In some of the version it runs perfectly but in some structure is not displayed and labelling not working if structure is displayed.

Are there browser compatibility issue??

It works great in chrome...

Thanks
回复到 #71106

Re: Display amino acid name with number (2013-12-21 05:23 by biochem_fan #71116)

> I found problem in labelling in safari 6.0 and firefox version. In some of the version it runs perfectly but in some structure is not displayed and labelling not working if structure is displayed.

In Safari, you have to enable WebGL manually.
Did you do that?

Could you please report OS, browser's name and version,
PDB ID and the symptom (structure displayed or not,
label displayed or not)?

> Are there browser compatibility issue??

Possibly. That is why I keep it in beta stage and don't release it publicly.
回复到 #71115