<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to show Atomtype Labels from GROMACS .gro File in SAMSON]]></title><description><![CDATA[<p dir="auto">Dear SAMSON Development Team,</p>
<p dir="auto">I'm currently working on a document in SAMSON where I aim to display a molecule with specific custom labels for each atom. I'd like to show the 'atomtype' for each atom as imported from a GROMACS .gro file, which I found stored in each atom 'comment' value.</p>
<p dir="auto">I've been using the Python scripting console in SAMSON for this task, but I haven't been able to achieve the desired result. Specifically, I tried creating SBLabel objects and adding them to the document: the label objects are recognized in the pane on the left, but I'm struggling to display the created labels on the molecule.</p>
<p dir="auto">I would be grateful for any guidance or assistance you can provide on this matter!</p>
<p dir="auto">Thank you for your support and the continuous development of SAMSON.</p>
<p dir="auto">Kind regards,</p>
<p dir="auto">Mattia</p>
]]></description><link>https://forum.samson-connect.net/topic/245/how-to-show-atomtype-labels-from-gromacs-gro-file-in-samson</link><generator>RSS for Node</generator><lastBuildDate>Fri, 09 Oct 2026 04:54:05 GMT</lastBuildDate><atom:link href="https://forum.samson-connect.net/topic/245.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Jan 2024 21:45:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to show Atomtype Labels from GROMACS .gro File in SAMSON on Tue, 30 Jan 2024 14:53:42 GMT]]></title><description><![CDATA[<p dir="auto">Dear <a class="plugin-mentions-user plugin-mentions-a" href="/user/mattia-felice" aria-label="Profile: Mattia-Felice">@<bdi>Mattia-Felice</bdi></a> ,</p>
<p dir="auto">Thank you for the feedback! We will consider this for the next releases of SAMSON.</p>
<p dir="auto">We will surely add more labeling possibilities in the next release.</p>
<p dir="auto">As for formats from ab initio packages, SAMSON currently supports only Molden and it loads only the molecular structure from it. But we can add the possibility to load other data from it as well.</p>
]]></description><link>https://forum.samson-connect.net/post/1111</link><guid isPermaLink="true">https://forum.samson-connect.net/post/1111</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Tue, 30 Jan 2024 14:53:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to show Atomtype Labels from GROMACS .gro File in SAMSON on Tue, 30 Jan 2024 07:29:41 GMT]]></title><description><![CDATA[<p dir="auto">Hello Dmitriy,</p>
<p dir="auto">having the atom types shown during the development of a force field it's very handy, especially when you want to check if e.g. the molecular SMARTS pattern one's applying to match a certain atom are working properly. I guess in the future this kind of work might be taken over by AI (e.g. <a href="https://github.com/choderalab/espaloma" rel="nofollow ugc">https://github.com/choderalab/espaloma</a> ), but for the time being it would be a very valuable feature, together with showing the charge and LJ parameters from a .top file, or analogous formats.</p>
<p dir="auto">Regarding other information that would be useful to show, if you ever plan to support reading molecular structures from the output from ab-initio packages such as GAUSSIAN, ORCA, etc., an invaluable feature would be the possibility to show the values of charge and spin population in the labels, together with color mapping. This is a feature I've seen implemented only in ChemCraft so far.</p>
<p dir="auto">Thank you for the interest in the feedback :)</p>
<p dir="auto">Mattia</p>
]]></description><link>https://forum.samson-connect.net/post/1110</link><guid isPermaLink="true">https://forum.samson-connect.net/post/1110</guid><dc:creator><![CDATA[Mattia Felice]]></dc:creator><pubDate>Tue, 30 Jan 2024 07:29:41 GMT</pubDate></item><item><title><![CDATA[Reply to How to show Atomtype Labels from GROMACS .gro File in SAMSON on Mon, 29 Jan 2024 14:51:24 GMT]]></title><description><![CDATA[<p dir="auto">Great!</p>
<p dir="auto">Do you often need to show the <em>atomtypes</em> that are stored in the comment record for atoms? And what else would you like to be able to show e.g. as labels or in some other way? This will help us to see what functionality is necessary to add.</p>
]]></description><link>https://forum.samson-connect.net/post/1109</link><guid isPermaLink="true">https://forum.samson-connect.net/post/1109</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 29 Jan 2024 14:51:24 GMT</pubDate></item><item><title><![CDATA[Reply to How to show Atomtype Labels from GROMACS .gro File in SAMSON on Mon, 29 Jan 2024 10:51:43 GMT]]></title><description><![CDATA[<p dir="auto">Hello Dmitriy,</p>
<p dir="auto">this worked like a charm! It's a very useful feature to be able to do this when working on a new forcefield.</p>
<p dir="auto">Thank you again for your prompt help!</p>
<p dir="auto">Mattia</p>
]]></description><link>https://forum.samson-connect.net/post/1108</link><guid isPermaLink="true">https://forum.samson-connect.net/post/1108</guid><dc:creator><![CDATA[Mattia Felice]]></dc:creator><pubDate>Mon, 29 Jan 2024 10:51:43 GMT</pubDate></item><item><title><![CDATA[Reply to How to show Atomtype Labels from GROMACS .gro File in SAMSON on Mon, 29 Jan 2024 09:31:37 GMT]]></title><description><![CDATA[<p dir="auto">Dear <a class="plugin-mentions-user plugin-mentions-a" href="/user/mattia-felice" aria-label="Profile: Mattia-Felice">@<bdi>Mattia-Felice</bdi></a> ,</p>
<p dir="auto">Currently, the exposed SBLabel does not have an API to change its position - the position is determined by the label class itself depending on the label type (e.g., based on the centroid of the structure to which it has been applied). We will see how we can improve it in the future release.</p>
<p dir="auto">For now, what you can do is temporarily set the atomtype from the comment as the atom name, add the label via the interface, and then reset the name when needed either via the undo mechanism or via a saved list/map. Below is an example.</p>
<ol>
<li>Add labels by "Atoms (names)"</li>
<li>Set GRO atomtypes from atom's comment:</li>
</ol>
<pre><code class="language-python"># get an indexer of all atoms in the active document
atom_indexer = SAMSON.getNodes('n.t a')
# or only selected atoms: n.s == node.selected
#atom_indexer = SAMSON.getNodes('n.t a and n.s')

# holding: take care of undo/redo in SAMSON
SAMSON.beginHolding('Change atom name')

atom_name_map = {}
for atom in atom_indexer:
	atom_name_map[atom] = atom.name
	atom.name = atom.getComment()

# stop holding the undoable operation
SAMSON.endHolding()
</code></pre>
<ol start="3">
<li>Reset using the stored atom map:</li>
</ol>
<pre><code class="language-python"># holding: take care of undo/redo in SAMSON
SAMSON.beginHolding('Change atom name')

for atom, name in atom_name_map.items():
	atom.name = name

SAMSON.endHolding()
</code></pre>
<p dir="auto">Please let me know if you have questions.</p>
]]></description><link>https://forum.samson-connect.net/post/1107</link><guid isPermaLink="true">https://forum.samson-connect.net/post/1107</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 29 Jan 2024 09:31:37 GMT</pubDate></item></channel></rss>