Question: SeqPattern plotPatternOccurrenceAverage problem
gravatar for elisheva.h02
16 months ago by
elisheva.h020 wrote:


I am trying to plot average profile of dinucleotides frequency in human genes.

I am Using SeqPattern package for it, but when I am trying to add a y limit to the function plotPatternOccurrenceAverage I get an error.

Is there any way to fix this problem?

This is my code:

#Read the TSS bed file.
HumanTSS <- read.delim(path,header = TRUE)
# create GRanges of dominant TSS position
HumanPromotersTSS <- GRanges(seqnames = HumanTSS$chr,ranges = IRanges(start = HumanTSS$dominantTSS,end = HumanTSS$dominantTSS),
                                 strand = HumanTSS$strand,interquantileWidth = NULL,seqlengths = seqlengths(Hsapiens))
# get regions flanking TSS - 3,000 bp upstream and 3,000 bp downstream.
HumanPromotersTSSflank <- promoters(HumanPromotersTSS, upstream = 3000,downstream = 10000)
#obtain genomic sequence of flanking regions
HumanPromotersTSSflankSeq <- getSeq(Hsapiens, HumanPromotersTSSflank)

op <- par(mar = c(7,7,4,2) + 0.1)
plotPatternOccurrenceAverage(regionsSeq = HumanPromotersTSSflankSeq,xLabel = "", yLabel = "",
                             patterns = c("C","G"), flankUp = 3000, flankDown = 10000,
                             smoothingWindow = 10, color = c("goldenrod","darkgreen"), xaxt='n',plotLegend = FALSE,cex.axis=1.5)
title(xlab="Relative distance from TSS",cex.lab=2, line = 4)
title(ylab = "Relative G frequency", cex.lab=2, line = 4)

When I tried to add y limit to the plotPatternOccurrenceAverage function like

ylim = c(0.05,0.35)

I got this error:

Error in plot.default(1, 1, xlim = c(-flankUp, flankDown), ylim = c(0,  : 
  formal argument "ylim" matched by multiple actual arguments

This is the session info:

R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

attached base packages:
 parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 BSgenome.Hsapiens.UCSC.hg19_1.4.0 BSgenome_1.44.2                  
rtracklayer_1.36.6                seqPattern_1.8.0                 
Biostrings_2.44.2                 XVector_0.16.0                   
GenomicRanges_1.28.6              GenomeInfoDb_1.12.3              
IRanges_2.10.5                    S4Vectors_0.14.7                 

loaded via a namespace (and not attached):
magrittr_1.5               GenomicAlignments_1.12.2   zlibbioc_1.22.0           
BiocParallel_1.10.1        lattice_0.20-35            R6_2.2.2                  
rlang_0.1.6                stringr_1.2.0              httr_1.3.1                
tools_3.4.0                grid_3.4.0                 SummarizedExperiment_1.6.5
Biobase_2.36.2             plotrix_3.7                KernSmooth_2.23-15        
matrixStats_0.52.2         yaml_2.1.16                digest_0.6.13             
Matrix_1.2-9               GenomeInfoDbData_0.99.0    bitops_1.0-6              
RCurl_1.95-4.9             testthat_2.0.0             DelayedArray_0.2.7        
stringi_1.1.6              compiler_3.4.0             Rsamtools_1.28.0          
XML_3.98-1.9               swirl_2.4.3 


bug seqpattern • 289 views
ADD COMMENTlink modified 15 months ago • written 16 months ago by elisheva.h020
Please include the code and output as well as `sessionInfo()`
ADD REPLYlink written 15 months ago by shepherl ♦♦ 1.5k

I edited my post

ADD REPLYlink written 15 months ago by elisheva.h020

In the internal code for this plotting function the ylim was hard coded by the maintainer. In its current state there is not an easy way around this. I would suggest emailing the maintainer directly to point out the potential bug. Maintainer: Vanja Haberle <>

ADD REPLYlink written 15 months ago by shepherl ♦♦ 1.5k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 163 users visited in the last hour