kitikiplot 0.2.5__py3-none-any.whl → 0.2.7__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.
@@ -3,7 +3,7 @@ File Name: kitiki_cell.py
3
3
  Description: This file defines the 'KitikiCell' class for each rectangular cell in KitikiPlot
4
4
  Author: Boddu Sri Pavan
5
5
  Date Created: 21-10-2024
6
- Last Modified: 19-02-2025
6
+ Last Modified: 31-05-2025
7
7
  """
8
8
 
9
9
  # Import necessary libraries
@@ -79,6 +79,8 @@ class KitikiCell(ColorConfig):
79
79
  fallback_hatch: str,
80
80
  display_hatch: bool,
81
81
  transpose: bool,
82
+ focus,
83
+ focus_alpha,
82
84
  **kitiki_cell_kwargs: dict) -> mpatches.Rectangle:
83
85
 
84
86
  """
@@ -143,7 +145,26 @@ class KitikiCell(ColorConfig):
143
145
  align_factor= (self.rows-x)*self.stride*cell_height if align else 0
144
146
 
145
147
  # Calculate dimensions for the rectangle based on grid position and size parameters
146
- rect_dim= (window_gap*(x+1)+ cell_width*(x+1) , cell_height*(self.cols-y-1)+align_factor)
148
+ dim_x= window_gap*(x+1)+ cell_width*(x+1)
149
+ dim_y= cell_height*(self.cols-y-1)+align_factor
150
+
151
+ if focus == None:
152
+ rect_dim= ( dim_x, dim_y )
153
+
154
+ else:
155
+
156
+ align_factor= (self.rows)*self.stride*cell_height
157
+ focus_dim_y= cell_height*(self.cols-y-1)+align_factor
158
+
159
+ # Calculate dimensions for the rectangle based on grid position and size parameters
160
+ rect_dim= ( dim_x, focus_dim_y )
161
+
162
+ max_y= cell_height*(self.cols-1)+ ((self.rows)*self.stride*cell_height)
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
147
168
 
148
169
  # Adjust dimensions if 'transpose' is set to 'True'
149
170
  else:
@@ -155,7 +176,10 @@ class KitikiCell(ColorConfig):
155
176
  align_factor= x*self.stride*cell_height if align else 0
156
177
 
157
178
  # Calculate dimensions for the rectangle based on grid position and size parameters for transposed layout
158
- rect_dim= (cell_height*(y+1)+ align_factor, window_gap*(self.rows- x+1)+ cell_width*(self.rows- x+1))
179
+ dim_x= cell_height*(y+1)+ align_factor
180
+ dim_y= window_gap*(self.rows- x+1)+ cell_width*(self.rows- x+1)
181
+
182
+ rect_dim= (dim_x, dim_y)
159
183
 
160
184
 
161
185
  # Clean up all local variables for efficient memory management
@@ -94,14 +94,10 @@ class ColorConfig:
94
94
  # Convert 'list' to 'pd.DataFrame' using stride and window_length, and initialize 'data' attribute
95
95
  self.data= self._convert_list_to_dataframe( list(data), stride, window_length)
96
96
 
97
- # Store the stride value
98
- self.stride= stride
99
-
100
- # Set 'rows' to number of rows in the DataFrame
101
97
  self.rows= self.data.shape[0]
102
-
103
- # Set 'cols' to number of columns in the DataFrame
104
98
  self.cols= self.data.shape[1]
99
+ self.stride= stride
100
+ self.window_length= window_length
105
101
 
106
102
  @staticmethod
107
103
  def _convert_list_to_dataframe( data: Union[pd.DataFrame, list], stride: int = 1, window_length: int = 10) -> pd.DataFrame:
@@ -8,6 +8,7 @@ Last Modified: 19-02-2025
8
8
 
9
9
  # Import necessary libraries
10
10
  from typing import List, Union
11
+ import numpy as np
11
12
  import pandas as pd
12
13
  import matplotlib
13
14
  import matplotlib.pyplot as plt
@@ -245,15 +246,24 @@ class KitikiPlot(KitikiCell):
245
246
  # This allows for plotting only a subset of the data based on the user-defined range
246
247
  window_range= range( window_range[0], window_range[1])
247
248
 
249
+ if focus != None:
250
+ col_range= self.rows + self.window_length - 1
251
+ print( "COLUMN Range: ", col_range )
252
+ else:
253
+ col_range= self.cols
254
+
255
+ each_sample= np.concatenate( (data[0], data[1:data.shape[0], (-1)*self.stride:].flatten()) )
256
+
248
257
  # Generate cells for each sample in the specified window range and time frame columns
249
258
  for index in window_range:
250
259
 
251
- each_sample= data[ index ]
260
+ if focus == None:
261
+ each_sample= data[ index ]
252
262
 
253
- for time_frame in range(self.cols):
263
+ for time_frame in range( col_range ):
254
264
 
255
265
  kitiki_cell_kwargs["alpha"]= focus_alpha if focus != None and ( time_frame< focus[0] or time_frame>= focus[1] ) else 1
256
-
266
+
257
267
  # Create each cell using specified parameters and add it to patches list
258
268
  cell_gen= self.create( x= index,
259
269
  y= time_frame,
@@ -269,6 +279,8 @@ class KitikiPlot(KitikiCell):
269
279
  fallback_hatch= fallback_hatch,
270
280
  display_hatch= display_hatch,
271
281
  transpose= transpose,
282
+ focus= focus,
283
+ focus_alpha= focus_alpha,
272
284
  **kitiki_cell_kwargs
273
285
  )
274
286
  patches.append( cell_gen )
@@ -8,7 +8,7 @@ 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 ):
11
+ def plot( data, focus, focus_alpha, xlabel, ylabel, xticks_values, ytick_prefix, cmap= {} ):
12
12
 
13
13
  ktk= KitikiPlot( data= data, stride= 1, window_length= len(data) )
14
14
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kitikiplot
3
- Version: 0.2.5
3
+ Version: 0.2.7
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
@@ -39,10 +39,8 @@ Description-Content-Type: text/markdown
39
39
  KitikiPlot is a Python library for visualizing sequential and time-series categorical "Sliding Window" data. <br>
40
40
  (The term 'kitiki' means 'window' in Telugu)
41
41
 
42
- Our preprint is published in **TechRxiv**. Find it <a href="https://www.techrxiv.org/users/877016/articles/1256589-kitikiplot-a-python-library-to-visualize-categorical-sliding-window-data"> here <a/>
42
+ Genome Grid Plot Generator: 🤗 <a href= "https://huggingface.co/spaces/BodduSriPavan111/genomics">HuggingFace Demo</a>
43
43
 
44
- Research paper is published in **GIS Science Journal** Volume 12 Issue 1, 186-193, 2025 (Scopus indexed with Impact factor **6.1**). </br>
45
- Read it here: <a href="https://zenodo.org/records/14632005">https://zenodo.org/records/14632005</a>
46
44
  <!--
47
45
  ## Table of Contents</h2>
48
46
  - [Why Kitkiplot?](#What-and-why)
@@ -97,6 +95,11 @@ To join the Discord server for more discussion, click <a href="https://discord.g
97
95
  <a href="https://www.linkedin.com/in/boddusripavan/"> Boddu Sri Pavan </a>
98
96
 
99
97
  ## Citation
98
+ Our preprint is published in **TechRxiv**. Find it <a href="https://www.techrxiv.org/users/877016/articles/1256589-kitikiplot-a-python-library-to-visualize-categorical-sliding-window-data"> here <a/>
99
+
100
+ Research paper is published in **GIS Science Journal** Volume 12 Issue 1, 186-193, 2025 (Scopus indexed with Impact factor **6.1**). </br>
101
+ Read it here: <a href="https://zenodo.org/records/14632005">https://zenodo.org/records/14632005</a>
102
+
100
103
  APA <br>
101
104
  > Boddu Sri Pavan, Chandrasheker Thummanagoti, & Boddu Swathi Sree. (2025). KitikiPlot A Python library to visualize categorical sliding window data. https://doi.org/10.5281/zenodo.14632005.
102
105
 
@@ -0,0 +1,12 @@
1
+ kitikiplot/core/__init__.py,sha256=7LpJy1V-PZ-JlfjsnRMjMXxTKaFt0JP0mj-A0SgS-sE,34
2
+ kitikiplot/core/kitiki_cell.py,sha256=mzmjUMdLdCzNg-8NYZ9M8sDuITOMdwyZkT4xKD-pQlc,7925
3
+ kitikiplot/core/kitiki_color_config.py,sha256=yOWnJNoYo1BN7UMGTFgc8zpMljBbNpFDLLq7JZF3ATE,11857
4
+ kitikiplot/core/kitikiplot.py,sha256=dkF49TeO9jCQnXEXpjL-la-AvnqvlChVsar3tkZ6yNQ,20822
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.7.dist-info/LICENSE,sha256=14Bs-3ieyNjj9kCnVLv8CHRXEvQVM6P5uLe-pz7cBI0,1088
10
+ kitikiplot-0.2.7.dist-info/METADATA,sha256=FuExeMvz44Olbk6Oe_-i1GRy3_L94qfNQ3EWGQ02MXs,5445
11
+ kitikiplot-0.2.7.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
12
+ kitikiplot-0.2.7.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=9kn33x8-4Zp_fVdmp5NK-V7fm3hDXZOxwCNO3uDZqIo,7016
3
- kitikiplot/core/kitiki_color_config.py,sha256=34KEE1CQJeMnB6gA-FgTHiIEP7rF1_17xv2XOakh1ds,11969
4
- kitikiplot/core/kitikiplot.py,sha256=jodoatSZZzThsJIYufXq45DLBVYIfO767BUaJCouX-o,20336
5
- kitikiplot/ecology/linear.py,sha256=vliq3ngkAf_Nry_8AVRSCN_xEN7M3lLUGLCH0-4Vkk4,981
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.5.dist-info/LICENSE,sha256=14Bs-3ieyNjj9kCnVLv8CHRXEvQVM6P5uLe-pz7cBI0,1088
10
- kitikiplot-0.2.5.dist-info/METADATA,sha256=lnMQVRDVKj5VpbGqyPqwaBxiSInpi5fQFAC82x4io2E,5322
11
- kitikiplot-0.2.5.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
12
- kitikiplot-0.2.5.dist-info/RECORD,,