Skip to content

Commit

Permalink
Last fixes regarding pathway download
Browse files Browse the repository at this point in the history
  • Loading branch information
Maluuck committed Dec 13, 2023
1 parent 9cf8c8e commit 9d3d6bb
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions backend/src/pathway_data/pathway_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,18 @@ def read_data(species, file_name):
for line in f:
fields = line.strip().split("\t")
name = fields[0].split("%")
source = name[1]
ids = name[2]
descr = fields[1]
symbols = fields[2:]
# Exclude lines where source starts with "REACTOME"
if not source.startswith("REACTOME"):
data.append([ids, descr, source, symbols])
symbol.append(symbols)
unique_symbols.update(symbols)
if len(name) >= 2:
source = name[1]
ids = name[2]
descr = fields[1]
symbols = fields[2:]
# Exclude lines where source starts with "REACTOME"
if not source.startswith("REACTOME"):
data.append([ids, descr, source, symbols])
symbol.append(symbols)
unique_symbols.update(symbols)
else:
pass

unique_symbols = list(unique_symbols)
gene_mapping, genes_to_map = symbols_to_ensembl(unique_symbols, f"{species}", "gene")
Expand Down

0 comments on commit 9d3d6bb

Please sign in to comment.