SNPindex_plot: SNP-index Wrapper Function

Description Usage Arguments Details Examples

View source: R/SNPindex_plot.R

Description

This wrapper function is used to fully run the SNP-index method, by calling all the funcitons involved in plotting the mean SNP-index values from each bulk against the mid position of the corresponding window of a specific chromosome.

SNPindex=AD_alt/(AD_ref + AD_alt)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
SNPindex_plot(
  vcf.list,
  wtBulk,
  mBulk,
  variants = "SNP",
  min.SNPindex = 0.3,
  max.SNPindex = 0.9,
  min.DP = 50,
  max.DP = 200,
  min.GQ = 99,
  chrID,
  chr,
  windowSize = 1e+06,
  windowStep = 10000,
  filename = paste0("plot_SNPindex_ch", chr),
  path = getwd(),
  dpi,
  width = 7.5,
  height = 5,
  units = "in"
)

Arguments

vcf.list

object containing meta information and vcf data frame

wtBulk

Wild-Type pool

mBulk

Mutant pool

variants

variants to be considered. Default is "SNP" (allowed: "SNP" or "all")

min.SNPindex

min value allowed for the SNP index (default=0.3)

max.SNPindex

max value allowed for the SNP index (default=0.9)

min.DP

min value allowed for the read depth (default=50)

max.DP

max value allowed for the read depth (default=200)

min.GQ

min value allowed for the genotype quality (default=99)

chrID

chromosome ID of interest

chr

chromosome name printed on the plot

windowSize

window size (default=1000000)

windowStep

window step (default=10000)

filename

file name under which the file will be saved (default="plot_SNPindex_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

Wrapper function that sequentially calls the required functions involved in generating the SNP-index plot: calc_SNPindex(), filter_SNPindex(), extract_chrIDs(), slidingWindow() and plot_SNPindex(). The resulting plot will show (for each bulk) mean SNP-index values against the mid position of the corresponding window of a specific chromosome.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Use default values WITHOUT saving the plot
SNPindex_plot(vcf.list=vcf_list, 
         wtBulk="pool_S3781_minus", 
         mBulk="pool_S3781_plus", 
         chrID="SL4.0ch03", 
         chr=3)
## OR use default values AND save the plot
SNPindex_plot(vcf.list=vcf_list, 
         wtBulk="pool_S3781_minus", 
         mBulk="pool_S3781_plus", 
         chrID="SL4.0ch03", 
         chr=3,
         dpi=1200)
#OR customise default parameters
SNPindex_plot(vcf.list=vcf_list, 
         wtBulk="pool_S3781_minus", 
         mBulk="pool_S3781_plus", 
         variants="all",
         min.SNPindex=0.25, 
         max.SNPindex=0.8, 
         min.DP=60, 
         max.DP=250, 
         min.GQ=98,
         chrID="SL4.0ch03", 
         chr=3,
         windowSize=2000000, 
         windowStep=20000,
         filename="SNPindex_chrom03", 
         path="Document/Plots", 
         dpi=1200,
         width=20, 
         height=12, 
         units="cm")

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