git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c6d5255
)
JAL-3187 read peptide variant from CSQ:HGVSp if present (VCF/VEP data)
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Wed, 20 Feb 2019 12:15:06 +0000
(12:15 +0000)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Wed, 20 Feb 2019 12:15:06 +0000
(12:15 +0000)
src/jalview/datamodel/MappedFeatures.java
patch
|
blob
|
history
diff --git
a/src/jalview/datamodel/MappedFeatures.java
b/src/jalview/datamodel/MappedFeatures.java
index
07d3857
..
b69a103
100644
(file)
--- a/
src/jalview/datamodel/MappedFeatures.java
+++ b/
src/jalview/datamodel/MappedFeatures.java
@@
-86,10
+86,30
@@
public class MappedFeatures
baseCodon[1] = fromSeq.getCharAt(codonPos[1] - cdsStart);
baseCodon[2] = fromSeq.getCharAt(codonPos[2] - cdsStart);
baseCodon[1] = fromSeq.getCharAt(codonPos[1] - cdsStart);
baseCodon[2] = fromSeq.getCharAt(codonPos[2] - cdsStart);
- // todo avoid duplication of code in AlignmentUtils.buildDnaVariantsMap
-
for (SequenceFeature sf : features)
{
for (SequenceFeature sf : features)
{
+ /*
+ * VCF data may already contain the protein consequence
+ */
+ String hgvsp = sf.getValueAsString("CSQ", "HGVSp");
+ if (hgvsp != null)
+ {
+ int colonPos = hgvsp.indexOf(':');
+ if (colonPos >= 0)
+ {
+ String var = hgvsp.substring(colonPos + 1);
+ if (!vars.contains(var))
+ {
+ vars.add(var);
+ }
+ continue;
+ }
+ }
+
+ /*
+ * otherwise, compute codon and peptide variant
+ */
+ // todo avoid duplication of code in AlignmentUtils.buildDnaVariantsMap
int cdsPos = sf.getBegin();
if (cdsPos != sf.getEnd())
{
int cdsPos = sf.getBegin();
if (cdsPos != sf.getEnd())
{
@@
-138,7
+158,8
@@
public class MappedFeatures
String peptide = ResidueProperties.codonTranslate(codon);
if (fromResidue != peptide.charAt(0))
{
String peptide = ResidueProperties.codonTranslate(codon);
if (fromResidue != peptide.charAt(0))
{
- String to3 = StringUtils.toSentenceCase(
+ String to3 = ResidueProperties.STOP.equals(peptide) ? "STOP"
+ : StringUtils.toSentenceCase(
ResidueProperties.aa2Triplet.get(peptide));
String var = "p." + from3 + fromPosition + to3;
if (!vars.contains(var))
ResidueProperties.aa2Triplet.get(peptide));
String var = "p." + from3 + fromPosition + to3;
if (!vars.contains(var))