Skip to content

Commit

Permalink
update core Data with number of random amino acids in PSPA
Browse files Browse the repository at this point in the history
  • Loading branch information
sky1ove committed May 13, 2024
1 parent c615cc1 commit 02387dc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
15 changes: 15 additions & 0 deletions katlas/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ class Data:
# scoring via PSPA (all capital)
OCHOA_PSPA_SCORE_URL = "https://github.com/sky1ove/katlas/raw/main/dataset/ochoa_pspa_score.parquet"

# PSPA number of random amino acids
PSPA_NUM_RANDOM_URL = "https://github.com/sky1ove/katlas/raw/main/dataset/pspa_divide_num.csv"



@staticmethod
def _fetch_data(url):
Expand Down Expand Up @@ -278,6 +282,17 @@ def get_combine_site_pplus_ochoa():
#Convert the number in the column name into integer
df.columns = [int(col) if col.lstrip('-').isdigit() else col for col in df.columns]
return df


@staticmethod
def get_num_dict():
"""
Fetches the data from the given URL and returns a DataFrame
"""
num = pd.read_csv(Data.PSPA_NUM_RANDOM_URL)
num_dict = num.set_index('kinase')['num_random_aa'].to_dict()

return num_dict

# %% ../nbs/00_core.ipynb 15
class CPTAC:
Expand Down
27 changes: 21 additions & 6 deletions nbs/00_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -27,7 +27,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -71,7 +71,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -160,6 +160,10 @@
" # scoring via PSPA (all capital)\n",
" OCHOA_PSPA_SCORE_URL = \"https://github.com/sky1ove/katlas/raw/main/dataset/ochoa_pspa_score.parquet\"\n",
"\n",
" # PSPA number of random amino acids\n",
" PSPA_NUM_RANDOM_URL = \"https://github.com/sky1ove/katlas/raw/main/dataset/pspa_divide_num.csv\"\n",
" \n",
"\n",
" \n",
" @staticmethod\n",
" def _fetch_data(url):\n",
Expand Down Expand Up @@ -338,7 +342,18 @@
" \n",
" #Convert the number in the column name into integer\n",
" df.columns = [int(col) if col.lstrip('-').isdigit() else col for col in df.columns]\n",
" return df"
" return df\n",
" \n",
" \n",
" @staticmethod\n",
" def get_num_dict():\n",
" \"\"\"\n",
" Fetches the data from the given URL and returns a DataFrame\n",
" \"\"\"\n",
" num = pd.read_csv(Data.PSPA_NUM_RANDOM_URL)\n",
" num_dict = num.set_index('kinase')['num_random_aa'].to_dict()\n",
"\n",
" return num_dict"
]
},
{
Expand Down Expand Up @@ -4686,7 +4701,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit 02387dc

Please sign in to comment.