--- /dev/null
+import jalview.datamodel.SequenceFeature
+import jalview.gui.Desktop
+def af = jalview.bin.Jalview.currentAlignFrame
+def av = af.viewport
+def fr = Desktop.getAlignFrameFor(av.codingComplement).getFeatureRenderer()
+def counts = 0
+def countm = 0
+for (seq in av.alignment.sequences)
+{
+ ds = seq.datasetSequence
+ for (res = ds.start ; res <= ds.end; res++)
+ {
+ mf = fr.findComplementFeaturesAtResidue(seq, res)
+ if (mf != null)
+ {
+ for (feature in mf.features)
+ {
+ variant = mf.findProteinVariants(feature)
+ if (!"".equals(variant))
+ {
+ type = variant.contains("=") ? "synonymous_variant" : "missense_variant"
+ if (type.equals("synonymous_variant")) counts++ else countm++;
+ sf = new SequenceFeature(type, variant, res, res, null)
+ seq.addSequenceFeature(sf)
+ }
+ }
+ }
+ }
+}
+af.getFeatureRenderer().featuresAdded()
+af.alignPanel.paintAlignment(true, true)
+println "Added " + countm + " missense and " + counts + " synonymous variants"
\ No newline at end of file
for more information.
</p>
<p>
+ <strong>Working with variants without CSQ fields</strong>
+ </p>
+ <p>
+ <a name="computepepvariants">Jalview 2.11.1's new virtual
+ features</a> mean that peptide sequences are no longer annotated
+ directly with protein missense variants. This makes it harder to
+ filter variants when they do not already include the CSQ field. You
+ can rescue the pre-2.11.1 functionality by:
+ </p>
+ <ol>
+ <li>Download the script at
+ https://www.jalview.org/examples/groovy/ComputePeptideVariants.groovy</li>
+ <li>Executing the script via the <a href="groovy.html">Groovy
+ Console</a> on a linked CDS/Protein view to create missense and
+ synonymous peptide variant features.
+ </li>
+ </ol>
+ <p>
<strong>Working with variants from organisms other than
H.sapiens.</strong>
</p>
to stdout containing the consensus sequence for each
alignment in a Jalview session
</li>
+ <li>
+ <!-- JAL-3578 -->ComputePeptideVariants.groovy to translate
+ genomic sequence_variant annotation from CDS as
+ missense_variant or synonymous_variant on protein products.
+ </li>
</ul>
</td>
<td align="left" valign="top">
<a href="features/splitView.html#virtualfeats">Sequence
Features dialog</a>. This allows more analyses of nucleotide and
peptide sequence features on alignments in a more flexible and
- memory efficient way than in earlier versions.</li>
+ memory efficient way than in earlier versions.<br />
+ <em>Note: Virtual features work best when variants are
+ annotated with CSQ fields. Please <a
+ href="features/importvcf.html#computepepvariants">see this
+ Groovy script workaround</a> if you are working with VCF files
+ without CSQ fields.
+ </em></li>
<li><strong>Improved VCF data import</strong><br /> <a
href="features/importvcf.html#attribs">Standard attributes for
filtering variants</a> (e.g. position, QUAL field etc) are now