HCBravoLab / metagenomeSeq

Statistical analysis for sparse high-throughput sequencing
64 stars 20 forks source link

Error: $ operator not defined for this S4 class #72

Closed jkcopela closed 5 years ago

jkcopela commented 5 years ago

Hello,

When I try to extract the objects from the fitZig results (fit, z, eb, etc.), I get this error message: "Error in fit_Treatment$fit : $ operator not defined for this S4 class"

This stops me from any further analysis.

While installing, I noticed this error, I am not sure if it is related: in method for ‘MRihw’ with signature ‘"fitFeatureModelResults"’: no definition for class “fitFeatureModelResults” in method for ‘MRihw’ with signature ‘"fitZigResults"’: no definition for class “fitZigResults”

Thanks!

dombraccia commented 5 years ago

Hello @jkcopela,

In the latest release of metagenomeSeq, S4 results classes were created for fitZig and fitFeatureModel results, so the usual $ operator does not work on this S4 results class. For the time being, we recommend you to use @ to access the slots of your results object (in your case the fir_Treatment object) such fit, z, eb, etc. In a future release, we will add accessor functions for important results from the fitZigResults S4 object. Let me know if this works for you.

As for the warning you mentioned surrounding MRihw, this should not affect any part of your workflow. It's likely a simple fix on our end, and we will look into it.

Thanks, Domenick

jkcopela commented 5 years ago

Hi Domenick,

Thank you! I have used the @ operator to access the results from within the fitZigResults object.

However I would also like to run calculateEffectiveSamples on the fitZigResults, which does not work due to the S4 class. Is there a work-around so that I can use the calculateEffectieSamples function?

Update: I have run: rowSums(1 -fitZigResults@z), which I think is the same as the calculateEffectiveSamples function?

Thanks for your help!

dombraccia commented 5 years ago

@jkcopela,

Yes, that is exactly what calculateEffectiveSamples() does, just the function wasn't updated to use @ instead of $. Sorry for the inconvenience.

Please let us know if anything else comes up. Your feedback is helping us improve metagenomeSeq.

dombraccia commented 5 years ago

@jkcopela I updated calculateEffectiveSamples() so that it will use @ instead of $ now. The change was pushed to the RELEASE_3_9 branch, and so should show up on Bioconductor soon.

hcorrada commented 5 years ago

Should be available tomorrow in version 1.26.2 (release branch)