@@ -21,7 +21,7 @@ The `Gw` class is the main interface to libgw (GW).
2121
2222### Initialization
2323
24- #### ` Gw(reference, **kwargs) `
24+ ### ` Gw(reference, **kwargs) `
2525
2626Initialize the GW object with a reference genome and optional parameters.
2727
@@ -38,7 +38,7 @@ gw = Gw("reference.fa", theme="dark", threads=4,
3838
3939### Class Methods
4040
41- #### ` onlineGenomeTags() `
41+ ### ` onlineGenomeTags() `
4242
4343Returns a dictionary of available online reference genome tags. Use a local genome
4444for much better performance.
@@ -55,7 +55,7 @@ print(tags)
5555
5656### Loading Data
5757
58- #### ` add_bam(path) `
58+ ### ` add_bam(path) `
5959
6060Add a BAM file to the visualization.
6161
@@ -70,7 +70,7 @@ Add a BAM file to the visualization.
7070gw.add_bam(" sample.bam" )
7171```
7272
73- #### ` remove_bam(index) `
73+ ### ` remove_bam(index) `
7474
7575Remove a BAM file from the visualization.
7676
@@ -80,7 +80,7 @@ Remove a BAM file from the visualization.
8080** Returns:**
8181- ` Gw ` : Self for method chaining
8282
83- #### ` add_track(path, vcf_as_track=True, bed_as_track=True) `
83+ ### ` add_track(path, vcf_as_track=True, bed_as_track=True) `
8484
8585Add a genomic data track to the visualization.
8686
@@ -101,7 +101,7 @@ gw.add_track("variants.vcf")
101101gw.add_track(" features.bed" )
102102```
103103
104- #### ` remove_track(index) `
104+ ### ` remove_track(index) `
105105
106106Remove a data track from the visualization.
107107
@@ -113,7 +113,7 @@ Remove a data track from the visualization.
113113
114114### Managing Regions
115115
116- #### ` add_region(chrom, start, end, marker_start=-1, marker_end=-1) `
116+ ### ` add_region(chrom, start, end, marker_start=-1, marker_end=-1) `
117117
118118Add a genomic region for visualization. Setting the markers will result in a small triangle being drawn at
119119the genomic position.
@@ -134,7 +134,7 @@ the genomic position.
134134gw.add_region(" chr1" , 1000000 , 1100000 , 1050000 , 1060000 )
135135```
136136
137- #### ` remove_region(index) `
137+ ### ` remove_region(index) `
138138
139139Remove a genomic region from the visualization.
140140
@@ -144,7 +144,7 @@ Remove a genomic region from the visualization.
144144** Returns:**
145145- ` Gw ` : Self for method chaining
146146
147- #### ` view_region(chrom, start, end) `
147+ ### ` view_region(chrom, start, end) `
148148
149149Clear existing regions and view a specific genomic region.
150150
@@ -162,7 +162,7 @@ Clear existing regions and view a specific genomic region.
162162gw.view_region(" chr1" , 1000000 , 1100000 )
163163```
164164
165- #### ` set_active_region_index(index) `
165+ ### ` set_active_region_index(index) `
166166
167167Set the currently active region for dynamic visualization.
168168
@@ -172,28 +172,28 @@ Set the currently active region for dynamic visualization.
172172** Returns:**
173173- ` Gw ` : Self for method chaining
174174
175- #### ` clear() `
175+ ### ` clear() `
176176
177177Remove all data.
178178
179- #### ` clear_regions() `
179+ ### ` clear_regions() `
180180
181181Remove all defined genomic regions.
182182
183- #### ` clear_alignments() `
183+ ### ` clear_alignments() `
184184
185185Remove all loaded alignment data.
186186
187187### Visualization
188188
189- #### ` draw() `
189+ ### ` draw() `
190190
191191Draw the visualization to the raster surface without buffering. Suitable for non-interactive visualizations.
192192
193193** Returns:**
194194- ` Gw ` : Self for method chaining
195195
196- #### ` draw_interactive(clear_buffer=False) `
196+ ### ` draw_interactive(clear_buffer=False) `
197197
198198Draw the visualization to the raster surface. Caches state for using with interactive functions.
199199
@@ -203,7 +203,7 @@ Draw the visualization to the raster surface. Caches state for using with intera
203203** Returns:**
204204- ` Gw ` : Self for method chaining
205205
206- #### ` draw_image(stream=True) `
206+ ### ` draw_image(stream=True) `
207207
208208Draw the visualization and return it as a PIL Image.
209209
@@ -220,7 +220,7 @@ img = gw.draw_image()
220220img.save(" output.png" )
221221```
222222
223- #### ` save_png(path) `
223+ ### ` save_png(path) `
224224
225225Save the current raster image to a PNG file.
226226
@@ -235,7 +235,7 @@ Save the current raster image to a PNG file.
235235gw.draw().save_png(" visualization.png" )
236236```
237237
238- #### ` encode_as_png(compression_level=6) `
238+ ### ` encode_as_png(compression_level=6) `
239239
240240Encode the current canvas as PNG and return the binary data.
241241
@@ -245,7 +245,7 @@ Encode the current canvas as PNG and return the binary data.
245245** Returns:**
246246- ` bytes ` : PNG encoded image data
247247
248- #### ` encode_as_jpeg(quality=80) `
248+ ### ` encode_as_jpeg(quality=80) `
249249
250250Encode the current canvas as JPEG and return the binary data.
251251
@@ -255,7 +255,7 @@ Encode the current canvas as JPEG and return the binary data.
255255** Returns:**
256256- ` bytes ` : JPEG encoded image data
257257
258- #### ` array() `
258+ ### ` array() `
259259
260260Convert the image pixel data to a numpy array.
261261
@@ -270,7 +270,7 @@ img_array = gw.draw().array()
270270
271271### Canvas and Display Settings
272272
273- #### ` set_canvas_width(width) `
273+ ### ` set_canvas_width(width) `
274274
275275Set the canvas width and recreate the raster surface.
276276
@@ -280,7 +280,7 @@ Set the canvas width and recreate the raster surface.
280280** Returns:**
281281- ` Gw ` : Self for method chaining
282282
283- #### ` set_canvas_height(height) `
283+ ### ` set_canvas_height(height) `
284284
285285Set the canvas height and recreate the raster surface.
286286
@@ -290,7 +290,7 @@ Set the canvas height and recreate the raster surface.
290290** Returns:**
291291- ` Gw ` : Self for method chaining
292292
293- #### ` set_canvas_size(width, height) `
293+ ### ` set_canvas_size(width, height) `
294294
295295Set both canvas width and height and recreate the raster surface.
296296
@@ -301,7 +301,7 @@ Set both canvas width and height and recreate the raster surface.
301301** Returns:**
302302- ` Gw ` : Self for method chaining
303303
304- #### ` set_theme(theme_name) `
304+ ### ` set_theme(theme_name) `
305305
306306Set a predefined visualization theme.
307307
@@ -317,7 +317,7 @@ Set a predefined visualization theme.
317317gw.set_theme(" dark" )
318318```
319319
320- #### ` set_paint_ARBG(paint_enum, a, r, g, b) `
320+ ### ` set_paint_ARBG(paint_enum, a, r, g, b) `
321321
322322Set the ARGB color for a specific paint type.
323323
@@ -334,7 +334,7 @@ Set the ARGB color for a specific paint type.
334334gw.set_paint_ARBG(GwPalette.NORMAL_READ , 255 , 0 , 0 , 128 )
335335```
336336
337- #### ` apply_theme(theme_dict) `
337+ ### ` apply_theme(theme_dict) `
338338
339339Apply a custom theme using a dictionary of paint types and colors.
340340
@@ -354,7 +354,7 @@ custom_theme = {
354354gw.apply_theme(custom_theme)
355355```
356356
357- #### ` load_theme_from_json(filepath) `
357+ ### ` load_theme_from_json(filepath) `
358358
359359Load and apply a theme from a JSON file.
360360
@@ -369,7 +369,7 @@ Load and apply a theme from a JSON file.
369369gw.load_theme_from_json(" custom_theme.json" )
370370```
371371
372- #### ` save_theme_to_json(filepath) `
372+ ### ` save_theme_to_json(filepath) `
373373
374374Save the current theme settings to a JSON file.
375375
@@ -385,7 +385,7 @@ Save the current theme settings to a JSON file.
385385gw.save_theme_to_json(" my_theme.json" )
386386```
387387
388- #### ` set_font_size(size) `
388+ ### ` set_font_size(size) `
389389
390390Set the font size.
391391
@@ -395,7 +395,7 @@ Set the font size.
395395** Returns:**
396396- ` Gw ` : Self for method chaining
397397
398- #### ` set_font_name(name) `
398+ ### ` set_font_name(name) `
399399
400400Set the font name.
401401
@@ -437,14 +437,14 @@ Set the font name.
437437
438438### Interactive Controls
439439
440- #### ` apply_command(command) `
440+ ### ` apply_command(command) `
441441
442442Apply a GW command string.
443443
444444** Parameters:**
445445- ` command ` (str): GW command to execute (e.g., "filter", "count", etc.)
446446
447- #### ` key_press(key, scancode, action, mods) `
447+ ### ` key_press(key, scancode, action, mods) `
448448
449449Process a key press event.
450450
@@ -454,7 +454,7 @@ Process a key press event.
454454- ` action ` (int): Key action code
455455- ` mods ` (int): Modifier keys
456456
457- #### ` mouse_event(x_pos, y_pos, button, action) `
457+ ### ` mouse_event(x_pos, y_pos, button, action) `
458458
459459Process a mouse event.
460460
0 commit comments