Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
+ modified requirements
+ minor function changes
+ minor adaptions of notebooks (remove paths)
  • Loading branch information
chris-huetter committed Mar 18, 2022
1 parent a31e7e8 commit 6f1eb15
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 47 deletions.
3 changes: 2 additions & 1 deletion Requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ colormath==3.0.0
umap-learn==0.5.0
pandas==1.3.1
numpy==1.19.2
biopython==0.7.4
bio==0.7.4
biopython==1.79
html2image==2.0.1
python_igraph==0.9.6
scikit_learn==0.24.2
Expand Down
20 changes: 14 additions & 6 deletions cartoGRAPHs_AQuickStarter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"id": "blocked-journalism",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"G = nx.scale_free_graph(n=1000)"
"G = nx.scale_free_graph(n=100)"
]
},
{
Expand All @@ -57,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 10,
"id": "f7dac009-f8cc-4705-8608-22eee785e233",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -95,7 +95,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 11,
"id": "4df461bd-874e-403b-9b79-d227439804d6",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -155,7 +155,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 12,
"id": "respective-plumbing",
"metadata": {
"tags": []
Expand Down Expand Up @@ -195,7 +195,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 13,
"id": "noted-thompson",
"metadata": {},
"outputs": [],
Expand All @@ -222,6 +222,14 @@
" colors = None\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f7068290-7cdf-4d2b-ad04-4c44651f9b85",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
81 changes: 49 additions & 32 deletions cartoGRAPHs_ExemplaryNotebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "fc201309-484c-475d-9c9e-85f35a74b6fc",
"metadata": {},
"outputs": [],
Expand All @@ -48,14 +48,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "blocked-journalism",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"G = nx.scale_free_graph(n=1000)\n",
"G = nx.scale_free_graph(n=100)\n",
"\n",
"l_nodefeatures = ['nodeID:'+str(i) for i in list(G.nodes())]\n",
"d_nodefeatures = dict(zip(G.nodes(),l_nodefeatures))\n",
Expand Down Expand Up @@ -93,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"id": "f7dac009-f8cc-4705-8608-22eee785e233",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -153,10 +153,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "560d27d0-698f-4509-802a-64a56f084f73",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/chris/opt/anaconda3/lib/python3.8/site-packages/umap/umap_.py:125: UserWarning: A few of your vertices were disconnected from the manifold. This shouldn't cause problems.\n",
"Disconnection_distance = 1 has removed 6730 edges.\n",
"It has only fully disconnected 1 vertices.\n",
"Use umap.utils.disconnected_vertices() to identify them.\n",
" warn(\n",
"/Users/chris/opt/anaconda3/lib/python3.8/site-packages/umap/umap_.py:125: UserWarning: A few of your vertices were disconnected from the manifold. This shouldn't cause problems.\n",
"Disconnection_distance = 1 has removed 6730 edges.\n",
"It has only fully disconnected 1 vertices.\n",
"Use umap.utils.disconnected_vertices() to identify them.\n",
" warn(\n"
]
}
],
"source": [
"posG2D = generate_layout(G, \n",
" dim = 2, \n",
Expand Down Expand Up @@ -187,7 +204,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 9,
"id": "0ae5605c-bf2c-409a-b207-e479e2979de3",
"metadata": {},
"outputs": [],
Expand All @@ -207,16 +224,16 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 10,
"id": "fbf90b22-ed6b-4b7d-9b33-4364ffd1f1ee",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 1min 30s, sys: 8.45 s, total: 1min 38s\n",
"Wall time: 1min 4s\n"
"CPU times: user 1min 21s, sys: 8.21 s, total: 1min 29s\n",
"Wall time: 53.5 s\n"
]
}
],
Expand All @@ -234,16 +251,16 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 11,
"id": "de619bd2-17b9-4a86-940c-f32ed8d0f85a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 1min 52s, sys: 7.22 s, total: 1min 59s\n",
"Wall time: 47.1 s\n"
"CPU times: user 1min 13s, sys: 4.44 s, total: 1min 17s\n",
"Wall time: 33 s\n"
]
}
],
Expand Down Expand Up @@ -283,12 +300,12 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 16,
"id": "liked-newfoundland",
"metadata": {},
"outputs": [],
"source": [
"scale_factor = 2\n",
"scale_factor = 0.5\n",
"nodesize = list(draw_node_degree(G, scale_factor).values())\n",
"d_nodesize = dict(draw_node_degree(G, scale_factor))"
]
Expand Down Expand Up @@ -316,7 +333,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 13,
"id": "df9d820e-9fb6-44f5-8441-6e836d0fa8e7",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -389,17 +406,17 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 17,
"id": "4df461bd-874e-403b-9b79-d227439804d6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'output_plots/2Dlayouts/2Dportrait_global.html'"
"'2Dportrait_precalculated.html'"
]
},
"execution_count": 34,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -410,10 +427,10 @@
" d_colors = d_nodecolors, \n",
" d_size = d_nodesize, \n",
" d_legend = d_nodelegend,\n",
" path = 'output_plots/2Dlayouts/', \n",
" path = '', \n",
" fname = '2Dportrait'+'_'+layout_method, \n",
" scheme = 'light',\n",
" #with_edges = False\n",
" with_edges = False\n",
" )"
]
},
Expand All @@ -434,7 +451,7 @@
"metadata": {},
"outputs": [],
"source": [
"export_to_csv2D(path = 'output_plots/VRlayouts/', \n",
"export_to_csv2D(path = '', \n",
" layout_namespace = '2Dportrait'+'_'+layout_method, \n",
" posG2D, \n",
" nodecolors)"
Expand All @@ -452,17 +469,17 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 18,
"id": "81114f28-9d9d-4157-9ead-6d252d42f956",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'output_plots/3Dlayouts/3Dportrait_global.html'"
"'3Dportrait_precalculated.html'"
]
},
"execution_count": 33,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -473,10 +490,10 @@
" d_colors = d_nodecolors, \n",
" d_size = d_nodesize, \n",
" d_legend = d_nodelegend,\n",
" path = 'output_plots/3Dlayouts/', \n",
" path = '', \n",
" fname = '3Dportrait'+'_'+layout_method, \n",
" scheme = 'dark',\n",
" #with_edges = False\n",
" with_edges = False\n",
" )"
]
},
Expand All @@ -495,7 +512,7 @@
"metadata": {},
"outputs": [],
"source": [
"export_to_csv3D(path = 'output_plots/VRlayouts/', \n",
"export_to_csv3D(path = '', \n",
" layout_namespace = '3Dportrait'+layout_method, \n",
" posG3D, \n",
" nodecolors)"
Expand Down Expand Up @@ -542,7 +559,7 @@
" d_colors = d_nodecolors, \n",
" d_size = d_nodesize, \n",
" d_legend = d_nodelegend,\n",
" path = 'output_plots/3Dlayouts/', \n",
" path = '', \n",
" fname = 'Topographic'+layout_method, \n",
" scheme = 'light')"
]
Expand All @@ -562,7 +579,7 @@
"metadata": {},
"outputs": [],
"source": [
"export_to_csv3D(path = 'output_plots/VRlayouts/',\n",
"export_to_csv3D(path = '',\n",
" layout_namespace = 'Topographic'+layout_method, \n",
" posG = posG_topographic, \n",
" colors = nodecolors)"
Expand Down Expand Up @@ -594,7 +611,7 @@
" d_colors = d_nodecolors, \n",
" d_size = d_nodesize, \n",
" d_legend = d_nodelegend, \n",
" path = 'output_plots/3Dlayouts/', \n",
" path = '', \n",
" fname = 'Geodesic'+layout_method, \n",
" scheme = 'light')"
]
Expand All @@ -614,7 +631,7 @@
"metadata": {},
"outputs": [],
"source": [
"export_to_csv3D(path = 'output_plots/VRlayouts/', \n",
"export_to_csv3D(path = '', \n",
" layout_namespace = 'Geodesic'+layout_method, \n",
" posG = posG_geodesic, \n",
" colors = nodecolors)"
Expand Down
Loading

0 comments on commit 6f1eb15

Please sign in to comment.