<div dir="ltr">Hi,<div><br></div><div>Sorry, I can't follow the docs (or find the right docs).</div><div><br></div><div>I've got the 'seed' stockholm alignment for this domain:</div><div><a href="https://www.ebi.ac.uk/interpro/entry/pfam/PF08241/entry_alignments/?type=seed">https://www.ebi.ac.uk/interpro/entry/pfam/PF08241/entry_alignments/?type=seed</a><br></div><div><br></div><div>and I'm trying to reproduce the signature it shows here:</div><div><a href="https://www.ebi.ac.uk/interpro/entry/pfam/PF08241/logo/">https://www.ebi.ac.uk/interpro/entry/pfam/PF08241/logo/</a><br></div><div><br></div><div>I'm not sure a) why the probabilities differ in the profile relative to the seed alignment, or b) how to filter columns in the alignment by those that have a match in the model (see columns 4-6 in the alignment, which are gaps in the model).</div><div><br></div><div>I think if I can answer b) then the answer to a) will be, "look at the full alignment".</div><div><br></div><div>Here is my crude 'best guess' code:</div><div><br></div><div><div style="color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(197,134,192)">import</span> <span style="color:rgb(78,201,176)">gzip</span></div><div><span style="color:rgb(197,134,192)">import</span> <span style="color:rgb(78,201,176)">Bio</span>.<span style="color:rgb(78,201,176)">AlignIO</span></div><br><div><span style="color:rgb(106,153,85)"># msa = "PF08241.alignment.full.gz"</span></div><div><span style="color:rgb(156,220,254)">msa</span> <span style="color:rgb(212,212,212)">=</span> <span style="color:rgb(206,145,120)">"PF08241.alignment.seed.gz"</span></div><br><div><span style="color:rgb(197,134,192)">with</span> <span style="color:rgb(78,201,176)">gzip</span>.<span style="color:rgb(220,220,170)">open</span>(<span style="color:rgb(156,220,254)">msa</span>, <span style="color:rgb(206,145,120)">"rt"</span>) <span style="color:rgb(197,134,192)">as</span> <span style="color:rgb(156,220,254)">handle</span>:</div><div>    <span style="color:rgb(156,220,254)">align</span> <span style="color:rgb(212,212,212)">=</span> <span style="color:rgb(78,201,176)">Bio</span>.<span style="color:rgb(78,201,176)">AlignIO</span>.<span style="color:rgb(220,220,170)">read</span>(<span style="color:rgb(156,220,254)">handle</span>, <span style="color:rgb(206,145,120)">"stockholm"</span>)</div><div>    <span style="color:rgb(156,220,254)">ncols</span> <span style="color:rgb(212,212,212)">=</span> <span style="color:rgb(156,220,254)">align</span>.<span style="color:rgb(220,220,170)">get_alignment_length</span>()</div><br><div>    <span style="color:rgb(197,134,192)">for</span> <span style="color:rgb(156,220,254)">col</span> <span style="color:rgb(197,134,192)">in</span> <span style="color:rgb(78,201,176)">range</span>(<span style="color:rgb(156,220,254)">ncols</span>):</div><div>        <span style="color:rgb(156,220,254)">amino_acids</span> <span style="color:rgb(212,212,212)">=</span> <span style="color:rgb(78,201,176)">dict</span>()</div><div>        <span style="color:rgb(197,134,192)">for</span> <span style="color:rgb(156,220,254)">s</span> <span style="color:rgb(197,134,192)">in</span> <span style="color:rgb(156,220,254)">align</span>[:, <span style="color:rgb(156,220,254)">col</span>]:</div><div>            <span style="color:rgb(156,220,254)">amino_acids</span>[<span style="color:rgb(156,220,254)">s</span>] <span style="color:rgb(212,212,212)">=</span> <span style="color:rgb(156,220,254)">amino_acids</span>.<span style="color:rgb(220,220,170)">get</span>(<span style="color:rgb(156,220,254)">s</span>, <span style="color:rgb(181,206,168)">0</span>) <span style="color:rgb(212,212,212)">+</span> <span style="color:rgb(181,206,168)">1</span></div><div>        <span style="color:rgb(220,220,170)">print</span>(<span style="color:rgb(156,220,254)">amino_acids</span>)</div><div>        <span style="color:rgb(197,134,192)">for</span> <span style="color:rgb(156,220,254)">s</span> <span style="color:rgb(197,134,192)">in</span> <span style="color:rgb(156,220,254)">amino_acids</span>:</div><div>            <span style="color:rgb(220,220,170)">print</span>(<span style="color:rgb(86,156,214)">f</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(86,156,214)">{</span><span style="color:rgb(156,220,254)">s</span><span style="color:rgb(86,156,214)">}</span><span style="color:rgb(206,145,120)">: </span><span style="color:rgb(86,156,214)">{</span><span style="color:rgb(156,220,254)">amino_acids</span>[<span style="color:rgb(156,220,254)">s</span>]<span style="color:rgb(86,156,214)">:3d}</span><span style="color:rgb(206,145,120)"> </span><span style="color:rgb(86,156,214)">{</span><span style="color:rgb(156,220,254)">amino_acids</span>[<span style="color:rgb(156,220,254)">s</span>] <span style="color:rgb(212,212,212)">/</span> <span style="color:rgb(220,220,170)">len</span>(<span style="color:rgb(156,220,254)">align</span>)<span style="color:rgb(86,156,214)">:.3f}</span><span style="color:rgb(206,145,120)">"</span>)</div><br></div></div><div><br></div><div><br></div><div>I have the feeling I'm doin it rong...</div><div><br></div><div>The above is just a 'warm up', really I want to see the conservation score, base by base on a given protein in the alignment (where it matches the model).</div><div><br></div><div>Many thanks for any suggestions, and sorry for not being able to find the right document to answer these questions.</div><div><br></div><div><br></div><div>kthxbi,</div><div>Dan.</div></div>