3
3.9 years ago by
India
Agaz Hussain Wani260 wrote:

Hello everybody,

I am trying to read some files from temporary path to do differential expression using codlink package. I have  phenotype files on the same path which i read by

pdata = read.AnnotatedDataFrame(lst[i],path=newpath,sep="")

and it works happily

Now when i call

codset = readCodelinkSet(filename = pdata$FileName,phenoData = pdata) It gives an error saying cannot open connection, which is quite obvious as my files are not in the local directory but on the temporary path. So is there an option to set the path which currently i don't find in readCodelinkSet(). I mean something like codset = readCodelinkSet(filename = pdata$FileName,path=...,phenoData = pdata)

Or is there an alternate option to do it.

modified 3.8 years ago by Diego Diez730 • written 3.9 years ago by Agaz Hussain Wani260
1
3.8 years ago by
Diego Diez730
Japan
Diego Diez730 wrote:

Hi hussainaaghaz,

You are right that there is no way to specify the path in readCodelinkSet. I may change this in the future. In the meantime you can use the following workaround:

# append path to file names:
newpath <- "my/new/path"
pdata$FileNames <- file.path(newpath, pdata$FileNames)

# then, this should work:
codset <- readCodelinkSet(filename = pdata$FileNames)  ADD COMMENTlink written 3.8 years ago by Diego Diez730 Hi dear Diego, I tried your code but got an error: ## this line gives an error pdata$FileNames <- file.path(newpath, pdata$FileNames) Error in [[<-.data.frame(*tmp*, i, value = character(0)) : replacement has 0 rows, data has 4 My pdata looks like  FileName Treatment Condition 1 GSM108293.TXT C 1 2 GSM108294.TXT C 1 3 GSM108295.TXT Tu 2 4 GSM108290.TXT Tu 2 ADD REPLYlink written 3.8 years ago by Agaz Hussain Wani260 1 In my example the column with the file names is called "FileNames" in your data is called "FileName" hence the error. Try fixing the column name: pdata$FileName <- file.path(newpath, pdata\$FileName)

Oh... !! Yes you are absolutely right . Thanks

1
3.8 years ago by
Diego Diez730
Japan
Diego Diez730 wrote:

FYI, I have added this feature to the development version of Bioconductor, and should be generally available for the next release: https://github.com/ddiez/codelink/issues/1

Basically, readCodelinkSet() now accepts a path argument. For example:

codset <- readCodelinkSet(filename = "myfiles", path = "my/new/path")