Skip to content

Commit

Permalink
import constants from relna, not nalaf -- Rostlab/nalaf#155
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmirocks committed Jun 24, 2016
1 parent 061b1c3 commit 338fcc9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion relna.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pkg_resources

from nalaf.utils import PRO_CLASS_ID, MUT_CLASS_ID, PRO_REL_MUT_CLASS_ID
from relna.utils import PRO_CLASS_ID, MUT_CLASS_ID, PRO_REL_MUT_CLASS_ID
from nalaf.utils.readers import TextFilesReader, PMIDReader
from nalaf.utils.readers import StringReader
from nalaf.utils.writers import TagTogFormat, PubTatorFormat
Expand Down
5 changes: 1 addition & 4 deletions relna/learning/svmlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
import sys
import subprocess
import pkg_resources

from nalaf.structures.data import Label
from nalaf.utils import MUT_CLASS_ID
from random import random, seed
from random import random


class SVMLightTreeKernels:
Expand Down
2 changes: 1 addition & 1 deletion relna/learning/taggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from relna.utils.swissprot_utils import Swissprot
from relna.utils.go_utils import GOTerms
from nalaf.structures.data import Entity, Relation
from nalaf.utils import MUT_CLASS_ID, PRO_CLASS_ID, PRO_REL_MUT_CLASS_ID, ENTREZ_GENE_ID, UNIPROT_ID
from relna.utils import MUT_CLASS_ID, PRO_CLASS_ID, ENTREZ_GENE_ID, UNIPROT_ID
from nalaf.learning.taggers import Tagger


Expand Down
12 changes: 12 additions & 0 deletions relna/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
THRESHOLD_VALUE = 1

# TODO The constants should be renamed. Do not make sense in relna.
# Copied from nalaf directly for historical reasons.

PRO_CLASS_ID = 'e_1'
MUT_CLASS_ID = 'e_2'
ORG_CLASS_ID = 'e_3'
PRO_REL_MUT_CLASS_ID = 'r_4' # e_1/e_2
PRO_REL_ORG_CLASS_ID = 'r_5' # e_1/e_3
ENTREZ_GENE_ID = 'n_4'
UNIPROT_ID = 'n_5'
2 changes: 1 addition & 1 deletion relna/utils/writers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from itertools import chain
import sys
import os
from nalaf.utils import MUT_CLASS_ID, PRO_CLASS_ID
from relna.utils import MUT_CLASS_ID, PRO_CLASS_ID


class RelnaConsoleWriter:
Expand Down

0 comments on commit 338fcc9

Please sign in to comment.