discotoolkit 1.0.9__tar.gz → 1.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/PKG-INFO +1 -1
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/README.md +1 -1
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit/CELLiD.py +1 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit/GeneSearch.py +14 -12
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit/__init__.py +1 -1
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit.egg-info/PKG-INFO +1 -1
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/setup.py +1 -1
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/MANIFEST.in +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit/CellMapper.py +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit/DiscoClass.py +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit/DownloadDiscoData.py +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit/GetMetadata.py +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit/GlobalVariable.py +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit.egg-info/SOURCES.txt +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit.egg-info/dependency_links.txt +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit.egg-info/requires.txt +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/discotoolkit.egg-info/top_level.txt +0 -0
- {discotoolkit-1.0.9 → discotoolkit-1.1.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: discotoolkit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: DISCOtoolkit is an python package that allows users to access data and use the tools provided by the DISCO database.
|
|
5
5
|
Home-page: http://www.immunesinglecell.org/
|
|
6
6
|
Author: Li Mengwei, Rom Uddamvathanak
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
-->
|
|
9
9
|
[](https://discotoolkit-py.readthedocs.io/en/latest/?badge=latest) [](https://pepy.tech/project/discotoolkit) [](https://pypi.org/project/discotoolkit)
|
|
10
10
|
|
|
11
|
-
# DISCOtoolkit 1.
|
|
11
|
+
# DISCOtoolkit 1.1.1
|
|
12
12
|
|
|
13
13
|
DISCOtoolkit is an python package that allows users to access data and use the tools provided by the [DISCO database](https://www.immunesinglecell.org/). Read the documentation [DISCOtoolkit](https://discotoolkit-py.readthedocs.io/en/latest/). It provides the following functions:
|
|
14
14
|
|
|
@@ -262,6 +262,7 @@ def CELLiD_enrichment(input : pd.DataFrame, reference : pd.DataFrame = None, ref
|
|
|
262
262
|
# downloading the geneset data from disco database
|
|
263
263
|
response = requests.get(url=prefix_disco_url +"/getGeneSetPkl", timeout=timeout)
|
|
264
264
|
open(ref_path + "/ref_geneset.pkl", "wb").write(response.content)
|
|
265
|
+
reference = pd.read_pickle(ref_path + "/ref_geneset.pkl", compression = {'method':'gzip','compresslevel':6})
|
|
265
266
|
|
|
266
267
|
else:
|
|
267
268
|
# read the data into pandas dataframe for subsequent analysis
|
|
@@ -7,22 +7,19 @@ import numpy as np
|
|
|
7
7
|
from typing import Union
|
|
8
8
|
import colorcet as cc
|
|
9
9
|
|
|
10
|
-
# import variable and class from other script
|
|
11
|
-
from .GlobalVariable import logging, prefix_disco_url
|
|
12
|
-
from .DiscoClass import FilterData, Filter
|
|
13
|
-
from .GetMetadata import check_in_list
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
def gene_search(gene : str, atlas : Union[str, list] = None):
|
|
11
|
+
def gene_search(gene : str, atlas : Union[str, list] = None, figsize : tuple = None, dpi : int = 300):
|
|
17
12
|
|
|
18
13
|
"""Function to search for the gene expression level the same as the input gene search bar in DISCO website.
|
|
19
14
|
|
|
20
15
|
Args:
|
|
21
|
-
gene (String): name of the gene in capital letter. e.g. LYVE1
|
|
22
|
-
atlas (String or List of String): User defined atlas for visualisation. Default to None to search for all Atlases.
|
|
16
|
+
gene (String): name of the gene in capital letter. e.g. LYVE1.
|
|
17
|
+
atlas (String or List of String, Optional): User defined atlas for visualisation. Default to None to search for all Atlases.
|
|
18
|
+
figsize (tuple, Optional): Size of the generated figure in tuple. Default to None.
|
|
19
|
+
dpi (int, Optional): DPI resolution for the figure. Default to 300.
|
|
23
20
|
|
|
24
21
|
Returns:
|
|
25
|
-
|
|
22
|
+
None: This function does not return anything beside plotting
|
|
26
23
|
"""
|
|
27
24
|
|
|
28
25
|
# condition to handle both the string and list of string of user input for the atlas
|
|
@@ -66,14 +63,19 @@ def gene_search(gene : str, atlas : Union[str, list] = None):
|
|
|
66
63
|
saturation=0.8
|
|
67
64
|
|
|
68
65
|
# Set DPI for plotting
|
|
69
|
-
dpi = 300 # Set the desired DPI value
|
|
70
66
|
sns.set(rc={'figure.dpi': dpi})
|
|
71
67
|
|
|
72
68
|
# setting plot style
|
|
73
69
|
sns.set_style('whitegrid') # Set the plot style
|
|
74
70
|
|
|
75
71
|
# changing the plot size
|
|
76
|
-
|
|
72
|
+
if figsize is None:
|
|
73
|
+
fig_len = int(len(set(sample_df["cell types"])))
|
|
74
|
+
fig_height = 8
|
|
75
|
+
|
|
76
|
+
figsize = (fig_len, fig_height)
|
|
77
|
+
|
|
78
|
+
fig = plt.figure(figsize=figsize)
|
|
77
79
|
|
|
78
80
|
# Create the violin plot with different colors based on the 'Category' variable and adding boxplot to assist user with median value
|
|
79
81
|
ax = sns.violinplot(data=sample_df, x='cell types', y='value', hue="atlases", width=0.8, dodge=False, cut=1, saturation = saturation, plot_kws={'alpha':0.1},
|
|
@@ -114,4 +116,4 @@ def gene_search(gene : str, atlas : Union[str, list] = None):
|
|
|
114
116
|
# Show the plot
|
|
115
117
|
plt.show()
|
|
116
118
|
|
|
117
|
-
return None
|
|
119
|
+
return None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: discotoolkit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: DISCOtoolkit is an python package that allows users to access data and use the tools provided by the DISCO database.
|
|
5
5
|
Home-page: http://www.immunesinglecell.org/
|
|
6
6
|
Author: Li Mengwei, Rom Uddamvathanak
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|