Question: Can i set a path for readCodlinkSet()
3
gravatar for Agaz Hussain Wani
4.4 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.

ADD COMMENTlink modified 4.4 years ago by Diego Diez750 • written 4.4 years ago by Agaz Hussain Wani260
Answer: Can i set a path for readCodlinkSet()
1
gravatar for Diego Diez
4.4 years ago by
Diego Diez750
Japan
Diego Diez750 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 4.4 years ago by Diego Diez750

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 4.4 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)

ADD REPLYlink written 4.4 years ago by Diego Diez750

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

ADD REPLYlink written 4.4 years ago by Agaz Hussain Wani260
Answer: Can i set a path for readCodlinkSet()
1
gravatar for Diego Diez
4.4 years ago by
Diego Diez750
Japan
Diego Diez750 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")
ADD COMMENTlink written 4.4 years ago by Diego Diez750

Dear Diego , Thank U very much for adding a path option.

ADD REPLYlink written 4.4 years ago by Agaz Hussain Wani260
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 295 users visited in the last hour