Skip to content

Commit b18add3

Browse files
chores: clean up Ruff issues in quickstart_demo.ipynb
1 parent a52cf9c commit b18add3

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

notebooks/quickstart_demo.ipynb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"# 1. Standard library imports\n",
130130
"import sys\n",
131131
"\n",
132-
"sys.path.append(\"/home/ecarreno/SSC-Projects/b_REPOSITORIES/ontograph\")\n",
132+
"sys.path.append('/home/ecarreno/SSC-Projects/b_REPOSITORIES/ontograph')\n",
133133
"\n",
134134
"from pathlib import Path\n",
135135
"\n",
@@ -167,7 +167,7 @@
167167
"metadata": {},
168168
"outputs": [],
169169
"source": [
170-
"cache_dir = Path(\"../data/out\")"
170+
"cache_dir = Path('../data/out')"
171171
]
172172
},
173173
{
@@ -266,7 +266,7 @@
266266
"source": [
267267
"# This function looks if the given ontology has a link with a given extension\n",
268268
"\n",
269-
"print(\"Link: {}\".format(onto_registry.get_download_url(\"chebi\", \"obo\")))"
269+
"print('Link: {}'.format(onto_registry.get_download_url('chebi', 'obo')))"
270270
]
271271
},
272272
{
@@ -282,7 +282,7 @@
282282
"metadata": {},
283283
"outputs": [],
284284
"source": [
285-
"print(onto_registry.get_available_formats(ontology_id=\"chebi\"))"
285+
"print(onto_registry.get_available_formats(ontology_id='chebi'))"
286286
]
287287
},
288288
{
@@ -326,18 +326,18 @@
326326
"source": [
327327
"# Put the ontologies and their formats as a dictionary\n",
328328
"resources = [\n",
329-
" {\"name_id\": \"chebi\", \"format\": \"owl\"},\n",
330-
" {\"name_id\": \"go\", \"format\": \"obo\"},\n",
331-
" {\"name_id\": \"ado\", \"format\": \"owl\"},\n",
329+
" {'name_id': 'chebi', 'format': 'owl'},\n",
330+
" {'name_id': 'go', 'format': 'obo'},\n",
331+
" {'name_id': 'ado', 'format': 'owl'},\n",
332332
"]\n",
333333
"\n",
334334
"# Use the downloader, it has a cache in case you have already downloaded the ontologies.\n",
335335
"batch_results = downloader.fetch_batch(resources)\n",
336336
"\n",
337337
"# Print all the paths where your ontologies are located\n",
338-
"print(\"Ontologies in cache:\")\n",
338+
"print('Ontologies in cache:')\n",
339339
"for ontology_name, ontology_path in batch_results.items():\n",
340-
" print(f\"\\t{ontology_name}: {ontology_path}\")"
340+
" print(f'\\t{ontology_name}: {ontology_path}')"
341341
]
342342
},
343343
{
@@ -376,13 +376,13 @@
376376
"metadata": {},
377377
"outputs": [],
378378
"source": [
379-
"name_id_go = \"go\"\n",
380-
"format_go = \"obo\"\n",
379+
"name_id_go = 'go'\n",
380+
"format_go = 'obo'\n",
381381
"\n",
382382
"gene_ontology = ontology_loader.load(name_id=name_id_go, format=format_go)\n",
383383
"\n",
384-
"print(f\"Loaded ontology: {name_id_go}.{format_go}\")\n",
385-
"print(f\"Number of terms: {len(gene_ontology.terms())}\")"
384+
"print(f'Loaded ontology: {name_id_go}.{format_go}')\n",
385+
"print(f'Number of terms: {len(gene_ontology.terms())}')"
386386
]
387387
},
388388
{
@@ -400,7 +400,7 @@
400400
"source": [
401401
"# term_id = \"GO:0008150\" # biological_process\n",
402402
"# term_id = \"GO:0160266\" # anestrus phase\n",
403-
"term_id = \"GO:0070360\" # symbiont-mediated actin polymerization-dependent cell-to-cell migration in host"
403+
"term_id = 'GO:0070360' # symbiont-mediated actin polymerization-dependent cell-to-cell migration in host"
404404
]
405405
},
406406
{
@@ -412,9 +412,9 @@
412412
"queries = OntologyQueries(gene_ontology)\n",
413413
"\n",
414414
"# Print term relations\n",
415-
"print(f\"Term: {term_id}\")\n",
416-
"print(f\" Parents : {queries.ancestors(term_id)}\")\n",
417-
"print(f\" Children : {queries.descendants(term_id)}\")\n",
415+
"print(f'Term: {term_id}')\n",
416+
"print(f' Parents : {queries.ancestors(term_id)}')\n",
417+
"print(f' Children : {queries.descendants(term_id)}')\n",
418418
"\n",
419419
"\n",
420420
"# print(f\" Ancestors : {queries.ancestors(term_id)}\")\n",
@@ -458,7 +458,7 @@
458458
"outputs": [],
459459
"source": [
460460
"# Load the ontogragh catalog of ontologies\n",
461-
"onto_registry = op.registry(\"../data/out\")"
461+
"onto_registry = op.registry('../data/out')"
462462
]
463463
},
464464
{
@@ -508,7 +508,7 @@
508508
"outputs": [],
509509
"source": [
510510
"# You can get the metadata of each ontology and store it in a variable. At the same time, you can print it using `show_metadata=True`\n",
511-
"go_metadata = onto_registry.get_ontology_metadata(\"go\", show_metadata=True)"
511+
"go_metadata = onto_registry.get_ontology_metadata('go', show_metadata=True)"
512512
]
513513
},
514514
{
@@ -518,7 +518,7 @@
518518
"outputs": [],
519519
"source": [
520520
"# The catalog contains different formats for the same ontology. You can verify all the formats available for a specific ontology.\n",
521-
"onto_registry.get_available_formats(\"chebi\")"
521+
"onto_registry.get_available_formats('chebi')"
522522
]
523523
},
524524
{

0 commit comments

Comments
 (0)