How to save primers in local file in openPrimeR
1
0
Entering edit mode
@marongiuluigi-7134
Last seen 3.1 years ago
European Union

Hello, I have designed some primers with openPrimeR. On the manual, the object with the primers is saved as a temporary file with tempfile(). Is it possible to save it on a local directory of my choice? Thank you


out.file <- tempfile("my_primers", fileext = ".fasta")
write_primers(optimal.primers$opti, out.file)
# Define the FASTA primer file to load <<< this load an external file, I would like to re-open the one I made... <<<<
#                                         ----------------------------------------------------------------------
primer.location <- system.file("extdata", "IMGT_data", "primers", "IGHV", 
                               "Ippolito2012.fasta", package = "openPrimeR")
# Load the primers
primer.df <- read_primers(primer.location, fw.id = "_fw")

Thank you

> sessionInfo( )
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] openPrimeR_1.12.1

loaded via a namespace (and not attached):
 [1] progress_1.2.2          tidyselect_1.1.0        purrr_0.3.4             reshape2_1.4.4         
 [5] colorspace_2.0-0        DECIPHER_2.18.1         vctrs_0.3.6             generics_0.1.0         
 [9] stats4_4.0.3            blob_1.2.1              XML_3.99-0.5            rlang_0.4.10           
[13] pillar_1.4.7            glue_1.4.2              DBI_1.1.1               BiocGenerics_0.36.0    
[17] bit64_4.0.5             RColorBrewer_1.1-2      GenomeInfoDbData_1.2.4  foreach_1.5.1          
[21] lifecycle_1.0.0         plyr_1.8.6              stringr_1.4.0           zlibbioc_1.36.0        
[25] Biostrings_2.58.0       munsell_0.5.0           gtable_0.3.0            lpSolveAPI_5.5.2.0-17.7
[29] codetools_0.2-18        memoise_2.0.0           IRanges_2.24.1          fastmap_1.1.0          
[33] GenomeInfoDb_1.26.2     parallel_4.0.3          Rcpp_1.0.6              scales_1.1.1           
[37] cachem_1.0.4            S4Vectors_0.28.1        XVector_0.30.0          startupmsg_0.9.6       
[41] bit_4.0.4               ggplot2_3.3.3           hms_1.0.0               stringi_1.5.3          
[45] uniqtag_1.0             dplyr_1.0.4             distr_2.8.0             GenomicRanges_1.42.0   
[49] grid_4.0.3              ade4_1.7-16             tools_4.0.3             bitops_1.0-6           
[53] magrittr_2.0.1          RCurl_1.98-1.2          tibble_3.0.6            RSQLite_2.2.3          
[57] crayon_1.4.1            seqinr_4.2-5            pkgconfig_2.0.3         ellipsis_0.3.1         
[61] MASS_7.3-53.1           prettyunits_1.1.1       rstudioapi_0.13         iterators_1.0.13       
[65] R6_2.5.0                sfsmisc_1.1-8           compiler_4.0.3
openPrimeR • 707 views
ADD COMMENT
0
Entering edit mode
@marongiuluigi-7134
Last seen 3.1 years ago
European Union

I found it: just use write orimer with the name of the file:

write_primers(primer$opti, "primers.fasta")
ADD COMMENT
0
Entering edit mode

Hi, I tried to do the same but I dont think that my file was saved

 >  out.file <- tempfile("home/lab13/Documents/SantiagoEdilberto/PRIMERS BRCA1/primers_v1", fileext = ".fasta")
> write_primers(optimal.primers$opti, "primers_v1")
> write_primers(primers$opti, "primers_v1")
Error in which(primer.df$Forward != "") : object 'primers' not found
> primer.location <- system.file("home/lab13/Documents/SantiagoEdilberto/PRIMERS BRCA1/primers_v1", package = "openPrimeR")
> primer.df <- read_primers(primer.location, fw.id = "_fw")
Error in read_primers_single(fname, fw.id = fw.id, rev.id = rev.id, merge.ambig = merge.ambig,  : 
  No file found at specified location: here

what can I do?

ADD REPLY

Login before adding your answer.

Traffic: 798 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6