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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: discotoolkit
3
- Version: 1.0.9
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
  [![Documentation Status](https://readthedocs.org/projects/discotoolkit-py/badge/?version=latest)](https://discotoolkit-py.readthedocs.io/en/latest/?badge=latest) [![Downloads](https://static.pepy.tech/personalized-badge/discotoolkit?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/discotoolkit) [![PyPI version](https://img.shields.io/pypi/v/discotoolkit)](https://pypi.org/project/discotoolkit)
10
10
 
11
- # DISCOtoolkit 1.0.9
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
- _type_: _description_
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
- fig = plt.figure(figsize=(19, 8))
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
@@ -4,4 +4,4 @@ from .DownloadDiscoData import *
4
4
  from .CELLiD import *
5
5
  from .GeneSearch import *
6
6
 
7
- __version__ = "1.0.9"
7
+ __version__ = "1.1.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: discotoolkit
3
- Version: 1.0.9
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
@@ -6,7 +6,7 @@ with open("requirements.txt", "r") as f:
6
6
 
7
7
  setup(
8
8
  name='discotoolkit',
9
- version="1.0.9",
9
+ version="1.1.1",
10
10
  url='http://www.immunesinglecell.org/',
11
11
  author='Li Mengwei, Rom Uddamvathanak',
12
12
  author_email='uddamvathanak_rom@immunol.a-star.edu.sg',
File without changes
File without changes