error while trying to read a single cell genomic dataset - r

My code is
multiome <- load_object(file.path(dataset, "C:/Users/s/Desktop/Shahid/MOJITOO DATASETS/PBMC_Multiome.Rds"))
I get the following error:
Error in open.connection(3L, "rb") : cannot open the connection
In addition: Warning message:
In open.connection(3L, "rb") :
cannot open file 'kidney/C:/Users/s/Desktop/Shahid/MOJITOO DATASETS/PBMC_Multiome.Rds': Invalid argument
Called from: open.connection(3L, "rb")
I want to implement the MOJITOO single cell integration model. I get the error shown above.

Related

RShiny: Pass in a FilePath

Trying to do something pretty simple here.. I just want to hard code a file path and pass it into "read.csv" but on run it's removing the "\t" from the string.
filePath = toString("C:\test.csv")
scenario_data <<- read.csv(filePath, stringsAsFactors=F)
Error:
Warning in file(file, "rt") :
cannot open file 'C: est.csv': Invalid argument
Warning: Error in file: cannot open the connection
1: runApp
I know in Python I can use r"this is a string" so that this doesn't happen. Is there something similar in RShiny?

Error in file(file, "rt") : invalid 'description' argument when setting up a working directory

I am setting up my working directory to run a differential expression code on R. I keep getting this error, Error in file(file, "rt") : invalid 'description' argument
I have tried changing the directory with setwd but that has not worked
source("https://bioconductor.org/biocLite.R")
biocLite("ballgown")
library(ballgown)
install.packages("calibrate")
library(calibrate)
##specify data directory and make ballgown object##
###directory files must look EXACTLY like the files in the example ballgown extdata directory###
data_directory=file.path("user/cash/Desktop/ccar-1 differential expression analysis/differential expresison")
data_directory
bg=ballgown(dataDir=data_directory, samplePattern='IKH', meas='all')
meas =
###[ballgown instance with 227079 transcripts and 12 samples]###
View(bg)
sampleNames(bg)
Error message is
Error in file(file, "rt") : invalid 'description' argument

Warning message: In data(xx) : data set ‘xx’ not found

Keep getting the following warning:
"Warning message:
In data(VEMCOdata) : data set ‘VEMCOdata’ not found"
I'm new to R. I set up all my files exactly how the package VTrack specified. I set my working directory, load my first data set then ue the command >data(xx) and keep getting the same warning message.
setwd("C:/Users/gwhite/Desktop")
library(VTrack)
VEMCOdata <- read.csv('VEMCOdata_2014.csv')
data(VEMCOdata)
Warning message:
In data(VEMCOdata) : data set ‘VEMCOdata’ not found

How do I use strings in functions for R ? (file,rt error)

I am trying to load data into a function to use for analysis later on and there seems to be issues inserting a string (i.e. a filename) into my function. Here is what I am working with.
hist_sep<- function(dex_file,etoh_file,sep_parameter) {
dex<-read.csv("dex_file")$sep_parameter
etoh<-read.csv("etoh_file")$sep_parameter
}
The code below outputs this error
hist_sep(RT_3h_Amp_A.csv , RT_3h_Amp_EtOH_A.csv , FL1.A)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
However, if I input the filenames myself (as below) then everything works great. So everything is in the correct directory.
dex<-read.csv("RT_3h_Amp_A.csv")$FL1.A
etoh<-read.csv("RT_3h_Amp_EtOH_A.csv")$FL1.A
Any ideas how I could get around this problem?
Remove the quotes around the filenames in your function (e.g., should be dex<-read.csv(dex_file)$sep_parameter, not dex<-read.csv("dex_file")$sep_parameter). Otherwise, it's trying to download a file CALLED "dex_file".

Error using DEXSeqDataSetFromHTSeq

Currently I am trying to understand DEXSeq package. I have a design tsv file and 7 files which contains Counts. Now would like to run the following command
library("DEXSeq");
design=read.table("dexseq_design.tsv", header=TRUE, row.names=1);
ecs = DEXSeqDataSetFromHTSeq(countfiles=c("M0.txt", "M1.txt", "M2.txt", "M3.txt", "M4.txt", "M5.txt", "M6.txt", "M7.txt"), design=design, flattenedfile="genome.chr.gff");
The last command gives and error
Error in class(sampleData) %in% c("data.frame") :
error in evaluating the argument 'x' in selecting a method for function '%in%':
Error: argument "sampleData" is missing, with no default
What does this error means and how to fix it? While loading the package DEXSeq there was a warning
Warning message:
replacing previous import by ‘ggplot2::Position’ when loading ‘DESeq2’

Resources