kitikiplot 0.2.2__tar.gz → 0.2.4__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.3
2
2
  Name: kitikiplot
3
- Version: 0.2.2
3
+ Version: 0.2.4
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
@@ -83,11 +83,11 @@ ktk.plot( display_legend= True ) # Display the legend
83
83
  Check out the complete <b>guide of customization</b> [here](https://github.com/BodduSriPavan-111/kitikiplot/blob/main/examples/Usage_Guide.ipynb).
84
84
 
85
85
  ## To-do
86
+ 🟢 Domain-specific modules (In Progress) </br>
86
87
  🟢 Streamlit Demo Interface (In Progress) </br>
87
88
  🟢 Website for documentation (In Progress)
88
89
  - [ ] Tooltip
89
90
  - [ ] Interactive Plot
90
- - [ ] Domain-specific modules
91
91
 
92
92
  Please refer <a href="https://github.com/BodduSriPavan-111/kitikiplot/blob/main/CONTRIBUTING.md">CONTRIBUTING.md</a> for <b>contributions</b> to kitikiplot.
93
93
 
@@ -57,11 +57,11 @@ ktk.plot( display_legend= True ) # Display the legend
57
57
  Check out the complete <b>guide of customization</b> [here](https://github.com/BodduSriPavan-111/kitikiplot/blob/main/examples/Usage_Guide.ipynb).
58
58
 
59
59
  ## To-do
60
+ 🟢 Domain-specific modules (In Progress) </br>
60
61
  🟢 Streamlit Demo Interface (In Progress) </br>
61
62
  🟢 Website for documentation (In Progress)
62
63
  - [ ] Tooltip
63
64
  - [ ] Interactive Plot
64
- - [ ] Domain-specific modules
65
65
 
66
66
  Please refer <a href="https://github.com/BodduSriPavan-111/kitikiplot/blob/main/CONTRIBUTING.md">CONTRIBUTING.md</a> for <b>contributions</b> to kitikiplot.
67
67
 
@@ -0,0 +1,57 @@
1
+ """
2
+ File Name: linear.py
3
+ Description: This file defines linear genomic plot
4
+ Author: Boddu Sri Pavan
5
+ Date Created: 21-05-2025
6
+ Last Modified: 24-05-2025
7
+ """
8
+
9
+ from kitikiplot.core import KitikiPlot
10
+
11
+ import pandas as pd
12
+
13
+ def plot( nucleotide_sequence: str, window_length= 30, cell_width= 2 ):
14
+ """
15
+ Generates linear genomic plot for short genome sequences.
16
+
17
+ Parameters
18
+ ----------
19
+ nucleotide_sequence : str
20
+ - Sequence of 'A', 'T', 'G', and 'C'.
21
+ """
22
+
23
+ # Preprocess input genomic sequence
24
+ nucleotide_sequence=nucleotide_sequence.upper()
25
+
26
+ residual= len(nucleotide_sequence)%window_length
27
+
28
+ l= []
29
+ for index in range( len(nucleotide_sequence)// window_length):
30
+
31
+ l.append( list(nucleotide_sequence[index*window_length: (index+1)*window_length]) )
32
+
33
+ if residual > 0:
34
+ l.append( list(nucleotide_sequence[(-1)*residual:]) + ["No_Data"]* (window_length- residual) )
35
+
36
+ grid_df= pd.DataFrame(l)
37
+
38
+ ktk= KitikiPlot( data= grid_df, stride= 0 )
39
+
40
+ fig= ktk.plot(
41
+ figsize= (grid_df.shape[1]//3, grid_df.shape[0]//3),
42
+ cell_width= cell_width,
43
+ cmap= {'A': '#007FFF', 'T': "#fffc00", "G": "#00ff00", "C": "#960018"},
44
+ transpose= True,
45
+ window_gap= 0,
46
+ xlabel= "Nucleotides",
47
+ ylabel= "Nucleotide Chunk",
48
+ display_xticks= False,
49
+ display_yticks= False,
50
+ title= "Grid Plot: Nucleotide Sequence Visualization",
51
+ display_legend= True,
52
+ legend_kwargs= {"bbox_to_anchor": (1.01, 1), "loc":'upper left', "borderaxespad": 0.},
53
+ return_figure= True,
54
+ kitiki_cell_kwargs= {"linewidth": 0.5}
55
+ )
56
+
57
+ return fig
@@ -3,13 +3,11 @@ File Name: linear.py
3
3
  Description: This file defines linear genomic plot
4
4
  Author: Boddu Sri Pavan
5
5
  Date Created: 21-05-2025
6
- Last Modified: 21-05-2025
6
+ Last Modified: 24-05-2025
7
7
  """
8
8
 
9
9
  from kitikiplot.core import KitikiPlot
10
10
 
11
- from Bio import SeqIO
12
-
13
11
  def plot( nucleotide_sequence: str )-> bool:
14
12
  """
15
13
  Generates linear genomic plot for short genome sequences.
@@ -35,7 +33,7 @@ def plot( nucleotide_sequence: str )-> bool:
35
33
  display_yticks= False,
36
34
  xtick_prefix= "Nucleotide",
37
35
  xticks_rotation= 90,
38
- title= "Genome Visualization",
36
+ title= "Linear Plot: Nucleotide Sequence Visualization",
39
37
  display_legend= True,
40
38
  legend_kwargs= {"bbox_to_anchor": (1.01, 1), "loc":'upper left', "borderaxespad": 0.}
41
39
  )
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "kitikiplot"
3
- version = "0.2.2"
3
+ version = "0.2.4"
4
4
  description = "A Python library to visualize categorical sliding window data."
5
5
  authors = ["Boddu Sri Pavan <boddusripavan111@gmail.com>"]
6
6
  readme = "README.md"
File without changes