#install library
#devtools::install_github("ipatop/SylamerTools")
library(SylamerTools)This package contains three functions that can be used to aid with running Sylamer Stijn van Dongen, Cei Abreu-Goodger & Anton J. Enright; Nature Methods(2008), PMID: 18978784.
It contains:
Sylamer is a tool that analyzes expression data to identify microRNA targets and small interfering (si)RNA off-target signals. It takes as input a ranked list of 3’ untranslated regions (UTRs) that have been upregulated or downregulated following an miRNA or RNAi experiment, and generates a landscape plot showing the occurrence biases of various words across the gene ranking using hypergeometric P-values.
Sylamer requires as input a sorted list of genes from up to down
regulated. The function sort_forSylamer will sort any list
of genes by any column name.
Input requirements: a column named “gene”, another column to sort genes by. Any other column will be ignored.
| gene | log2FoldChange |
|---|---|
| mthl8 | 0.05805309 |
| ——– | ————— |
| Lsp1gamma | 2.09023047 |
Output: a file with the sorted genes ready to input into sylamer
Input example
#This is how the input looks like
head(read.table(file = paste0(system.file("extdata", package = "SylamerTools"),"/res.txt"),header = T))
#> gene baseMean log2FoldChange lfcSE stat pvalue padj
#> 1 mthl8 480.476820 0.05805309 0.1409806 0.4117806 0.6805002 0.9422009
#> 2 Lsp1gamma 1.971752 2.09023047 1.8926526 1.1043920 0.2694231 NA
#> 3 Pdk1 668.354042 -0.06472959 0.1183939 -0.5467308 0.5845637 0.9095280
#> 4 CG6845 24.024720 0.12128159 0.5561318 0.2180807 0.8273663 0.9641271
#> 5 p130CAS 1346.522453 0.13777787 0.1273631 1.0817719 0.2793539 0.7550686
#> 6 CG13875 38.543555 -0.66824956 0.4508732 -1.4821231 0.1383075 0.5740710Output example
sort_forSylamer(DEres = paste0(system.file("extdata", package = "SylamerTools"),"/res.txt"),sortBy = "log2FoldChange",outName =paste0(system.file("extdata", package = "SylamerTools") ,"/ForSylamer.txt"))
head(read.table(file = paste0(system.file("extdata", package = "SylamerTools"),"/ForSylamer.txt") ,header = T))
#> gene log2FoldChange
#> 1 CG32603 -5.591494
#> 2 CG32551 -5.583956
#> 3 Obp56g -5.431501
#> 4 CG13033 -4.436248
#> 5 CG14277 -4.377052
#> 6 CR44509 -4.299989The function create_sylamer_script will return a file
ready to run.
The output from this function can be run in unix as follows:
sh sylamer_command.shThis function takes the following options.
utrFile: File with the UTR sequences. Defauls is
“dm3_flybase_3utrs.fa”kSylamer: Oligo letter length or Word size, has to be
the same length as those in the “words” file. Default is 6kMarkov: Size of a smaller word to be used for
correcting composition biases. Default is 4winSize: How many sequences should be added in each
consecutive window. Default is 200sylamer: Sylamer executable path. Default is
“/opt/linux64bin/sylamer”sylOutput: Name of output file to write table in.
Default is “shRNA_sylamer.output.tab”imageOut: Name of output file to write plot in. Default
is “shRNA_image.output.pdf”DEsorted: Name of one or multiple list of sorted genes
to input in sylamen. Default is
c(“ForSylamer.txt”,“ForSylamer_2.txt”)extras: Any extra parametere to pass into Sylamer.
Default is “-a 10 -aa 5 –funny-ok”overwrite: Boolean. If True, the script will overwrite
any existing script with the same name. Default is Tsylamer_comand: Name of the file to write the command
into “sylamer_command.sh”create_sylamer_script(utrFile = paste0(system.file("extdata", package = "SylamerTools"),"/dm3_flybase_3utrs.fa"), overwrite = T, DEsorted=paste0(system.file("extdata", package = "SylamerTools"),c("/ForSylamer.txt","/ForSylamer_2.txt")))
#> [1] "Reading file: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/SylamerTools/extdata/ForSylamer.txt"
#> [1] "Reading file: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/SylamerTools/extdata/ForSylamer_2.txt"
#> Warning in file.remove(sylamer_comand): cannot remove file 'sylamer_command.sh',
#> reason 'No such file or directory'Output
read.delim("sylamer_command.sh",header = F)
#> V1
#> 1 /opt/linux64bin/sylamer -fasta /Library/Frameworks/R.framework/Versions/4.2/Resources/library/SylamerTools/extdata/dm3_flybase_3utrs.fa -grow 200 -k 6 --print-id -m 4 -subset /Library/Frameworks/R.framework/Versions/4.2/Resources/library/SylamerTools/extdata/ForSylamer.txt -o shRNA_sylamer.output.tab
#> 2 /opt/linux64bin/sylamer -fasta /Library/Frameworks/R.framework/Versions/4.2/Resources/library/SylamerTools/extdata/dm3_flybase_3utrs.fa -grow 200 -k 6 --print-id -m 4 -subset /Library/Frameworks/R.framework/Versions/4.2/Resources/library/SylamerTools/extdata/ForSylamer_2.txt -o shRNA_sylamer.output.tabSylamer output has to be organized to be able to interpret and plot them. To this end, we wrote a function thatsort the results and plot them.
It takes the following options:
oligosChosen: Sequences to highlight (Any particular
words that you want highlighted) Defaults is =c(“TGTAAA”,“GATGCT”)sylamer.out.tab: Name of sylamer output to read from.
Dafault is “shRNA_sylamer.output.tab”topOligos: Number of top oligos to plot. How many best
words should I highlight in the image? Defauls is 0lowOligos: Number of low oligos to plot. Defauls is
0outName: name for the plot output. Default is
“sylamerplot”greylines: Boolean, To plot or not greay background
oligos. Default is FkSylamer: Default is 6Sylamer Output
read.delim(paste0(system.file("extdata", package = "SylamerTools"),"/L2FcSh_sylamer.output.tab"))[1:3,1:3]
#> upper X200 X400
#> 1 AAAAAA -1.872460 -1.281310
#> 2 AAAAAC 0.286661 0.773536
#> 3 AAAAAG 0.496839 0.485142Plot
sylamerplots(oligosChosen=c("TGTAAA","GATGCT"),sylamer.out.tab=paste0(system.file("extdata", package = "SylamerTools"),"/L2FcSh_sylamer.output.tab"),outName ="shRNA_fake")sylamerplots(oligosChosen=c("TGTAAA","GATGCT"),sylamer.out.tab=paste0(system.file("extdata", package = "SylamerTools"),"/L2FcSh_sylamer.output.tab"),greylines = T,outName = "shRNA_fake_markingGrey",free_ylim = T)