Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Release 1.0.2 - set expression to use RNA VAF by default instead of DNA VAF

See merge request tron/addannot!226
  • Loading branch information
franla23 committed Dec 16, 2022
2 parents a8d656a + 1a0df50 commit d5452a6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion neofox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.#


VERSION = "1.0.1"
VERSION = "1.0.2"


REFERENCE_FOLDER_ENV = "NEOFOX_REFERENCE_FOLDER"
Expand Down
4 changes: 2 additions & 2 deletions neofox/published_features/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def _get_expression_annotation(

def get_annotations(self, neoantigen: Neoantigen) -> List[Annotation]:

vaf = neoantigen.dna_variant_allele_frequency
vaf = neoantigen.rna_variant_allele_frequency
if vaf is None or vaf == -1:
vaf = neoantigen.rna_variant_allele_frequency
vaf = neoantigen.dna_variant_allele_frequency

return [
AnnotationFactory.build_annotation(
Expand Down
20 changes: 14 additions & 6 deletions neofox/tests/unit_tests/test_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from unittest import TestCase

from neofox.model.factories import NOT_AVAILABLE_VALUE
from neofox.model.factories import NOT_AVAILABLE_VALUE, NeoantigenFactory
from neofox.model.neoantigen import Neoantigen
from neofox.published_features.expression import Expression

Expand All @@ -30,20 +30,28 @@ def setUp(self) -> None:
self.expression = Expression()

def test_calculate_expression_mutation(self):
neoantigen = Neoantigen(rna_expression=12.0, dna_variant_allele_frequency=0.2)
neoantigen = NeoantigenFactory.build_neoantigen(
rna_expression=12.0, dna_variant_allele_frequency=0.2, patient_identifier="patient1",
mutated_xmer="DDDDD")
result = self.expression.get_annotations(neoantigen=neoantigen)[0]
self.assertGreater(result.value, "0.0")
self.assertGreater(float(result.value), 0.0)

# no reads for mut
neoantigen = Neoantigen(rna_expression=12.0, dna_variant_allele_frequency=0.0)
neoantigen = NeoantigenFactory.build_neoantigen(
rna_expression=12.0, dna_variant_allele_frequency=0.0, patient_identifier="patient1",
mutated_xmer="DDDDD")
result = self.expression.get_annotations(neoantigen=neoantigen)[0]
self.assertEqual(result.value, "0")

# no reads for mut/wt
neoantigen = Neoantigen(rna_expression=12.0, dna_variant_allele_frequency=-1, rna_variant_allele_frequency=-1)
neoantigen = NeoantigenFactory.build_neoantigen(
rna_expression=12.0, dna_variant_allele_frequency=-1, rna_variant_allele_frequency=-1, patient_identifier="patient1",
mutated_xmer="DDDDD")
result = self.expression.get_annotations(neoantigen=neoantigen)[0]
self.assertEqual(result.value, NOT_AVAILABLE_VALUE)

neoantigen = Neoantigen(rna_expression=None, dna_variant_allele_frequency=-1, rna_variant_allele_frequency=-1)
neoantigen = NeoantigenFactory.build_neoantigen(
rna_expression=None, dna_variant_allele_frequency=-1, rna_variant_allele_frequency=-1,
patient_identifier="patient1", mutated_xmer="DDDDD")
result = self.expression.get_annotations(neoantigen=neoantigen)[0]
self.assertEqual(result.value, NOT_AVAILABLE_VALUE)

0 comments on commit d5452a6

Please sign in to comment.