Exemple #1
0
def open_files():

    global annotated_seqs_file, seqs_filtration_file, csv_output_file, extra_tracks_files

    annotated_seqs_file = open(project_paths.get_annotated_seqs_file_path(), 'rb')
    seqs_filtration_file = open(project_paths.get_filtered_seqs_file_path(), 'rb')
    csv_output_file = open(output_file_path, 'wb')

    if advanced:
        for track_name, track_file_path in project_paths.get_track_file_paths().items():
            extra_tracks_files[track_name] = open(track_file_path, 'rb')
Exemple #2
0
def open_files():

    global annotated_seqs_file, seqs_filtration_file, csv_output_file, extra_tracks_files

    annotated_seqs_file = open(project_paths.get_annotated_seqs_file_path(),
                               'rb')
    seqs_filtration_file = open(project_paths.get_filtered_seqs_file_path(),
                                'rb')
    csv_output_file = open(output_file_path, 'wb')

    if advanced:
        for track_name, track_file_path in project_paths.get_track_file_paths(
        ).items():
            extra_tracks_files[track_name] = open(track_file_path, 'rb')
Exemple #3
0
'''

import sys
import re
import xml.etree.ElementTree as et
from StringIO import StringIO

from cleavepred import util
from cleavepred import project_paths

project_paths.dataset_name = 'uniprot'

if len(sys.argv) > 1:
    output_file_path = sys.argv[1]
else:
    output_file_path = project_paths.get_annotated_seqs_file_path()


def get_unique(element, xpath):

    subelements = element.findall(xpath)

    if len(subelements) == 0:
        return None
    if len(subelements) == 1:
        return subelements[0]
    else:
        raise Exception('%d subelements: %s' % (len(subelements), xpath))


def parse_uniprot_xml(raw_xml_path):
'''

import sys
import re
import xml.etree.ElementTree as et
from StringIO import StringIO

from cleavepred import util
from cleavepred import project_paths

project_paths.dataset_name = 'uniprot'

if len(sys.argv) > 1:
    output_file_path = sys.argv[1]
else:
    output_file_path = project_paths.get_annotated_seqs_file_path()

def get_unique(element, xpath):

    subelements = element.findall(xpath)

    if len(subelements) == 0:
        return None
    if len(subelements) == 1:
        return subelements[0]
    else:
        raise Exception('%d subelements: %s' % (len(subelements), xpath))

def parse_uniprot_xml(raw_xml_path):
    raw = util.read_file(raw_xml_path)
    fixed_raw = re.sub(r'xmlns="[^"]*"', '', raw)