From oakeley at fmi.ch  Tue Sep  2 12:06:17 2003
From: oakeley at fmi.ch (oakeley@fmi.ch)
Date: Tue Sep  2 11:05:43 2003
Subject: [Rd] File in use error (PR#4047)
Message-ID: <200309020906.h8296HJH006982@pubhealth.ku.dk>

Full_Name: Edward J. Oakeley
Version: 1.7.1
OS: Windows XP
Submission from: (NULL) (212.47.183.3)


This bug occurs when using the (D)COM server to connect to the "expresso"
command of the Bioconductor Affy package. It may be a bug of R, (D)COM or Affy
ut I will report it here anyway as it feels like an R bug.

The Affy package when invoked will read a series of large (10Mb) text files from
the working directory. These files contain information about a microarray
experiment (CEL files). The instructions passed to R are as follows (VB .NET):

-----
'Make (D)COM connection
Dim x As New STATCONNECTORSRVLib.StatConnector()

'Initialising R
x.Init("R")
x.EvaluateNoReturn("library(affy)")
sPath = "c:\\temp\\"
x.EvaluateNoReturn("setwd(" + Chr(34) + sPath + Chr(34) + ")")

'Reading files...
x.EvaluateNoReturn("data <- ReadAffy()")

'Calculating RMA expression values...
x.EvaluateNoReturn("eset <- expresso(data, bgcorrect.method=" + Chr(34) + "rma"
+ Chr(34) + ", normalize.method=" + Chr(34) + "quantiles" + Chr(34) + ",
pmcorrect.method=" + Chr(34) + "pmonly" + Chr(34) + ", summary.method=" +
Chr(34) + "avgdiff" + Chr(34) + ")")

'Writng output data
x.EvaluateNoReturn("write.exprs(eset,file=" + Chr(34) + "output.txt" + Chr(34) +
")")
x.Close()
------

The "Close()" command should shutdown R and release all of the ownerships on
files as R quits but it does not. The files loaded (CEL files) can now not be
deleted or moved until the user logs off. The error generated is "file is in use
by another process". The output file "output.txt" does not have any special
restriction on its access applied.

The bug does not appear when the commands are invoked from the R console. The
only exception with the console approach is that the termination command given
is "q()". This command generates an error when passed over the (D)COM server.
The documentation recommended using the "Close()" function instead.

Anyway, just thought you should know... If this is not a bug then if anyone can
tell me how to release ownership on these files I would really appreciate it.

Thanks

Ed


[Rd] File in use error (PR#4047)
oakeley@fmi.ch