Can i set a path for readCodlinkSet()
2
3
Entering edit mode
@agaz-hussain-wani-7620
Last seen 6.6 years ago
India

 

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.

r differential expression codelink • 2.1k views
ADD COMMENT
1
Entering edit mode
Diego Diez ▴ 760
@diego-diez-4520
Last seen 4.1 years ago
Japan

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 COMMENT
0
Entering edit mode

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 REPLY
1
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
Diego Diez ▴ 760
@diego-diez-4520
Last seen 4.1 years ago
Japan

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 COMMENT
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 623 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6