Sylamer tools

Instalation and Setup

#install library
#devtools::install_github("ipatop/SylamerTools")
library(SylamerTools)

Description

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:

  1. A function to sort genes by any numerical condition
  2. A function to create a shell commando to run Sylamer
  3. A function to plot the Sylamer output

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.

Sort genes

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.5740710

Output 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.299989

Create sylamer command

The 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.sh

This function takes the following options.

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.tab

Plot Sylamer output

Sylamer 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:

Sylamer 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.485142

Plot

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)