Example #1
0
def main():
    BRENDA_PARSER = BrendaParser()
    numbers =[]
    
    a = get_arguments()
    cutoff = a.cutoff
    anz = a.number

    for ec in BRENDA_PARSER.keys():
        n = str(ec).split(".")
        if len(n)<4:
            continue
        new = f"{n[0]}.{n[1]}.{n[2]}"
        if new not in numbers:
            numbers.append(new)

    f = open("config.txt", "w")
    for i in numbers:
        f.write(f"{i}\t{cutoff}\t{anz}\n")
    f.close()
Example #2
0
def main():
    a = get_arguments()
    BRENDA_PARSER = BrendaParser()
    cutoff = a.cutoff
    anz = a.number
    search = a.subtree

    dir_search = make_dir(search)
    enzyme_list = new_enzyme_list(BRENDA_PARSER)
    enzym_selection = select(enzyme_list, search)

    if get_structure_files(BRENDA_PARSER, enzym_selection, anz, cutoff,
                           dir_search):
        print("SUCCESS: Structures found and downloaded")
    else:
        print("ERROR: Not enough processible structures available")
Example #3
0
def main():
    a = get_arguments()
    BRENDA_PARSER = BrendaParser()
    cutoff = snakemake.input[2]
    anz = snakemake.input[1]
    search = snakemake.input[0]
    output = snakemake.output[0]

    dir_search = make_dir(search, output)
    enzyme_list = new_enzyme_list(BRENDA_PARSER)
    enzym_selection = select(enzyme_list, search)

    if get_structure_files(enzym_selection,anz,cutoff,dir_search,BRENDA_PARSER):
        print("SUCCESS: Structures found and downloaded")
    else:
        print("ERROR: Not enough processible structures available")
Example #4
0
def main():
    a = get_arguments()
    BRENDA_PARSER = BrendaParser()
    cutoff = a.cutoff
    anz = a.number
    search = a.subtree
    output = a.output

    dir_search = make_dir(search, output)
    enzyme_list = new_enzyme_list(BRENDA_PARSER)
    enzym_selection = select(enzyme_list, search)

    get_structure_files(enzym_selection, anz, cutoff, dir_search,
                        BRENDA_PARSER)

    print("habe fertig!")
Example #5
0
def test_parsing():
    brenda = BrendaParser()
    assert brenda
    assert "1.1.1.1" in brenda.ec_text
Example #6
0
def test_parsing_from_file():
    brenda = BrendaParser(brenda_file=BRENDA_FILE)
    assert brenda
    assert "1.1.1.1" in brenda.ec_text
Example #7
0
import pytest
import logging
from brendapy import BrendaParser, BrendaProtein
from brendapy.settings import BRENDA_FILE

BRENDA_PARSER = BrendaParser()


def test_parsing():
    brenda = BrendaParser()
    assert brenda
    assert "1.1.1.1" in brenda.ec_text


def test_parsing_from_file():
    brenda = BrendaParser(brenda_file=BRENDA_FILE)
    assert brenda
    assert "1.1.1.1" in brenda.ec_text


def test_protein1():
    """ Test the proteinBRENDA module """
    ec = "1.1.1.1"
    proteins = BRENDA_PARSER.get_proteins(ec)
    assert proteins
    assert len(proteins) == 167


def test_protein_detail1():
    proteins = BRENDA_PARSER.get_proteins(ec="1.1.1.1")
    protein = proteins[1]
Example #8
0
import csv
import libsbml
import re
from statistics import median

import sys
# to get information out of brenda:
from brendapy import BrendaParser

# to calculate the geometric mean in an easy way
from scipy.stats.mstats import gmean

import pickle
from ipywidgets.widgets.interaction import empty

BRENDA_PARSER = BrendaParser()  # reuse parser


def main():

    # go to directory containing the xml files
    # TODO: make path relative
    project_dir = '/Users/medeafux/Desktop/ETH/Masterarbeit/enzyme_cost'
    model_dir = '/Users/medeafux/Desktop/ETH/Masterarbeit//Bacterial-RBA-models/Escherichia-coli-K12-WT'

    os.chdir(model_dir)

    # extract composition of all macrocomponents and save them as a list (?) of macromolecules (class)
    tree = etree.parse("proteins.xml")
    root = tree.getroot()
    # get to the list of Macromolecules