scatter module

class mavis.illustrate.scatter.ScatterPlot(points, y_axis_label, ymax=None, ymin=None, xmin=None, xmax=None, hmarkers=None, height=100, point_radius=2, title='', yticks=None, colors=None, density=1, ymax_color='#FF0000')[source]

Bases: object

holds settings that will go into matplotlib after conversion using the mapping system

mavis.illustrate.scatter.bam_to_scatter(bam_file, chrom, start, end, density, strand=None, axis_name=None, ymax=None, min_mapping_quality=0, ymax_color='#FF0000')[source]

pull data from a bam file to set up a scatter plot of the pileup

Parameters:
  • bam_file (str) – path to the bam file
  • chrom (str) – chromosome name
  • start (int) – genomic start position for the plot
  • end (int) – genomic end position for the plot
  • bin_size (int) – number of genomic positions to group together and average to reduce data
  • strand (STRAND) – expected strand
  • axis_name (str) – axis name
  • ymax (int) – maximum value to plot the y axis
  • min_mapping_quality (int) – minimum mapping quality for reads to be considered in the plot
Returns:

the scatter plot representing the bam pileup

Return type:

ScatterPlot

mavis.illustrate.scatter.draw_scatter(ds, canvas, plot, xmapping, log=<mavis.util.Log object>)[source]

given a xmapping, draw the scatter plot svg group

Parameters:
  • ds (DiagramSettings) – the settings/constants to use for building the svg
  • canvas (svgwrite.canvas) – the svgwrite object used to create new svg elements
  • plot (ScatterPlot) – the plot to be drawn
  • xmapping (dict of Interval by Interval) – dict used for conversion of coordinates in the xaxis to pixel positions