Uses purcells robust mmm-library: https://github.com/purcell/mmm-mode Can be further updated to recognize other strings as embedded R. The template should be easy to follow. I suggest something like `"""[Rr]` for the case where you need to run R-scripts using shell or write them in a variable to print/debug. But I leave it at your discretion. Use-cases for suggestion above: ```python command = """#r library(csaw) param = readParam(minq=50, restrict=c({chromosomes_as_string}))""" print(command) R(command) ``` or ```python run_voom_script = """#R library(edgeR) normfactors = tail(read.table("{input.normalization_file}", row.names=1, header=F), 18) colnames(normfactors) = c("norm.factors") # need this name for voom to accept the normfactors df = read.table("{input.infile}") x = DGEList(counts=df, norm.factors=as.matrix(normfactors)) y = voom(x) write.table(y$E, "{output.outfile}", sep=" ") """.format(**locals()) print(run_voom_script) # Must craete new instance of R-interpreter to avoid clashing library requirements with open(output.script, "w+") as script_handle: script_handle.write(run_voom_script) shell("Rscript {output.script}") ``` You can view, comment on, or merge this pull request online at: https://github.com/kyleam/snakemake-mode/pull/6 -- Commit Summary -- * Support R syntax highlighting in R("""-blocks -- File Changes -- M snakemake-mode.el (15) -- Patch Links -- https://github.com/kyleam/snakemake-mode/pull/6.patch https://github.com/kyleam/snakemake-mode/pull/6.diff --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kyleam/snakemake-mode/pull/6