-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
100,297 additions
and
2,674 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pandas | ||
openpyxl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add robot templates here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pandas as pd | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description='Process some integers.') | ||
parser.add_argument('infile', | ||
help='Path to csv for input') | ||
parser.add_argument('outfile', help='Path to output ') | ||
args = parser.parse_args() | ||
|
||
df = pd.read_csv(args.infile, sep='\t') | ||
|
||
# remove rows with generic classification (regional part of brain) | ||
unwanted_uberon_mappings = ['<http://purl.obolibrary.org/obo/UBERON_0002616>'] | ||
df.rename(columns={'?sup': 'superclass_iri', '?supname': 'superclass_name', | ||
'?sub': 'subclass_iri', '?subname': 'subclass_name'}, inplace=True) | ||
filtered_df = df[~df.superclass_iri.isin(unwanted_uberon_mappings)] | ||
|
||
|
||
def gen_ols_xls_link(row): | ||
ont_name = 'uberon' | ||
link = 'https://www.ebi.ac.uk/ols/ontologies/%s/terms?iri=%s' \ | ||
'' % (ont_name, | ||
row['superclass_iri'].replace('>', '').replace('<', '')) | ||
return'=HYPERLINK("%s","%s")' % (link, row['superclass_name']) | ||
#urllib.parse.quote() | ||
|
||
filtered_df.insert(0, 'superclass_name_linked', | ||
value=filtered_df.apply( | ||
lambda row: gen_ols_xls_link(row), axis=1)) | ||
|
||
filtered_df.drop(columns=['superclass_name'], inplace=True) | ||
|
||
filtered_df.to_excel(args.outfile, header=True, index=False) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | ||
|
||
SELECT DISTINCT ?supname ?sup ?subname ?sub | ||
WHERE { | ||
{ ?sub rdfs:subClassOf ?sup . | ||
?sub rdfs:label ?subname . | ||
?sup rdfs:label ?supname . | ||
} | ||
FILTER (STRSTARTS(STR(?sup), "http://purl.obolibrary.org/obo/UBERON_")) | ||
# Can't get double filter to work! | ||
# FILTER (!STRENDS(STR(?sup), "UBERON_0002616")) # ignore generic uberon classification | ||
FILTER (!STRSTARTS(STR(?sub), "http://purl.obolibrary.org/obo/UBERON_")) | ||
} | ||
ORDER BY ?supname |