[BioC] RBGL, shortest paths, edge weights, and the new graph class
Seth Falcon
sfalcon at fhcrc.org
Thu May 18 02:20:55 CEST 2006
Paul Shannon <pshannon at systemsbiology.net> writes:
> It looks as if some of the RBGL functions ('sp.between' for example)
> depend
> upon the old graph class, pre 1.10, in which edge weights were
> an obligatory attribute.
Please tell us sessionInfo() so we know which RBGL and which graph you
are using.
> sp.between (g, 'F', 'L')
> Error in if (any(eWW[eWW < 0])) stop("sp.between requies that all
> edge weights are nonnegative") :
> missing value where TRUE/FALSE needed
>
>
> sp.between <- function (g, start, finish)
> {
> ...
> eW = edgeWeights(g)
> eWW <- unlist(eW)
> if (any(eWW[eWW < 0]))
> stop("sp.between requies that all edge weights are nonnegative")
>
>
> Is there any plan to accommodate the new 'weightless' graph class
> design?
> Or is there any workaround anybody can suggest?
Certainly there could be an issue yet to solve, but this did get some
testing and "should" work :-)
In other words, edgeWeights will return an appropriate structure
defaulting to all 1's if no edge attribute named "weight" has been
defined. If such an edge attribute _has_ been defined, then it's
values will be used to contruct an appropriate list in the edgeWeights
call.
For your graph g, what does edgeDataDefaults(g) say?
+ seth
More information about the Bioconductor
mailing list