I want to write a small tool also for the use of collegues, who do not necessarily have expertise with programming. Therefore, I wanted to implement the possibility to simply run the script from a file, which is supposed to ask for two sequences:
exon1 <- readline(prompt = "Enter the first Exon: \n")
exon2 <- readline(prompt = "Enter the second Exon: \n")
Input e.g.:
ATGTTCC CGAGGAGAGCCACGCCAAGCCGCCGCTGGCGGGGCGTTGGCTGC TGTCCTGGCAATCGTGGTACGGACCGCGGCGAAGTTTGCGCCTGCGGAC GCTTTGCCGGCTGCAGGCCGCCCGGCCTGTGTTCAGATGGCGGCCCGCTCT CCGGGTCGTATGGAGGAGCAATACCGAGAGTAGAG
This results in 2 problems:
- Executing the script using
>Rscript PATH_TO\file.Rfrom the windows command prompt results in the script running, but not stopping for user input - When running the script from RStudio or an R-console in general, it results in an error, as R interpretes only the first line of the sequence as the input, every other line as a variable, which of course does not exists.
So, how do I execute an .R file in the simplest way that stops for user input before continuing with the rest of the code? And how can I alter the readline() function, so that an input simply copied from a database and thus including line breaks is interpreted as a single input?