Skip to contents

This function generates a plot of an IQ locus, including DNA sequence, motif responses, and ATAC-seq tracks.

Usage

plot_iq_locus(
  interval,
  pbm_list,
  atac_tracks,
  width = 500,
  ext_width = 200000,
  T_emax = 8,
  T_rmax = NULL,
  motifs = NULL,
  plot_others = FALSE,
  trim_pbms = TRUE,
  trim_bits_thresh = 0.1,
  bits_threshold = NULL,
  order_motifs = TRUE,
  atac_names = atac_tracks,
  atac_colors = NULL,
  atac_sizes = NULL,
  line_thresh = 0.9,
  title = NULL,
  score = NULL,
  predicted_score = NULL,
  dna = NULL,
  norm_q = 0.995,
  tracks_q = NULL,
  iterator = 20,
  norm_intervals = gintervals.all(),
  atac_smooth = 2,
  ext_atac_smooth = atac_smooth * 5,
  tn5bias_track = "tn5bias",
  normalize_tn5bias = TRUE,
  tss_intervals = "intervs.global.tss",
  exon_intervals = "intervs.global.exon",
  annot_track = NULL,
  annot_track_name = NULL,
  annot_colors = c("#FF9800", "#009688"),
  annot_track_iterator = 1,
  annot_track_smooth = 1,
  annot_intervals = NULL,
  annot_intervals_color = "darkgreen",
  mark_conservation = FALSE,
  conservation_threshold = 1.5,
  scale_cex = 500,
  dna_height = 0.03,
  filename = NULL,
  dev = grDevices::pdf,
  plot_width = 15,
  plot_height = 8,
  base_size = 8,
  base_family = "ArialMT",
  rasterize = FALSE,
  raster_device = "ragg",
  ...
)

Arguments

interval

A genomic interval to plot.

pbm_list

A list of PBM objects.

atac_tracks

A vector of ATAC-seq track names to plot.

width

Width of the plot in bp.

ext_width

Width of the top plot in bp.

T_emax

Numeric, threshold for maximum energy.

T_rmax

Numeric, threshold for maximum response.

motifs

A list of specific motifs to plot.

plot_others

Logical, whether to plot other motifs that pass the threshold when specific motifs are provided.

trim_pbms

Logical, whether to trim PBM objects by removing positions with low information content from the beginning and end of the PSSM.

trim_bits_thresh

Numeric, threshold for trimming PBM objects.

bits_threshold

Numeric, threshold for trimming PSSMs.

order_motifs

Logical, whether to order motifs by maximum response.

atac_names

Character vector, names for ATAC-seq tracks.

atac_colors

Named vector, colors for ATAC-seq tracks.

atac_sizes

Named vector, line sizes for ATAC-seq tracks.

line_thresh

Numeric, threshold for drawing vertical lines.

title

Character, optional title for the plot.

score

Numeric, optional score to display in the plot title.

predicted_score

Numeric, optional predicted score to display in the plot title.

dna

Character, DNA sequence to plot. If NULL, the sequence is extracted from the interval.

norm_q

Numeric, quantile for normalization. If a vector, should have the same length as atac_names.

tracks_q

Data frame, pre-computed quantiles for tracks. Should have a 'type' column and a 'q' column.

iterator

Numeric, iterator for gextract.

norm_intervals

Genomic intervals for normalization.

atac_smooth

Numeric, smoothing factor for ATAC-seq tracks.

ext_atac_smooth

Numeric, smoothing factor for the top plot.

tn5bias_track

Character, name of the Tn5 bias track.

normalize_tn5bias

Logical, whether to normalize using the TN5 bias track. If a vector, should have the same length as atac_names.

tss_intervals

Character, name of the TSS intervals track.

exon_intervals

Character, name of the exon intervals track.

annot_track

Character, name of the annotation track.

annot_track_name

Character, display name for the annotation track.

annot_colors

Named vector, colors for annotation track.

annot_track_iterator

Numeric, iterator for annotation track extraction.

annot_track_smooth

Numeric, smoothing factor for annotation track.

annot_intervals

Genomic intervals for annotation (start positions would be used).

annot_intervals_color

Color for annotation intervals.

mark_conservation

Logical, whether to mark conservation in the DNA sequence.

conservation_threshold

Numeric, threshold for marking conservation.

scale_cex

Numeric, scaling factor for letter sizes.

dna_height

Numeric, height of each row of DNA sequence relative to the entire plot.

filename

Character, output filename (if NULL, plot is not saved).

dev

Function, device to use for plotting.

plot_width

Numeric, width of the output plot.

plot_height

Numeric, height of the output plot.

base_size

Numeric, base font size for the plot.

base_family

Character, base font family for the plot.

rasterize

Logical, whether to rasterize certain plot elements for better performance.

raster_device

Character, device to use for rasterization.

...

additional arguments to pass to the plotting function.

Value

A ggplot object containing the IQ locus plot.