Error in Sys.setenv(PATH = new_path) : wrong length for argument - reticulate

after i setenv path, i can't use_condaenv("r-reticulate"); and py_avialable is False
enter image description here

Related

filterAndTrim : Error in add(bin) : record does not start with '#'

I'm using dada 2 version ‘1.22.0’ on windows 10, i have list of compressed (.gz ) fastq files, when i use the function filterAndTrim i get this error message :
Error in add(bin) : record does not start with '#'
But when i want to see if i can read th .gz file with library(ShortRead) :
library(ShortRead)
fn <- "path/to/example.fastq.gz"
reads <- readFastq(fn)
it doesn't give any error message message
I don't understand why the function filterAndTrim give the error message
Error in add(bin) : record does not start with '#'
Do you have any solution?

Reading a vcf.bgz file in R

I downloaded some data from gnomad - https://gnomad.broadinstitute.org/downloads. it comes in the form of VCF.bgz file and I would like to read it as a vcf file.
i wrote some code:
install.packages("R.utils")
library("R.utils")
df=gunzip("gnomad.exomes.r2.1.1.sites.4.vcf.bgz", "gnomad.exomes.r2.1.1.sites.4.vcf")
install.packages("vcfR")
library("vcfR")
vc=read.vcfR("gnomad.exomes.r2.1.1.sites.4.vcf.bgz")
but it doesn't work -- it doesn't convert it to appropriate VCF file.
Warning message:
In file.remove(filename) :
cannot remove file 'gnomad.exomes.r2.1.1.sites.4.vcf.bgz', reason 'Permission denied'
Error in read.vcfR(df) :
File: gnomad.exomes.r2.1.1.sites.4.vcf does not appear to be a VCF file.
First line of file:
gnomad.exomes.r2.1.1.sites.4.vcf
Should begin with:
##fileformat=VCFv
In addition: Warning message:
In scan(file = file, what = character(), nmax = 1, sep = "\n", quiet = TRUE, :
embedded nul(s) found in input
would appreciate any help, thank you:)

Error in file(description = xlsxFile) : invalid 'description' argument

This is my first time to use R on a cloud server. I've downloaded the data to my online working directory. These are some details about my working directory:
getwd()
[1] "/home/fategh"
list.files()
[1] "nearline" "projects" "R" "rawdata.xlsx.gz"
[5] "scratch"
Now, when I try to read the data, I get the following error:
data=read.xlsx((gzfile("rawdata.xlsx.gz")))
Error in file(description = xlsxFile) : invalid 'description' argument
data=read.xlsx((gzfile("home/fategh/rawdata.xlsx.gz")))
Error in file(description = xlsxFile) : invalid 'description' argument
I tried whatever path I could think of:
> data=read.xlsx((gzfile(file.choose())))
Enter file name: rawdata
Error in file(description = xlsxFile) : invalid 'description' argument
> data=read.xlsx((gzfile(file.choose())))
Enter file name: rawdata.xlsx
Error in file(description = xlsxFile) : invalid 'description' argument
> data=read.xlsx((gzfile(file.choose())))
Enter file name: rawdata.xlsx.gz
Error in file(description = xlsxFile) : invalid 'description' argument
I don't know what to do about it. It's my first time working on a cloud shell.
Thank you.

Error on the stan file compilation using R 3.6.0. and Win 10

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! Error in .shlib_internal(commandArgs(TRUE)) :
C++14 standard requested but CXX14 is not defined
Calls: <Anonymous> -> .shlib_internal
Execution halted
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command 'C:/PROGRA~1/R/R-36~1.0/bin/x64/R CMD SHLIB file1a1860a0379.cpp 2> file1a1860a0379.cpp.err.txt' had status 1
Error in sink(type = "output") : invalid connection
Some non-English page said that we can overcome by executing the following R script, but it did not work in my case:
dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR))
dir.create(dotR)
M <- file.path(dotR, "Makevars")
if (!file.exists(M))
file.create(M)
cat("\nCXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function",
"CXX14 = g++ -std=c++1y",
file = M, sep = "\n", append = TRUE)
The above R script is same as in the following page:
https://github.com/stan-dev/rstan/issues/569
I tried to uninstall and install according to the following page, but the above error occurred.
Rstan installation: https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started
REF; https://github.com/stan-dev/stan/issues/1613
ref: https://github.com/stan-dev/rstan/issues/633
For me, the issue has been solved by adding manually the following line into the file .R/Makevars.win.
CXX14 = "C:\Rtools\mingw_64\bin\g++.exe"

Not able to executing all text files from one folder by a Rscript

This is an R script for array quality metrics. The first step is going well but after the execution of the 2nd step an error occurs.
library(arrayQualityMetrics)
library(limma)
library(tcltk)
X <-tk_choose.files(caption = "Choose X")
maData<-read.maimages(X, source="agilent", other.columns = "g", green.only=TRUE)
eSet<-new("ExpressionSet", exprs = maData$other$g, annotation =maData$genes[,7])
arrayQualityMetrics(eSet, outdir="QC_C", force = TRUE, do.logtransform = TRUE)
The program is running now but it is showing this warning message:
The directory 'QC_C' has been created.
Warning messages:
1: In svgStyleAttributes(style) :
Removing non-SVG style attribute name(s): subscripts, group.number, group.value
2: In svgStyleAttributes(style) :
Removing non-SVG style attribute name(s): subscripts, group.number, group.value
Where am I getting wrong? Is this the errors in the file or the Rscript is wrong....
Give the full path of the folder under path as below:
scanFiles<-dir(path='/path/to/folder/',pattern = ".*.txt$")

Resources