Skip to content

Commit

Permalink
Rerun analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
YojanaGadiya committed May 24, 2021
1 parent af3e355 commit f2791ce
Showing 1 changed file with 37 additions and 55 deletions.
92 changes: 37 additions & 55 deletions notebooks/4.0-subgraph_full_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,15 @@
"id": "sonic-animal",
"metadata": {},
"source": [
"# Load dataset-generated network dataframe - Unfiltered"
"# Load KG"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "included-metadata",
"id": "leading-shopper",
"metadata": {},
"outputs": [],
"source": [
"openbiolink_df = pd.read_csv(\n",
"# os.path.join(KG_DATA_PATH, 'shuffled_openbiolink.tsv'),\n",
" 'shuffled_openbiolink_kg.tsv',\n",
" sep='\\t'\n",
")\n",
"openbiolink_df.rename(columns={\"relation\": \"polarity\"}, inplace=True)\n",
"\n",
"custom_df = pd.read_csv(\n",
"# os.path.join(KG_DATA_PATH, 'shuffled_custom.tsv'),\n",
" 'shuffled_custom_kg.tsv',\n",
" sep='\\t'\n",
")\n",
"custom_df.rename(columns={\"relation\": \"polarity\"}, inplace=True)"
]
},
{
"cell_type": "markdown",
"id": "persistent-membrane",
"metadata": {},
"source": [
"openbiolink_df = pd.read_csv(\n",
" os.path.join(KG_DATA_PATH, 'openbiolink_filtered_kg.tsv'),\n",
Expand All @@ -106,9 +86,11 @@
]
},
{
"cell_type": "markdown",
"id": "tested-franklin",
"cell_type": "code",
"execution_count": 4,
"id": "assured-geology",
"metadata": {},
"outputs": [],
"source": [
"with open(os.path.join(DATA_DIR, 'transcriptomics', 'creed_harmonized_expression.json')) as file:\n",
" creed_dict = json.load(file)\n",
Expand All @@ -123,26 +105,6 @@
" open_target_dict = json.load(file4)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "compact-contribution",
"metadata": {},
"outputs": [],
"source": [
"with open(os.path.join(DATA_DIR, 'transcriptomics', 'creed_permuted.json')) as file:\n",
" creed_dict = json.load(file)\n",
" \n",
"with open(os.path.join(DATA_DIR, 'transcriptomics', 'geo_permuted.json')) as file2:\n",
" geo_dict = json.load(file2)\n",
" \n",
"with open(os.path.join(DATA_DIR, 'transcriptomics', 'lc1000_permuted.json')) as file3:\n",
" lc1000_dict = json.load(file3)\n",
" \n",
"with open(os.path.join(DATA_DIR, 'transcriptomics', 'target_permuted.json')) as file4:\n",
" open_target_dict = json.load(file4)"
]
},
{
"cell_type": "markdown",
"id": "twelve-diesel",
Expand Down Expand Up @@ -227,7 +189,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "marked-tower",
"metadata": {
"scrolled": false
Expand All @@ -244,10 +206,10 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Getting paths: 100%|██████████| 620/620 [13:55<00:00, 1.35s/it]\n",
"Calculating concordance: 100%|██████████| 3/3 [02:38<00:00, 52.87s/it]\n",
"Getting paths: 100%|██████████| 1170/1170 [03:52<00:00, 5.02it/s]\n",
"Calculating concordance: 100%|██████████| 3/3 [00:05<00:00, 1.91s/it]\n"
"Getting paths: 100%|██████████| 620/620 [01:02<00:00, 9.96it/s]\n",
"Calculating concordance: 100%|██████████| 3/3 [00:01<00:00, 1.67it/s]\n",
"Getting paths: 100%|██████████| 1170/1170 [04:40<00:00, 4.16it/s]\n",
"Calculating concordance: 100%|██████████| 3/3 [00:12<00:00, 4.11s/it]\n"
]
},
{
Expand All @@ -261,10 +223,10 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Getting paths: 100%|██████████| 310/310 [04:46<00:00, 1.08it/s]\n",
"Calculating concordance: 100%|██████████| 3/3 [00:47<00:00, 15.76s/it]\n",
"Getting paths: 100%|██████████| 510/510 [01:51<00:00, 4.56it/s]\n",
"Calculating concordance: 100%|██████████| 3/3 [00:03<00:00, 1.03s/it]\n"
"Getting paths: 100%|██████████| 310/310 [00:43<00:00, 7.06it/s]\n",
"Calculating concordance: 100%|██████████| 3/3 [00:01<00:00, 2.01it/s]\n",
"Getting paths: 100%|██████████| 510/510 [02:41<00:00, 3.16it/s]\n",
"Calculating concordance: 100%|██████████| 3/3 [00:11<00:00, 3.85s/it]\n"
]
},
{
Expand All @@ -278,7 +240,27 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Getting paths: 91%|█████████▏| 3495/3820 [36:29<13:41, 2.53s/it] "
"Getting paths: 100%|██████████| 3820/3820 [03:56<00:00, 16.16it/s]\n",
"Calculating concordance: 100%|██████████| 3/3 [00:04<00:00, 1.45s/it]\n",
"Getting paths: 100%|██████████| 7722/7722 [38:23<00:00, 3.35it/s] \n",
"Calculating concordance: 100%|██████████| 3/3 [01:32<00:00, 30.91s/it]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"### lc1000-geo ###\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Getting paths: 100%|██████████| 1910/1910 [01:58<00:00, 16.07it/s]\n",
"Calculating concordance: 100%|██████████| 3/3 [00:04<00:00, 1.53s/it]\n",
"Getting paths: 100%|██████████| 3366/3366 [17:59<00:00, 3.12it/s] \n",
"Calculating concordance: 100%|██████████| 3/3 [01:53<00:00, 37.77s/it]\n"
]
}
],
Expand Down Expand Up @@ -371,7 +353,7 @@
" ignore_index=True\n",
" )\n",
"\n",
" n_file_path = os.path.join(DATA_DIR, 'concordant_paths', f'{graph_name}-permuted.tsv')\n",
" n_file_path = os.path.join(DATA_DIR, 'concordant_paths', f'{graph_name}-results.tsv')\n",
" df.to_csv(n_file_path, sep='\\t', index=False) "
]
},
Expand Down

0 comments on commit f2791ce

Please sign in to comment.