matdoering / openprimer Goto Github PK
View Code? Open in Web Editor NEWAn R Package for Multiplex PCR Primer Design and Analysis
Home Page: http://openprimer.mpi-inf.mpg.de
An R Package for Multiplex PCR Primer Design and Analysis
Home Page: http://openprimer.mpi-inf.mpg.de
Hi,
I had an issue while trying to run the design_primers function using openPrimeR.
Here is my description of the problem and my findings:
My system is Windows 10. Have all the tool dependencies installed and properly configure. Running the latest version of R (see sessionInfo at the end of the message).
While trying to run the metnioned function I get an error that says that "ERROR: Failed to open file for reading" when trying to run ViennaRNA RNAfold.exe.
After some debugging I found that the error is generated in the compute.structure.vienna function part of the con_primer_secondary_structures.R
Basically the issue is with the out.file. When generating the input.file and out.file, in the windows system the string contains the drive info (e.g. "C:"). While this doesn't seem to cause any problem when specifying the input file it seems to break the RNAfold.exe for the out.file parameter.
One quick solution I found was to substitute
out.file <- paste0(input.file, "_out")
with
out.file <- paste0(gsub("^C:","",input.file), "_out")
This fix works on my case though I think a more generalized solution would be better.
Not sure if this is a bug or something specific to my system but I thought on reporting in case anybody else runs into the same issue.
Thanks
`
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats4 parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] Biostrings_2.56.0 XVector_0.28.0 IRanges_2.22.2 S4Vectors_0.26.1 BiocGenerics_0.34.0 seqinr_3.6-1 openPrimeR_1.10.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 pillar_1.4.4 compiler_4.0.2 RColorBrewer_1.1-2 GenomeInfoDb_1.24.2 plyr_1.8.6
[7] bitops_1.0-6 iterators_1.0.12 tools_4.0.2 zlibbioc_1.34.0 digest_0.6.25 bit_1.1-15.2
[13] memoise_1.1.0 RSQLite_2.2.0 lifecycle_0.2.0 tibble_3.0.1 gtable_0.3.0 pkgconfig_2.0.3
[19] rlang_0.4.6 foreach_1.5.0 DBI_1.1.0 rstudioapi_0.11 GenomeInfoDbData_1.2.3 stringr_1.4.0
[25] dplyr_1.0.0 generics_0.0.2 vctrs_0.3.1 bit64_0.9-7 ade4_1.7-15 grid_4.0.2
[31] tidyselect_1.1.0 glue_1.4.1 R6_2.4.1 XML_3.99-0.4 blob_1.2.1 DECIPHER_2.16.1
[37] reshape2_1.4.4 ggplot2_3.3.2 purrr_0.3.4 magrittr_1.5 MASS_7.3-51.6 scales_1.1.1
[43] codetools_0.2-16 ellipsis_0.3.1 GenomicRanges_1.40.0 colorspace_1.4-1 uniqtag_1.0 stringi_1.4.6
[49] lpSolveAPI_5.5.2.0-17.7 RCurl_1.98-1.2 munsell_0.5.0 crayon_1.3.4
`
Hi,
Using docker and a web page is nice, but it seems limiting, I tried to use this library in Rstudio and when I run library(openprimeR), it throws me this:
There are missing/non-functioning external tools.
To use the full potential of openPrimeR, please make sure
that the required versions of the speciied tools are
installed and that they are functional:
o MELTING (http://www.ebi.ac.uk/biomodels/tools/melting/)
o ViennaRNA (http://www.tbi.univie.ac.at/RNA/)
o OligoArrayAux (http://unafold.rna.albany.edu/OligoArrayAux.php)
o MAFFT (http://mafft.cbrc.jp/alignment/software/)
o Pandoc (http://pandoc.org)
Warning in fun(libname, pkgname) :
'Pandoc' is non-functional, since 'pdflatex' is not installed on your system.
So, I try to install these dependencies, for windows (in .exe or .msi formats)... and even when I install everything I still get this message, so I consider it unclear how to install the dependencies and it greatly limits the use of this tool .
I realize there is a way to couple docker with R, however this seems dedicated to Linux.
Is there any way to solve that?
Thanks in advance.
I am running openPrimeR on a set of 65 sequences to develop primers for amplicon sequencing. I previously had the package up and running properly on a dummy dataset, but now that I'm running on my actual dataset I am having an issue. At Phase 2 a) in the design_primers function, I lose all of my primers at the melting_temp_range constraint. I have rerun design_primers with an extremely lax melting temperature constraint (0-100) to see if this was actually the issue, and I have also tried running on single sequences and a different set of sequences, but I am consistently getting 0 primers at this step. I also tried restarting R and reloading the package, but there's no change. I also checked my PATH variable in R and it's properly directing to the dependencies. I'm running R version 4.2.1 on Mac with MELTING 5.2.0, Oligo Array Aux 3.8.1. I'm a bit at a loss of what else to check, but I would really prefer using this package to running manually via Primer3. Help is greatly appreciated!
Hi,
I tried to use openprimer and installed all external tools,
when I run the script in conda env under centOS system, I got the below error msg:
library(openPrimeR)
Error: stack file is corrupt
Error: stack file is corrupt
There are missing/non-functioning external tools.
To use the full potential of openPrimeR, please make sure
that the required versions of the speciied tools are
installed and that they are functional:
o MELTING (http://www.ebi.ac.uk/biomodels/tools/melting/)
o OligoArrayAux (http://unafold.rna.albany.edu/OligoArrayAux.php)
o Pandoc (http://pandoc.org)
The number of cores for was set to '2' by 'parallel_setup()'.
Warning messages:
1: In check.tool.function() :
oligoArrayAux failed checks: disabled. Do you have the UNAFOLDDAT environment variable set?
2: In check.tool.function() :
oligoArrayAux failed checks: disabled. Do you have the UNAFOLDDAT environment variable set?
3: In fun(libname, pkgname) :
'Pandoc' is non-functional, since 'pdflatex' is not installed on your system.
How can I fix such problems?Thanks a lot!
Trying to install openPrimeR, but can't find the OligoArrayAux--can anyone supply or point me to an active download site?
TIA!
Noah
Hi, I followed the tutorial trying to compute the Tm of primers, but failed. Could you have a look at the reason? Many thanks
constraint.df = check_constraints(primer.df, template.df, settings, active.constraints = "melting_temp_range")
Error in read.table(file = file, header = header, sep = sep, quote = quote, :
no lines available in input
In addition: Warning message:
executing %dopar% sequentially: no parallel backend registered
Warning messages:
1: In call.melt.single(out.primers[seq.idx[[i]]], out.complements[seq.idx[[i]]], :
MELTING could not compute the Tm:
File: /tmp/RtmpMIHvTh/melt_seqs_1b7d69d6c4dc346a04f0544b03a6093ea6cf555175893.txt.results.csv
Error in read.table(file = file, header = header, sep = sep, quote = quote, : no lines available in input
2: In min(c(Tm.fw$Tm_C_fw[x], Tm.rev$Tm_C_rev[x]), na.rm = TRUE) :
no non-missing arguments to min; returning Inf
3: In min(c(Tm.fw$Tm_C_fw[x], Tm.rev$Tm_C_rev[x]), na.rm = TRUE) :
no non-missing arguments to min; returning Inf
Thanks for this nice tool @matdoering
I wonder whether it would be possible to specify the desired amplicon size. In my case, I want to amplify small regions of a bunch of genes (one per gene), but I do not mind the specific positions of those. My rationale is maybe this allows for more flexibility in terms of finding the smallest possible set of primers than if I just input small templates with random regions of the genes I am interested in. On the other hand, I do not know whether this could lead to much higher computational requirements.
Hello,
I have have all dependencies installed, most of them via conda, including oligoarrayaux (3.8). Only Melting needed to be installed separately. I am pointing R to the respective /bin directories, I am setting the UNAFOLDDAT variable to the respective /share directory.
>library(openPrimeR)
does not complain about missing dependencies and yet upon
> settings <- read_settings(settings.xml)
I get
Reading settings file: C_Taq_PCR_high_stringency.xml
Due to missing external tools the following constraints were ignored:cross_dimerization,self_dimerization
I understand that this is related to oligoarrayaux, which is installed and in the path. Can you please tell me which particular binary openprimer is looking for and is missing? Maybe the conda version does not have all binaries?
thank you very much for your time. I am using R 4.0.2 on MacOSX through Studio 1.3.959.
best
Norman
Hi,
Thanks a lot for the amazing tool!
I wasing using openPrimeR to design multiplex primers for mouse TRB templates, and the phase 3 took days and is still running, while it works fine for the human TRB templates. Is there any way to invoke multiple threads for this step?
Thank you in advance!
ob
messages for R console:
-> Available number of candidates after relaxation: 5231 (97.56% coverage)
# Phase 3: Optimization of primers
Computing cross dimers. This may take a while ...
Dimerization info:
o DeltaG cutoff: -5
o Number of pairs: 27363361
o Number of dimers: 9235302 (33.75%)
o Number of dimerizing primers: 5225
Determining melting temperature sets:
Melting temperature set @ 58.17 with 705 primers (95.12% coverage)
o Computing optimization constraints for target coverage 100%
openPrimeR script:
#! /usr/local/bin/Rscript
library(openPrimeR)
library(dplyr)
library(stringr)
args <- commandArgs(trailingOnly = TRUE)
template_fasta <- args[1]
leader_fasta <- args[2]
settings.xml <- args[3]
parallel_setup(cores = NULL)
## load template
hdr.structure <- c("ACCESSION", "GROUP", "SPECIES", "FUNCTION")
seq.df <- read_templates(template_fasta, hdr.structure, delim = "|", id.column = "GROUP")
seq.df$Group <- seq.df$Group %>%
str_replace("-.*" , "") %>%
str_replace("S.*", "") %>%
str_replace("\\*\\d+$", "")
## add leader region
template.df <- assign_binding_regions(seq.df, fw = leader_fasta, rev = NULL)
## load settings
design.settings <- read_settings(settings.xml)
optimal.primers <- design_primers(template.df, mode.directionality = "fw",
settings = design.settings,
required.cvg = 1,
max.degen = 1,
opti.algo = "ILP")
write_primers(optimal.primers$opti, "opr_designed_primers.fa")
Inputs:
running env:
docker run --rm -it -u 999 -v $(pwd):/data -w /data mdoering88/openprimer:latest bash
Thank you for developing the software. It's great. But I found a small issue when using the latest Docker image. When I upload the sequence file, selecting Uniform in the Definition of allowed binding region will result in an error. The software will remain at the position shown in Figure 3. Warning: Error in adjust. rev. allocated. regions: could not find function "adjust. rev. allocated. regions". If you have time, please help me, thank you.
Hello,
I deployed openPrimeR in docker following the Readme and docker image on docker hub. When I check Third-party tools status I have selenium-python in unvailable state. To fix it I installed manually python 2.7, pip and module selenium. After that everything is ok on this part.
When I run Retrieve Template on "Mus musculus" I receive the following message on GUI.
IMGT Data Unavailable
It was not possible to retrieve the selected data from IMGT. Possible reasons could be having no internet connection or missing dependencies (selenium for python).
And on docker container log
Warning in openPrimeRui:::retrieve.IMGT.templates(input$IMGT_DB_species, :
Failed to retrieve templates from IMGT for unknown reason.
/usr/local/lib/python2.7/dist-packages/selenium/webdriver/phantomjs/webdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead
warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '
Traceback (most recent call last):
File "/usr/local/lib/R/site-library/openPrimeRui/shiny/shiny_server/extra_IMGT_template_set_extractor.py", line 104, in <module>
set_option(driver, field, value)
File "/usr/local/lib/R/site-library/openPrimeRui/shiny/shiny_server/extra_IMGT_template_set_extractor.py", line 44, in set_option
element = Select(driver.find_element_by_name(field))
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 496, in find_element_by_name
return self.find_element(by=By.NAME, value=name)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
'value': value})['value']
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: {"errorMessage":"Unable to find element with name 'model.subgroup'","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Content-Length":"97","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:34687","User-Agent":"selenium/3.141.0 (python linux)"},"httpVersion":"1.1","method":"POST","post":"{\"using\": \"name\", \"sessionId\": \"80b91d40-7d7e-11ed-861b-b1bd0a075e2a\", \"value\": \"model.subgroup\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/80b91d40-7d7e-11ed-861b-b1bd0a075e2a/element"}}
Screenshot: available via screen
Warning in openPrimeRui:::retrieve.IMGT.templates(input$IMGT_DB_species, :
Failed to retrieve templates from IMGT for unknown reason.
Can you help me ?
thanks
I was excited about the tool and I did give a try, but it got stuck at Phase 3.
Hi,
I tried to use openPrimeR
package on my machine. I have already set UNAFOLDDAT
path in ~/.bashrc
file by adding this line export UNAFOLDDAT=/home/jshi/biosoft/oligoarrayaux-3.8/data
, but error message popped up as listed follow.
> settings <- read_settings(settings.xml)
Reading settings file: C_Taq_PCR_high_stringency.xml
Due to missing external tools the following constraints were ignored:cross_dimerization,self_dimerization
Due to missing external tools the following coverage constraints were ignored:coverage_model
Warning message:
In check.tool.function() :
Please define the UNAFOLDDAT variable in your path before using OligoArrayAux.
I typed echo $UNAFOLDDAT
command and it returned:
/home/jshi/biosoft/oligoarrayaux-3.8/data
Can you check for me please?
Thank you and best wishes!
Jianxiang
The bioconda recipe for openprimer states:
# SystemRequirements: MAFFT (>= 7.305), OligoArrayAux (>= 3.8), ViennaRNA (>= 2.4.1), MELTING (>= 5.1.1), Pandoc (>= 1.12.3)
...but doesn't actually install them, so the recipe is incomplete. It appears that all of this software is available via conda, so why not include them in the openprimer recipe? That would help identify any potential dependency conflicts via CI.
According to https://www.bioconductor.org/packages/release/bioc/vignettes/openPrimeR/inst/doc/openPrimeR_vignette.html and try to reproduce the result inside.
when run :
settings.xml <- system.file("extdata", "settings", "C_Taq_PCR_high_stringency.xml", package = "openPrimeR") settings <- read_settings(settings.xml)
It reoprt :Due to missing external tools the following constraints were ignored:cross_dimerization,secondary_structure,self_dimerization.
But I have already installed MELTING, ViennaRNA ,OligoArrayAux ,MAFFT and Pandoc.
Cheack the settings@Input_Constraints@status
:
cross_dimerization, secondary_structure,self_dimerization were seted as FALSE
Hi I try to design both forward and reverse primers. With provided fasta sequence to assign binding region, fw binding region was resolved properly, but rev binding regions not.
below is the code I used:
template = read_templates("MSI_template.fa", hdr.structure = "GROUP", id.column = "GROUP", delim = ">")
template = assign_binding_regions(template, fw = "fw.bs.fa", rev = "rev.bs.fa")
FASTA sequence of template, binding regions are attached
Dear authors,
After pulling the docker image in Docker Desktop and loading the package in R, it says the environment does not have Melting, ViennaRNA, or OligoArraryAux. Could you check out your image and update things if needed?
Below is what I did after running the image in Docker Desktop:
$ R
R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.> library(openPrimeR)
Melting not available
ViennaRNA not available
OligoArrayAux not available
There are missing/non-functioning external tools.
To use the full potential of openPrimeR, please make sure
that the required versions of the speciied tools areinstalled and that they are functional:
o MELTING (http://www.ebi.ac.uk/biomodels/tools/melting/)
o ViennaRNA (http://www.tbi.univie.ac.at/RNA/)
o OligoArrayAux (http://unafold.rna.albany.edu/OligoArrayAux.php)
o MAFFT (http://mafft.cbrc.jp/alignment/software/)
The number of cores for was set to '2' by 'parallel_setup()'.
>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.