kitikiplot 0.2.8__py3-none-any.whl → 1.0.0__py3-none-any.whl

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.
@@ -161,10 +161,12 @@ class KitikiCell(ColorConfig):
161
161
 
162
162
  max_y= cell_height*(self.cols-1)+ ((self.rows)*self.stride*cell_height)
163
163
 
164
- if (focus_dim_y > max_y - (cell_height*self.window_length + cell_height*x*self.stride)) and (focus_dim_y <= max_y - (cell_height*x*self.stride)):
165
- kitiki_cell_kwargs["alpha"]= 1
166
- else:
167
- kitiki_cell_kwargs["alpha"]= focus_alpha
164
+ if kitiki_cell_kwargs.get("alpha", None) == None:
165
+
166
+ if (focus_dim_y > max_y - (cell_height*self.window_length + cell_height*x*self.stride)) and (focus_dim_y <= max_y - (cell_height*x*self.stride)):
167
+ kitiki_cell_kwargs["alpha"]= 1
168
+ else:
169
+ kitiki_cell_kwargs["alpha"]= focus_alpha
168
170
 
169
171
  # Adjust dimensions if 'transpose' is set to 'True'
170
172
  else:
@@ -188,10 +190,12 @@ class KitikiCell(ColorConfig):
188
190
  min_dim_x= cell_height + align_factor
189
191
  max_dim_x= cell_height*(self.cols)+ align_factor
190
192
 
191
- if (min_dim_x <= dim_x) and (dim_x <= max_dim_x):
192
- kitiki_cell_kwargs["alpha"]= 1
193
- else:
194
- kitiki_cell_kwargs["alpha"]= focus_alpha
193
+ if kitiki_cell_kwargs.get("alpha", None) == None:
194
+
195
+ if (min_dim_x <= dim_x) and (dim_x <= max_dim_x):
196
+ kitiki_cell_kwargs["alpha"]= 1
197
+ else:
198
+ kitiki_cell_kwargs["alpha"]= focus_alpha
195
199
 
196
200
 
197
201
  # Clean up all local variables for efficient memory management
@@ -198,6 +198,9 @@ class KitikiPlot(KitikiCell):
198
198
  legend_hatch : bool (optional)
199
199
  - A flag indicating whether to include hatch patterns in the legend.
200
200
  - Default is False.
201
+ return_figure: bool (optional)
202
+ - A flag indicating whether to return plot.
203
+ - Default is False.
201
204
  legend_kwargs : dict (optional)
202
205
  - Additional keyword arguments passed to customize the legend.
203
206
  - Default is {}.
@@ -246,13 +249,13 @@ class KitikiPlot(KitikiCell):
246
249
  # This allows for plotting only a subset of the data based on the user-defined range
247
250
  window_range= range( window_range[0], window_range[1])
248
251
 
252
+ each_sample= np.concatenate( (data[0], data[1:data.shape[0], (-1)*self.stride:].flatten()) )
253
+
249
254
  if focus != None:
250
- col_range= self.rows + self.window_length - 1
255
+ col_range= (self.rows * self.stride) + self.window_length - self.stride
251
256
  else:
252
257
  col_range= self.cols
253
258
 
254
- each_sample= np.concatenate( (data[0], data[1:data.shape[0], (-1)*self.stride:].flatten()) )
255
-
256
259
  # Generate cells for each sample in the specified window range and time frame columns
257
260
  for index in window_range:
258
261
 
@@ -262,9 +265,9 @@ class KitikiPlot(KitikiCell):
262
265
  for time_frame in range( col_range ):
263
266
 
264
267
  if type(focus) != bool:
265
-
268
+
266
269
  kitiki_cell_kwargs["alpha"]= focus_alpha if focus != None and ( time_frame< focus[0] or time_frame>= focus[1] ) else 1
267
-
270
+
268
271
  # Create each cell using specified parameters and add it to patches list
269
272
  cell_gen= self.create( x= index,
270
273
  y= time_frame,
@@ -295,7 +298,9 @@ class KitikiPlot(KitikiCell):
295
298
  # Calculate x and y positions for ticks when not transposed
296
299
  x_positions= [(i+1)*window_gap+(i+1)*cell_width+cell_width/2 for i in range(self.rows)]
297
300
 
298
- y_positions= [(self.rows+ self.cols- self.stride- i)*cell_height+cell_height/2 for i in range(self.stride*self.rows+self.cols)]
301
+ # y_positions= [(self.rows+ self.cols- self.stride- i)*cell_height+cell_height/2 for i in range(self.stride*self.rows+self.cols)]
302
+
303
+ y_positions= [cell_height*(self.cols-i-1)+ self.rows*self.stride*cell_height + cell_height/2 for i in range(col_range)]
299
304
 
300
305
  # Display xticks if 'display_xticks' is True
301
306
  if display_xticks:
@@ -333,9 +338,9 @@ class KitikiPlot(KitikiCell):
333
338
 
334
339
  # Configure default yticks
335
340
  else:
336
-
341
+
337
342
  # Set y-ticks with appropriate labels and rotation
338
- plt.yticks( y_positions, [ytick_prefix+"_"+str(i) for i in range(self.stride*self.rows+self.cols)], rotation= yticks_rotation)
343
+ plt.yticks( y_positions, [ytick_prefix+"_"+str(i) for i in range(col_range)], rotation= yticks_rotation)
339
344
 
340
345
  # Else turn off the yticks
341
346
  else:
@@ -0,0 +1,54 @@
1
+ """
2
+ File Name: linear.py
3
+ Description: This file defines grid concentration plot for ecological data visualization
4
+ Author: Boddu Sri Pavan
5
+ Date Created: 31-05-2025
6
+ Last Modified: 31-05-2025
7
+ """
8
+
9
+ from kitikiplot.core import KitikiPlot
10
+
11
+ def plot( data, stride, window_length,
12
+ cmap= {},
13
+ figsize= (20, 5),
14
+ focus= True,
15
+ focus_alpha= 0.2,
16
+ transpose= True,
17
+ align= False,
18
+ xlabel= "Time",
19
+ ylabel= "Sliding Windows of CO(GT) values (in mg/m^3)",
20
+ display_xticks= True,
21
+ xticks_values= [],
22
+ yticks_values= [],
23
+ ytick_prefix= "Window",
24
+ xticks_rotation= 90,
25
+ display_legend= True,
26
+ title= "CO(GT) Trend in Air",
27
+ legend_kwargs= {"bbox_to_anchor": (1.01, 1), "loc":'upper left', "borderaxespad": 0.}
28
+ ):
29
+ """
30
+ Grid Plot for ecological data.
31
+ Focus can be set to highlight particular time-interval of sliding window.
32
+ """
33
+
34
+ ktk= KitikiPlot( data= data, stride= stride, window_length= window_length )
35
+
36
+ ktk.plot(
37
+ figsize= (20, 5),
38
+ cell_width= 2,
39
+ cmap= cmap,
40
+ focus= focus,
41
+ focus_alpha= focus_alpha,
42
+ transpose= transpose,
43
+ align= align,
44
+ xlabel= xlabel,
45
+ ylabel= ylabel,
46
+ display_xticks= display_xticks,
47
+ xticks_values= xticks_values,
48
+ yticks_values= yticks_values,
49
+ ytick_prefix= ytick_prefix,
50
+ xticks_rotation= xticks_rotation,
51
+ display_legend= display_legend,
52
+ title= title,
53
+ legend_kwargs= legend_kwargs
54
+ )
@@ -8,23 +8,41 @@ Last Modified: 25-05-2025
8
8
 
9
9
  from kitikiplot.core import KitikiPlot
10
10
 
11
- def plot( data, focus, focus_alpha, xlabel, ylabel, xticks_values, ytick_prefix, cmap= {} ):
12
-
13
- ktk= KitikiPlot( data= data, stride= 1, window_length= len(data) )
11
+ def plot(
12
+ data, focus, focus_alpha, xlabel, ylabel, xticks_values, ytick_prefix,
13
+ stride= 1,
14
+ figsize= (20,1),
15
+ cell_width= 2,
16
+ transpose= True,
17
+ display_xticks= True,
18
+ xticks_rotation= 90,
19
+ display_legend= True,
20
+ title= "Linear Plot: Ecology Data Visualization",
21
+ return_figure= True,
22
+ legend_kwargs= {"bbox_to_anchor": (1.01, 1), "loc":'upper left', "borderaxespad": 0.},
23
+ cmap= {}
24
+ ):
25
+ """
26
+ Linear Plot for ecological data.
27
+ Focus can be set to highlight particular time-interval
28
+ """
29
+
30
+ ktk= KitikiPlot( data= data, stride= stride, window_length= len(data) )
14
31
 
15
32
  ktk.plot(
16
- figsize= (20, 1),
17
- cell_width= 2,
33
+ figsize= figsize,
34
+ cell_width= cell_width,
18
35
  cmap= cmap,
19
36
  focus= focus,
20
37
  focus_alpha= focus_alpha,
21
- transpose= True,
38
+ transpose= transpose,
22
39
  xlabel= xlabel,
23
40
  ylabel= ylabel,
24
- display_xticks= True,
41
+ display_xticks= display_xticks,
25
42
  xticks_values= xticks_values,
26
43
  ytick_prefix= ytick_prefix,
27
- xticks_rotation= 90,
28
- display_legend= True,
29
- title= "Linear Plot: Ecology Data Visualization",
30
- legend_kwargs= {"bbox_to_anchor": (1.01, 1), "loc":'upper left', "borderaxespad": 0.})
44
+ xticks_rotation= xticks_rotation,
45
+ display_legend= display_legend,
46
+ title= title,
47
+ return_figure= return_figure,
48
+ legend_kwargs= legend_kwargs)
@@ -12,7 +12,7 @@ import pandas as pd
12
12
 
13
13
  def plot( nucleotide_sequence: str, window_length= 30, cell_width= 2 ):
14
14
  """
15
- Generates linear genomic plot for short genome sequences.
15
+ Generates grid genomic plot for short genome sequences.
16
16
 
17
17
  Parameters
18
18
  ----------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kitikiplot
3
- Version: 0.2.8
3
+ Version: 1.0.0
4
4
  Summary: A Python library to visualize categorical sliding window data.
5
5
  License: MIT
6
6
  Keywords: sliding window,sequential,time-series,genome,categorical data
@@ -14,10 +14,10 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Topic :: Scientific/Engineering :: Visualization
17
- Requires-Dist: biopython (>=1.85)
18
- Requires-Dist: matplotlib (>=3.10.1)
19
- Requires-Dist: numpy (>=2.2.5)
20
- Requires-Dist: pandas (>=2.2.3)
17
+ Requires-Dist: biopython
18
+ Requires-Dist: matplotlib
19
+ Requires-Dist: numpy
20
+ Requires-Dist: pandas
21
21
  Project-URL: Bug Tracker, https://github.com/BodduSriPavan-111/kitikiplot/issues
22
22
  Project-URL: Documentation, https://github.com/BodduSriPavan-111/kitikiplot/wiki
23
23
  Project-URL: Repository, https://github.com/BodduSriPavan-111/kitikiplot
@@ -0,0 +1,13 @@
1
+ kitikiplot/core/__init__.py,sha256=7LpJy1V-PZ-JlfjsnRMjMXxTKaFt0JP0mj-A0SgS-sE,34
2
+ kitikiplot/core/kitiki_cell.py,sha256=acYIsPw-WW75OXq7dw5b6NJ9gn6eM7sSc70OHwbitVg,8536
3
+ kitikiplot/core/kitiki_color_config.py,sha256=yOWnJNoYo1BN7UMGTFgc8zpMljBbNpFDLLq7JZF3ATE,11857
4
+ kitikiplot/core/kitikiplot.py,sha256=eDW8-urInxpdFrViPk8CDk9eOt9uLbDHRH9ggzwHxeQ,21144
5
+ kitikiplot/ecology/grid.py,sha256=DdXyu2B4IGLADG5a20go17AMXG6Iv93wKQdG-SQ-_Ik,1684
6
+ kitikiplot/ecology/linear.py,sha256=RmpIHQvETL0a6GN2cUHlQd0VXbE0hepojG0NxQIVca8,1565
7
+ kitikiplot/genomics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ kitikiplot/genomics/grid.py,sha256=E-a1Ir0Q-kjGT5JU7HGdHFs5RWjFi4GIogktPrTFWmA,1829
9
+ kitikiplot/genomics/linear.py,sha256=BNO-9xPVq6dsP8KuXx1fJRG_mLUf2orCM3h7etYqhBw,1280
10
+ kitikiplot-1.0.0.dist-info/LICENSE,sha256=14Bs-3ieyNjj9kCnVLv8CHRXEvQVM6P5uLe-pz7cBI0,1088
11
+ kitikiplot-1.0.0.dist-info/METADATA,sha256=ieqLus54ejy29ZZL6PPjAh-brAch-UxtxmWZy69KtN0,5405
12
+ kitikiplot-1.0.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
13
+ kitikiplot-1.0.0.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- kitikiplot/core/__init__.py,sha256=7LpJy1V-PZ-JlfjsnRMjMXxTKaFt0JP0mj-A0SgS-sE,34
2
- kitikiplot/core/kitiki_cell.py,sha256=rWX9DHYMmV1vQEhikWmbgFK5aVnbxZmxSyO0Ra43tn8,8365
3
- kitikiplot/core/kitiki_color_config.py,sha256=yOWnJNoYo1BN7UMGTFgc8zpMljBbNpFDLLq7JZF3ATE,11857
4
- kitikiplot/core/kitikiplot.py,sha256=2wCeMipQEEmpnm4uRviwO1JnthdV63B1ic5wFk6gWNI,20835
5
- kitikiplot/ecology/linear.py,sha256=l1YVn7vcsKU-1g3SZ9kpOhHQiCRqP8U3LrWecy7_KFo,985
6
- kitikiplot/genomics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- kitikiplot/genomics/grid.py,sha256=ohg5fBVezzxIOr2TlNPhND4PpBvzVG0eiSklTTbQp5s,1831
8
- kitikiplot/genomics/linear.py,sha256=BNO-9xPVq6dsP8KuXx1fJRG_mLUf2orCM3h7etYqhBw,1280
9
- kitikiplot-0.2.8.dist-info/LICENSE,sha256=14Bs-3ieyNjj9kCnVLv8CHRXEvQVM6P5uLe-pz7cBI0,1088
10
- kitikiplot-0.2.8.dist-info/METADATA,sha256=bHnM3JhlE1LBgc4VdsfNbDLoVNc47QCUGElvTzvIDwU,5445
11
- kitikiplot-0.2.8.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
12
- kitikiplot-0.2.8.dist-info/RECORD,,