[BioC] WGCNA_ problem in creating scale free topology plot

James W. MacDonald jmacdon at uw.edu
Fri Jun 20 16:44:14 CEST 2014

Hi Amit,

On 6/20/2014 3:46 AM, amit kumar subudhi wrote:
> Dear Dr. Langfelder,
> Trying to generate a coexpression based systems network using WGCNA R
> package.
>   An adjacency matrix was generated from an expression matrix using the
> command
>   softPower = 8;
> adjacency = adjacency(datExpr, power = softPower);
> Then I tried to see whether the network is exhibiting scale free topology
> or not using the command
> scaleFreePlot(adjacency, nBreaks = 10, truncated = FALSE, removeFirst =
> FALSE, main = paste("scale free topology"), xlab = "log10(k)", ylab =
> "log10(p(k))")
> but in return I am getting the following error message
> Error in plot.default(log.dk, log.p.dk, xlab = "log10(k)", ylab =
> "log10(p(k))",  :
>    formal argument "xlab" matched by multiple actual arguments
> Please let me know where I am going wrong.

Note that there is no xlab, nor ylab arguments for scaleFreePlot(), but 
there is an ellipsis argument (...), which allows you to pass arbitrary 
arguments to other functions within scaleFreePlot(). If you look at the 
scaleFreePlot() function body, you will see this near the bottom:

suppressWarnings(plot(log.dk, log.p.dk, xlab = "log10(k)",
         ylab = "log10(p(k))", main = title, ...))

where there is a call to plot() that has existing xlab and ylab 
arguments (that are identical to the ones you are attempting to pass 
in), as well as another ellipsis argument, which allows your xlab and 
ylab arguments to be passed to plot() as well.

So the plot function is seeing two arguments for xlab and ylab, and then 
errors out because it only expects one. The easy (and only) fix for this 
is to remove the xlab and ylab arguments from your call to scaleFreePlot().



> I have successfully used most of the codes to visualize network and
> generate modules.
> With best regards
> Amit

James W. MacDonald, M.S.
University of Washington
Environmental and Occupational Health Sciences
4225 Roosevelt Way NE, # 100
Seattle WA 98105-6099

More information about the Bioconductor mailing list