Jacques Serizay1, Julie Ahringer1. 1. The Gurdon Institute and Department of Genetics, University of Cambridge, Cambridge, CB2 1QN, UK.
Abstract
Periodic occurrences of oligonucleotide sequences can impact the physical properties of DNA. For example, DNA bendability is modulated by 10-bp periodic occurrences of WW (W = A/T) dinucleotides. We present periodicDNA, an R package to identify k-mer periodicity and generate continuous tracks of k-mer periodicity over genomic loci of interest, such as regulatory elements. periodicDNA will facilitate investigation and improve understanding of how periodic DNA sequence features impact function. Copyright:
Periodic occurrences of oligonucleotide sequences can impact the physical properties of DNA. For example, DNA bendability is modulated by 10-bp periodic occurrences of WW (W = A/T) dinucleotides. We present periodicDNA, an R package to identify k-mer periodicity and generate continuous tracks of k-mer periodicity over genomic loci of interest, such as regulatory elements. periodicDNA will facilitate investigation and improve understanding of how periodic DNA sequence features impact function. Copyright:
Short DNA sequence motifs provide key information for interpreting the instructions in DNA, for example by providing binding sites for proteins or altering the structure of the double-helix. A less studied but important feature of DNA sequence motifs is their periodicity
[1–
4]. Two famous examples are the universal 3bp periodic (RNY)
n pattern (R = A or G, Y = C or U, N = any base) in exons
[5] and 10-bp periodic k-mers in nucleosome positioning (reviewed in
6 and
7). However, despite the wealth of software focusing on motif discovery and analysis, no tool provides an easy way to quantify the periodicity of a given motif, i.e. the extent to which a given motif is repeated at a regular interval in specific sequences. For instance, HeliCis and SpaMo identify conserved distances between two motifs in sequences of interest, but they do not assess larger scale periodic occurrences of motifs
[8,
9].Here we present periodicDNA, an R package to investigate k-mer periodicity. periodicDNA provides a framework to quantify the periodicity of any k-mer of interest in DNA sequences. It can identify which periods are statistically enriched in a set of sequences by using a randomized shuffling approach to compute an empirical p-value and can also generate continuous linear tracks of k-mer periodicity strength over genomic loci.
Methods
Operation
The two main functions of periodicDNA are
and
. The
function interrogates the extent to which a given k-mer periodically occurs, and at which periods, in one sequence or a set of sequences. It uses a randomized shuffling approach to compute an empirical p-value and identify k-mer periods that are statistically enriched in the sequences of interest.
generates a linear .bigWig track over genomic loci of interest, representing the periodicity strength of a chosen k-mer at a given period.periodicDNA is available as an R package on Github. Package dependencies and system requirements are documented here:
https://js2264.github.io/periodicDNA/. periodicDNA has been tested using R (version 4.0.2) on Mac OS (versions 10.11 and later) and Ubuntu 18.04.2 machines.
Implementation
Internally,
and
functions both compute the power spectral density (PSD) of an input k-mer in input sequence(s) to estimate its average periodicity. The magnitude of the PSD reflects the strength of the k-mer signal at periodic positions
[10]. To compute the power spectral density (PSD) of a k-mer of interest in one or several sequences, the following steps are executed (
Figure 1):
Figure 1.
Estimation of k-mer power spectral density with periodicDNA.
(
A) The k-mer of interest is mapped in the input sequence and all pairwise distances are calculated. (
B) The distribution of all resulting pairwise distances (also called the "distogram") is generated. (
C) The distogram is transformed into a frequency histogram and (
D) smoothed using a moving window of 3 to mask the universal three-base genomic periodicity
[11]. (
E) To normalize the frequency for distance decay, the local average (obtained by averaging the frequency with a moving window of 10) is subtracted from the smoothed frequency. (
F) Finally, the power spectral density (PSD) is estimated using a Fast Fourier Transform (
F). In this example, TT shows strong 10bp periodicity.
Estimation of k-mer power spectral density with periodicDNA.
(
A) The k-mer of interest is mapped in the input sequence and all pairwise distances are calculated. (
B) The distribution of all resulting pairwise distances (also called the "distogram") is generated. (
C) The distogram is transformed into a frequency histogram and (
D) smoothed using a moving window of 3 to mask the universal three-base genomic periodicity
[11]. (
E) To normalize the frequency for distance decay, the local average (obtained by averaging the frequency with a moving window of 10) is subtracted from the smoothed frequency. (
F) Finally, the power spectral density (PSD) is estimated using a Fast Fourier Transform (
F). In this example, TT shows strong 10bp periodicity.The k-mer occurrences are mapped and their pairwise distances are calculated (
Figure 1A).The distribution of all the resulting pairwise distances (also called "distogram") is generated (
Figure 1B).The distogram is transformed into a frequency histogram (
Figure 1C) and smoothed using a moving window of 3 to mask the universal three-base genomic periodicity
[11] (
Figure 1D). To normalize the frequency for distance decay, the local average (obtained by averaging the frequency with a moving window of 10) is subtracted from the smoothed frequency (
Figure 1E).Finally, the power spectral density (PSD) is estimated using a Fast Fourier Transform (
Figure 1F). The magnitude of the PSD values indicates the contribution of a given period to the overall periodicity of the k-mer of interest. In
Figure 1, TT dinucleotides are generally 10bp periodic.The package relies on BSGenome packages to handle genome assemblies. Genomic loci can be imported from BED files with rtracklayer and are handled in R by the GenomicRanges classes. Biostrings functions are used to map k-mer occurrences in sequences of interest.
Workflow
Installation
To install the current release of periodicDNA from Bioconductor, use:Alternatively, the developing branch of periodicDNA can be installed from Github as follows:
Quantifying k-mer periodicity over a set of sequences
Using a provided k-mer (e.g. WW,
argument) and a set of sequences of interest (
argument),
computes several different metrics:The k-mer power spectral density (PSD) values at different periods obtained by Fourier Transform (following the approach described in the Implementation section). For each individual period
T, the corresponding PSD
indicates the relative contribution of the period to the overall periodicity of the k-mer of interest
[10].The log2 fold-change, for each individual period
T, between the observed PSD
and the median of the PSD
values measured after shuffling n times the input sequencesAssociated empirical p-values and false discovery rates (FDR) indicating, for each individual period
T, whether the observed PSD
is significantly greater than PSD
values measured after shuffling n times the input sequences
[12]). Note that empirical p-values are only an estimation of the real p-value. Notably, small p-values are systematically over-estimated as their lower bound is 1/(
n + 1).These metrics are accessible in the
table obtained when running
. For each Frequency (or Period) analysed by Fourier Transform, the resulting PSD value, a log2 fold-change, its associated p-value as well as its false-discovery rate (FDR) are returned (see tables in the examples below).We ran
on a set of 6,533 300-bp long sequences centered at all
S. cerevisiae TSSs, to investigate WW periodicity, comparing to 500 shufflings as default. Using 12 cores in parallel, this function took approximately 15 minutes to run. The results were then plotted using
(
Figure 2A), demonstrating the known underlying 10-bp WW periodicity present at promoter sequences in the yeast genome
[13].
Figure 2.
Output of the plotPeriodicityResults() function run on getPeriodicity() results.
To identify periodicity of WW dinucleotides, getPeriodicity() was run on (
A) a set of 300-bp long sequences centered at 6,533
S. cerevisiae TSSs and (
B) a set of 300-bp long sequences centered at 2,295 ubiquitous
C. elegans TSSs
[14]. The plotPeriodicityResults() function was run on the getPeriodicity() results to generate three plots as shown. Left, frequency histogram of distribution of pairwise WW distances; middle, normalised frequency histogram of distribution of pairwise WW distances; right, power spectral densities (PSDs) of a set of experimental sequences (red) and 500 iterations of shuffled sequences (grey). Grey ribbon represents the 95% confidence interval of the PSD values obtained after sequence shuffling. Red-filled dots represent PSD values in experimental sequences statistically higher than those from shuffled sequences (FDR < 0.05).
Output of the plotPeriodicityResults() function run on getPeriodicity() results.
To identify periodicity of WW dinucleotides, getPeriodicity() was run on (
A) a set of 300-bp long sequences centered at 6,533
S. cerevisiae TSSs and (
B) a set of 300-bp long sequences centered at 2,295 ubiquitous
C. elegans TSSs
[14]. The plotPeriodicityResults() function was run on the getPeriodicity() results to generate three plots as shown. Left, frequency histogram of distribution of pairwise WW distances; middle, normalised frequency histogram of distribution of pairwise WW distances; right, power spectral densities (PSDs) of a set of experimental sequences (red) and 500 iterations of shuffled sequences (grey). Grey ribbon represents the 95% confidence interval of the PSD values obtained after sequence shuffling. Red-filled dots represent PSD values in experimental sequences statistically higher than those from shuffled sequences (FDR < 0.05).Using the same approach, we measured the WW periodicity around ubiquitous TSSs in
C. elegans, which have been characterized as largely enriched for WW 10-bp periodic sequences
[14] (
Figure 2B). The 10-bp WW periodicity at ubiquitous
C. elegans TSSs
is stronger than at all
S. cerevisiae TSSs.
Generating tracks of k-mer periodicity
The
function calculates the strength of a given k-mer at a particular periodicity across genomic regions of interest, generating a linear genomic track in .bigWig format (
Figure 3). The user specifies a genome and a set of genomic loci, a motif and a period of interest, and a sliding window size (
, 100 bp by default) and step value (
, 2 bp by default). The input genomic loci are split into small sliding windows and for each window, the k-mer periodicity is quantified as described in the Implementation section. The PSD value at the period of interest (e.g.
) is then retrieved and assigned to the center of the corresponding window. Finally, the resulting .bigwig track is smoothed using a rolling window (
).
should be run in parallel across many cores using the
BPPARAM argument from BiocParallel. Using 12 cores, this command takes approximately half a day to produce a periodicity track over ~ 15,000 1-kb-long GRanges with default parameters.
Figure 3.
Example of WW dinucleotide 10-bp periodicity track at promoters in
C. elegans.
ATAC-seq signal and 10-bp WW dinucleotide periodicity at three
C. elegans promoters. 10bp WW dinucleotide periodicity signal was generated at 1 kb centered at annotated
C. elegans promoters
[14] using the `generatePeriodicityTrack()` function. The data are vizualised using IGV.
Example of WW dinucleotide 10-bp periodicity track at promoters in
C. elegans.
ATAC-seq signal and 10-bp WW dinucleotide periodicity at three
C. elegans promoters. 10bp WW dinucleotide periodicity signal was generated at 1 kb centered at annotated
C. elegans promoters
[14] using the `generatePeriodicityTrack()` function. The data are vizualised using IGV.As an example, we generated a WW 10-bp periodicity linear track over annotated promoters in
C. elegans genome. In the previous section, we have shown that sequences in the vicinity of ubiquitous TSSs were statistically enriched for WW 10-bp periodicity. Here, the .bigwig track highlights the increased WW 10-bp periodicity in the sequences immediately flanking ubiquitous promoters, where the -1 and +1 nucleosomes are positioned
[14].
Conclusion
periodicDNA is an R package that provides functions to investigate the periodicity of k-mers of interest in DNA sequences. It is primarily designed to analyse individual or sets of sequences (typically few hundred bases long and up to a kilobase) to identify overall periodicity of a chosen k-mer. It can also generate linear .bigwig tracks of k-mer periodicity at a chosen period (e.g. 10-bp WW periodicity), over genomic loci of interest. periodicDNA is well integrated within the Bioconductor environment and can easily fit in standard genomic analysis workflows.
Data availability
Underlying data
This project contains underlying data published in Serizay
et al., 2020
[14]. All the data are also available from the original reference.
Software availability
periodicDNA is released as an R package on Bioconductor:
http://www.bioconductor.org/packages/release/bioc/html/periodicDNA.htmlSource code available from:
https://github.com/js2264/periodicDNA.Archived source code as at time of publication:
https://doi.org/10.5281/zenodo.4533704
[15].License: GPL-3periodicDNA is a R/Bioconductor package for the detection and visualisation of string-based periodic motifs (k-mers) in DNA sequences. While there are several periodic motifs that are known to occur in genomic sentences, the paper - and, for the most part, the tool itself - focuses on the analysis of by far the most important of them, the 10-bp periodicity of WW dinucleotides that is the hallmark of nucleosome positioning signals, present in the majority of RNA polymerase II promoters, in most eukaryotic genomes analysed so far.The tool implements the calculation of power spectral density over the distances between the instances of k-mers in a set of sequences by normalising the frequencies of pairwise TT distances against "smoothed" distances. It has only a couple of main functions, one for performing general power spectrum analyses, with table of power spectral density as a result, and one that produces a genome browser track for a selected set of sequences using a predefined period size. The latter is shown to produce a characteristic double pattern at bidirectional promoters in
C. elegans (Figure 3).The tool is simple, clean, and seems to do its job well. I have only a couple of suggestions:The smoothed local average (Figure 1D) uses a 10 bp window. While that is a suitable window size for nucleosome positioning signal, it might not work for exploring other, possibly unknown periodic motifs. It should at least be remarked on, and the authors should consider adding functionality to suggest an optimal or at least minimal window size for averaging.The stated running times on a 12-core CPU for the presented examples look surprisingly long to me. Could the authors provide more detail - with or without profiling the code - about which computational step is the reason the whole calculation takes this long?Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?YesIs the rationale for developing the new software tool clearly explained?YesIs the description of the software tool technically sound?YesAre sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?PartlyIs sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?YesReviewer Expertise:Gene regulation.I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.The manuscript is aimed at solving an important problem - the study of the structure of promoter sequences. The calculations are performed at a good scientific level, the results are beyond doubt. I have only three, as it seems to me, small comments.1. It seems to me that it is not entirely correct to represent the data as a file printout. Probably it would be better to present this data in the form of tables.2. Figure 3 evokes some skepticism. It seems to me that it is very difficult to draw a conclusion on 3 promoters. Maybe this is a purely coincidence. I believe that it is necessary to study much more promoters in this way in order to draw any conclusions. Probably more promoter sequences need to be studied.3. There are a lot of publications on the search for periodicity in promoter sequences. For example, Kravatskaya GI
et al. (2011)
[1] and Nov Klaiman T
et al. (2009)
[2]It seems to me that a little comparative analysis could be done in the discussion.Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?PartlyIs the rationale for developing the new software tool clearly explained?YesIs the description of the software tool technically sound?YesAre sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?YesIs sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?YesReviewer Expertise:BioinformaticsI confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.The manuscript by Serizay and Ahringer presents an R/Bioconductor package to investigate the k-mer periodicity in DNA. Both the manuscript and the package details are informative and will be useful to the researchers. The following are some minor comments and suggestions:a) Regarding the shuffling of input sequences, it is not clear if there is an option to preserve the doublet or triplet nucleotide counts. Is the parameter “order” in getPeriodicity() function meant for that (through ushuffle)? If so, please do mention this in the manuscript and its default value.b) In addition to the shuffling of input sequences, it would also be useful if the function allows for random selection of N number of sequences (with similar GC content) from the genome or an option for the users to define their own set of input random sequences (through DNAstringSet or bed file).c) In Figure 1A, under the “Mapping of all dinucleotides” it is not clear why the single occurrence of ‘T’ is also shaded.Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?YesIs the rationale for developing the new software tool clearly explained?YesIs the description of the software tool technically sound?YesAre sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?YesIs sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?YesReviewer Expertise:Bioinformatics, Cancer genomics, mutational processes and gene regulation.I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.The software offered is potentially helpful to the researchers in the area. However the paper (and probably the software itself) should be modified to enable its complete evaluation for indexing.Comparison to other existing state of the art approaches should be added, e.g. to PerPlot and PerScan tools by Mrazek and colleagues
[1], ID/MPA by Shelenkov
et al., 2008
[2]. The progress obtained in the present submission should be clarified.All the examples shown in the paper and related links are focused on TT dinucleotides. It is not clear whether oligo nucleotide combinations involving W, S, R, Y, N, and others from the IUPAC nucleotide codes are supported by the present software version.It is not clear whether there any other restrictions on the software parameters, e.g. oligonucleotide and sequences lengths.The software is composed at R language with key functions provided. To make it really practically helpful, the graphic user interface should be provided, to enable entering oligonucleotides of interest and other parameters from a window or dialogue line, without necessitating the changes in the functions text. As a very minimum, the clear instructions for such changes should be provided.Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?YesIs the rationale for developing the new software tool clearly explained?YesIs the description of the software tool technically sound?YesAre sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?YesIs sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?YesReviewer Expertise:Bioinformatics, gene regulation, nucleosomes, algorithmsI confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.
Authors: Robson P Bonidia; Douglas S Domingues; Danilo S Sanches; André C P L F de Carvalho Journal: Brief Bioinform Date: 2022-01-17 Impact factor: 11.622