plot_deltaSNPindex: Plot delta(SNP index)

Description Usage Arguments Details Examples

View source: R/plot_deltaSNPindex.r

Description

This function allows plotting the delta(SNP-index) values against the mid position of the corresponding window of a specific chromosome. By setting the dpi parameter (resolution), the plot will be automatically saved in .TIF format.

Note: for journal publications the preferred format is .TIF, and the minimum resolution is of 600 dpi or 1200 dpi. Always refer to journal-specific guidelines.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_deltaSNPindex(
  deltaSNPindex.windows,
  chr,
  filename = paste0("plot_deltaSNPindex_ch", chr),
  path = getwd(),
  dpi,
  width = 7.5,
  height = 5,
  units = "in"
)

Arguments

deltaSNPindex.windows

filtered data frame (containing both bulks)

chr

chrosome ID

filename

file name under which the file will be saved (default="plot_deltaSNPindex_chX")

path

path where the file will be saved (default=current working directory)

dpi

resolution value. If no value is given, plots will be generated but not saved

width

width value (default=7.5)

height

height value (default=5)

units

size units (default="in")

Details

∆(SNP-index) values are plotted against window mid position in a ggplot2line plot. If the dpi argument is not passed, the plot will be shown in the plot panel; however, if a value is added to the dpi argument, the graph will be saved in TIFF format. Additionally, the name with which to save the file, the directory, the height and width of the plot and their units can be specified in the arguments. The plot will be saved with default values if different ones are not specified.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Use default values WITHOUT saving the plot
plot_deltaSNPindex(deltaSNPindex.windows=deltaSNPindex_windows, 
                   chr=3)
## OR use default values AND save the plot
plot_deltaSNPindex(deltaSNPindex.windows=deltaSNPindex_windows, 
                   chr=3,
                   dpi=1200)
## OR customise default parameters
plot_deltaSNPindex(deltaSNPindex.windows=deltaSNPindex_windows, 
                   chr=3,
                   filename="deltaSNPindex_ch3", 
                   path="Document/Plots", 
                   dpi=1200, 
                   width=20, 
                   height=12, 
                   units="cm")

EG-lisy/BSAvis documentation built on Dec. 17, 2021, 5:38 p.m.