Version of R is 1.5.0
Version of postgresql 7.2.1-5
I repeated the process and what I obtained with traceback and debug is
inserted below. I am still working on walking through debug (new to
R)
so querying the locals and making sense of it is not trivial.
Thanks Barry
*************TRACEBACK OUTPUT**************
> acc2LLMapper(outName=testUnified, dbName = "devDB", tName =
"abtestmap", baseFile = baseF, toMap = toBeMapped, baseCols = c("id",
"acc"), byID = "id")
Error in "names<-.default"(*tmp*, value = c(byID, id)) :
names attribute must be the same length as the vector
> traceback()
4: "names<-.default"(*tmp*, value = c(byID, id))
3: "names<-"(*tmp*, value = c(byID, id))
2: mergeMaps(fileParser(TEMPFILE, baseFile, parsed[1], parsed[2]),
paste("src", counter, sep = ""))
1: acc2LLMapper(outName = testUnified, dbName = "devDB", tName =
"abtestmap",
baseFile = baseF, toMap = toBeMapped, baseCols = c("id",
"acc"), byID = "id")
>
***************************Debug output**********************
debug(acc2LLMapper)
> acc2LLMapper(outName=testUnified, dbName="devDB", tName="abtestmap",
+ baseFile=baseF, toMap=toBeMapped, baseCols=c("id", "acc"), byID =
"id")
debugging in: acc2LLMapper(outName = testUnified, dbName = "devDB",
tName = "abtestmap",
baseFile = baseF, toMap = toBeMapped, baseCols = c("id",
"acc"), byID = "id")
debug: {
require(RPgSQL) || stop("RPgSQL is not available!")
merged <- NULL
TEMPFILE <- "tempFile"
mergeMaps <- function(srcFile, id) {
newCol <- as.data.frame(dropDup(srcFile))
names(newCol) <- c(byID, id)
merged <<- merge(merged, newCol, by = byID, all = TRUE)
}
merged <- as.data.frame(dropDup(baseFile))
names(merged) <- baseCols
counter <- 1
for (i in toMap) {
parsed <- unlist(strsplit(i, "="))
if (!is.na(parsed[2]))
mergeMaps(fileParser(TEMPFILE, baseFile, parsed[1],
parsed[2]), paste("src", counter, sep = ""))
else mergeMaps(parsed[1], paste("src", counter, sep = ""))
counter <- counter + 1
unlink(TEMPFILE)
}
checkCon(dbName)
db.write.table(merged, name = tName, no.clobber = FALSE)
db.disconnect()
authentic <- getAuthenMap(dbName, tName)
write.table(x = authentic, file = outName, quote = FALSE,
sep = "\t", row.names = FALSE, col.names = FALSE)
}
Browse[1]>
debug: require(RPgSQL) || stop("RPgSQL is not available!")
Browse[1]>
debug: merged <- NULL
Browse[1]>
debug: TEMPFILE <- "tempFile"
Browse[1]>
debug: mergeMaps <- function(srcFile, id) {
newCol <- as.data.frame(dropDup(srcFile))
names(newCol) <- c(byID, id)
merged <<- merge(merged, newCol, by = byID, all = TRUE)
}
Browse[1]>
debug: merged <- as.data.frame(dropDup(baseFile))
Browse[1]>
debug: names(merged) <- baseCols
Browse[1]>
debug: counter <- 1
Browse[1]>
debug: for (i in toMap) {
parsed <- unlist(strsplit(i, "="))
if (!is.na(parsed[2]))
mergeMaps(fileParser(TEMPFILE, baseFile, parsed[1],
parsed[2]),
paste("src", counter, sep = ""))
else mergeMaps(parsed[1], paste("src", counter, sep = ""))
counter <- counter + 1
unlink(TEMPFILE)
}
Browse[1]>
debug: i
Browse[1]>
debug: parsed <- unlist(strsplit(i, "="))
Browse[1]>
debug: if (!is.na(parsed[2])) mergeMaps(fileParser(TEMPFILE, baseFile,
parsed[1], parsed[2]), paste("src", counter, sep = "")) else
mergeMaps(parsed[1],
paste("src", counter, sep = ""))
Browse[1]>
debug: counter <- counter + 1
Browse[1]>
debug: unlink(TEMPFILE)
Browse[1]>
debug: i
Browse[1]>
debug: parsed <- unlist(strsplit(i, "="))
Browse[1]>
debug: if (!is.na(parsed[2])) mergeMaps(fileParser(TEMPFILE, baseFile,
parsed[1], parsed[2]), paste("src", counter, sep = "")) else
mergeMaps(parsed[1],
paste("src", counter, sep = ""))
Browse[1]>
Error in "names<-.default"(*tmp*, value = c(byID, id)) :
names attribute must be the same length as the vector
>
-----Original Message-----
From: Robert Gentleman [mailto:rgentlem@jimmy.harvard.edu]
Sent: Thursday, July 18, 2002 5:08 PM
To: Barry Henderson
Cc: BioConductor Mailing List
Subject: Re: [BioC] AnnBuilder failing Taffy examples
On Thu, Jul 18, 2002 at 03:59:48PM -0400, Barry Henderson wrote:
> I have been working on getting AnnBuilder functional without much
> success. I have a postgresql db running on the system (linux), I
have
> created a devDB. And ABRnwCheck("devDB") exits without errors.
>
> But, ... as I work through the Taffy example in the docs I receive
the
> following error with acc2LLMapper:
>
>
> Error in "names<-.default"(*tmp*, value = c(byID, id)):
> Names attribute must be the same length as the vector
>
Can you run traceback() at this point so we can see where you are?
Also, once you locate that point, you can put in a call to browser
(or use debug on the innermost function), this will let you step
through the code one line at a time. you can query different objects
and hopefully we can find out what the problem is.
Also, you didn't say, but what version of R and what version of
postgres?
thanks,
Robert
>
> Any ideas?
>
> Thanks
>
> Barry
>
>
>
>
> Barry S. Henderson, Ph.D.
> Senior Scientist
> Ribonomics, Inc.
> barry.henderson@ribonomics.com
>
>
> <http: www.ribonomics.com=""/>
>
>
>
--
+---------------------------------------------------------------------
--
----+
| Robert Gentleman phone : (617) 632-5250
|
| Associate Professor fax: (617) 632-2444
|
| Department of Biostatistics office: M1B20
| Harvard School of Public Health email:
rgentlem@jimmy.dfci.harvard.edu |
+---------------------------------------------------------------------
--
----+