Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
c737e516
Commit
c737e516
authored
Sep 24, 2018
by
Piotr Gawron
Browse files
gene variants can store information about amino acid change
parent
a89e2f70
Pipeline
#6546
failed with stage
in 6 minutes and 39 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
frontend-js/src/main/js/map/data/GeneVariant.js
View file @
c737e516
...
...
@@ -9,7 +9,8 @@
* @param {string} javaObject.referenceGenomeType
* @param {string} javaObject.referenceGenomeVersion
* @param {string} javaObject.contig
* @param {null|number} [javaObject.allelFrequency]
* @param {string} [javaObject.aminoAcidChange]
* @param {null|string} [javaObject.allelFrequency]
* @param {null|string} [javaObject.variantIdentifier]
*
* @constructor
...
...
@@ -23,8 +24,25 @@ function GeneVariant(javaObject) {
this
.
setContig
(
javaObject
.
contig
);
this
.
setAllelFrequency
(
javaObject
.
allelFrequency
);
this
.
setVariantIdentifier
(
javaObject
.
variantIdentifier
);
this
.
setAminoAcidChange
(
javaObject
.
aminoAcidChange
);
}
/**
*
* @param {string} aminoAcidChange
*/
GeneVariant
.
prototype
.
setAminoAcidChange
=
function
(
aminoAcidChange
)
{
this
.
_aminoAcidChange
=
aminoAcidChange
;
};
/**
*
* @returns {string}
*/
GeneVariant
.
prototype
.
getAminoAcidChange
=
function
()
{
return
this
.
_aminoAcidChange
;
};
/**
*
* @param {number} position
...
...
@@ -91,13 +109,13 @@ GeneVariant.prototype.getContig = function () {
/**
*
* @param {
number
} allelFrequency
* @param {
string
} allelFrequency
*/
GeneVariant
.
prototype
.
setAllelFrequency
=
function
(
allelFrequency
)
{
if
(
allelFrequency
===
null
)
{
this
.
_allelFrequency
=
undefined
;
}
else
{
this
.
_allelFrequency
=
allelFrequency
;
this
.
_allelFrequency
=
parseFloat
(
allelFrequency
)
;
}
};
...
...
frontend-js/src/test/js/map/data/GeneVariant-test.js
View file @
c737e516
...
...
@@ -5,6 +5,7 @@ var assert = require('assert');
describe
(
'
GeneVariant
'
,
function
()
{
it
(
"
constructor
"
,
function
()
{
// noinspection SpellCheckingInspection
var
data
=
{
position
:
12
,
originalDna
:
"
A
"
,
...
...
@@ -13,7 +14,8 @@ describe('GeneVariant', function () {
referenceGenomeVersion
:
"
v1
"
,
contig
:
"
1
"
,
allelFrequency
:
"
0.2
"
,
variantIdentifier
:
"
id
"
variantIdentifier
:
"
id
"
,
aminoAcidChange
:
"
LRRK2:NM_198578:exon1:c.T45C:p.T15T
"
};
var
variant
=
new
GeneVariant
(
data
);
assert
.
equal
(
variant
.
getPosition
(),
data
.
position
);
...
...
@@ -24,5 +26,6 @@ describe('GeneVariant', function () {
assert
.
equal
(
variant
.
getAllelFrequency
(),
data
.
allelFrequency
);
assert
.
equal
(
variant
.
getVariantIdentifier
(),
data
.
variantIdentifier
);
assert
.
equal
(
variant
.
getReferenceGenomeVersion
(),
data
.
referenceGenomeVersion
);
assert
.
equal
(
variant
.
getAminoAcidChange
(),
data
.
aminoAcidChange
);
});
});
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment