Commit e2b2cea3 authored by Till Bald's avatar Till Bald

[FIX] crosslinx can be executed from an outside dir

parent eb4f8171
Pipeline #8762203 (#) passed with stages
in 64 minutes and 51 seconds
......@@ -19,6 +19,7 @@ along with Proteomatic. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import sys
import os
import csv
import heapq # for heapq.nlargest()
import re
......@@ -26,6 +27,11 @@ from copy import deepcopy
from operator import itemgetter as itemgetter
from collections import defaultdict
# change the current directory so that all submodules etc can work as usual
# the current directory has to be the directory where crosslinx.py is stored
current_file_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(current_file_path)
sys.path.append('./include/python')
# pylint: disable=wrong-import-position
import proteomatic
......@@ -41,7 +47,6 @@ PROTON_MASS_INTERNAL_PRECISION = proteomicsKnowledge.proteomicsKnowledge[
'protonMass_internal']
ISOTOPE_AVERAGE_DIFFERENCE = 1.002
class Crosslinx(proteomatic.ProteomaticScript):
'''
Class to instantiate Proteomatic background
......
......@@ -28,10 +28,10 @@ class ProteomaticScript(object):
def __init__(self, commands = copy(sys.argv)):
scriptDir,scriptFilename = os.path.split(commands.pop(0))
#currentDir = os.path.abspath(currentDir)
#completeScriptPath = os.path.join(currentDir,scriptFilename)
#os.chdir(currentDir)
# scriptDir is a relative path, but we need an absolute path
# in the current structure, this file is in two folders,
# so we need to get back to the directory of crosslinx.py by ../..
scriptDir = os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../.."))
pathToRuby = "ruby"
# detect the OS to decide on which ruby to use
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment