Error while running normOffsets in diffhic
1
0
Entering edit mode
shopnil99 • 0
@shopnil99-20966
Last seen 5.3 years ago

I ran the following code to create and filter my "data" object:

data <- squareCounts(input, hg19.param, width=bin.size, filter=1)

keep <- aveLogCPM(asDGEList(data)) > 0

data <- data[keep,]

When I tried normalizing the filtered data using the following command I get the error below

data <- normOffsets(data, type="loess", se.out=TRUE)

Error in loessFit (log (mat [, x] + cont.cor.scaled [x]), ab, …) : unused argument (type = “loess” )

I tried running it on the initial data object and get the same error. Any ideas about how I can troubleshoot this error?

diffhic csaw • 2.0k views
ADD COMMENT
1
Entering edit mode

On quick glance, it looks like the documentation might be misleading. while the documentation indeed shows

     ...: Other arguments to be passed to 'calcNormFactors' for
          'type="scaling"', or 'loessFit' for 'type="loess"'.

When I examine the code the extra arguments appear to be passed to the loessFit function not calcNormFactors. So see ?loessFit for acceptable arguments to pass for ...

I think if you change type = "loess" to method="loess" it should work. It might also be worth reporting to the package maintainers to update their documentation.

ADD REPLY
0
Entering edit mode

Thank you! changing type = "loess" to method="loess" worked out really well.

ADD REPLY
0
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 17 minutes ago
The city by the bay

Pretty much as Lori said. The user's guide is (slightly) out of date, and I haven't had the opportunity to regenerate it, mostly because I no longer have access to the underlying files that are required for its generation.

In the meantime, the solution is to not use type="loess" when calling normOffsets(), as this function will always do a loess fit. (Conversely, normFactors() will always perform scaling normalization.) I separated the two modes of operation into different functions to avoid confusion, but must have missed an argument update.

ADD COMMENT
0
Entering edit mode

thank you for the explanation Aaron.

ADD REPLY
0
Entering edit mode

From what I gather in reading the documentation for csaw (like diffHic, csaw is another R package from Aaron Lun), this is also the case for normOffsets(), i.e., the function always does a loess fit. Is that correct? I ask because I ran into a similar error when using csaw.

(I apologize if this should be its own independent post; if so, please let me know, then I will delete this and make a new post. Thanks for any clarification and for your great packages.)

ADD REPLY
0
Entering edit mode

Yes, now it will always do a loess fit. (diffHic just calls csaw under the hood, so they're using the same function in both packages.) Is there some out-of-date documentation somewhere?

ADD REPLY
0
Entering edit mode

Thank you, no, I don't think so. I encountered the error when running through some open-source ChIP-seq analysis code that was written to use an earlier version of csaw.

ADD REPLY

Login before adding your answer.

Traffic: 804 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