Skip to content

Commit

Permalink
demo
Browse files Browse the repository at this point in the history
  • Loading branch information
dadegrande99 committed Jul 20, 2024
1 parent 3002875 commit c6022bf
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions test-demo.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from alignmentfreegraph import AlignmentFreeGraph\n",
"db = AlignmentFreeGraph(configuration=\"credentials.json\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"db.query(\"MATCH ()-[r]->() RETURN COUNT(r) AS total_relationships\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"db.query(\"MATCH (n) RETURN COUNT(n) AS total_nodes\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"db.set_k(5)\n",
"ht = db.get_hashtable()\n",
"print(\"- Hash table with k=5\")\n",
"print(f\"- HashTable length: {len(ht)}\")\n",
"print(f\"- Number of paths: {len(set([arc for el in ht for arc in ht[el][1]]))}\")\n",
"ht"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"db.set_k(10)\n",
"ht = db.get_hashtable()\n",
"print(\"- Hash table with k=5\")\n",
"print(f\"- HashTable length: {len(ht)}\")\n",
"print(f\"- Number of paths: {len(set([arc for el in ht for arc in ht[el][1]]))}\")\n",
"ht\n",
"db.get_hashtable()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"test = \"GACCGAGACATTTATATAAC\"\n",
"db.sequence_from_hash(test)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit c6022bf

Please sign in to comment.