Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALDex2 issue #67

Open
SRuwi opened this issue Nov 7, 2023 · 12 comments
Open

ALDex2 issue #67

SRuwi opened this issue Nov 7, 2023 · 12 comments

Comments

@SRuwi
Copy link

SRuwi commented Nov 7, 2023

Using the following command
daa_results_df <- pathway_daa(abundance = kegg_abundance, metadata = metadata, group = "Stage", daa_method = "ALDEx2", select = NULL, reference = NULL)

i am getting the following error
Running ALDEx2 with multiple groups. This might take some time, please wait patiently...
Error in Math.factor(c(3L, 3L, 3L, 4L, 4L, 4L, 1L, 1L, 1L, 2L, 2L, 2L)) :
‘round’ not meaningful for factors

The metadata file is below
image

and the top part of the kotoKegg file is below
image

I converted the second column of the metadata file (Stage) to factors as well and am getting the same error. Has anyone encountered this or have a solution? Thank you in advance

@cafferychen777
Copy link
Owner

Dear @SRuwi,

It appears that there have been recent updates to the ALDEx2 package which might have introduced some compatibility issues with ggpicrust2. For the time being, I would recommend using an alternative method to proceed with your analysis. I will investigate this issue promptly and aim to resolve any conflicts or bugs arising from the update. Thank you for bringing this to my attention, and I appreciate your patience as I work to address this matter.

Best regards,

Chen YANG

@SRuwi
Copy link
Author

SRuwi commented Nov 8, 2023 via email

@zhonglinma
Copy link

Hi Chen @cafferychen777, I also got this error, is there any way to deal with it?

@cafferychen777
Copy link
Owner

Hello @zhonglinma,

For now, please change to another daa_method such as LinDA.

Best regards,
Chen YANG

@asgarhussain
Copy link

Hello @cafferychen777 , @zhonglinma and @SRuwi,
I also faced the same error while using ALDEx2 method. I am able to resolve the issue by installing ALDEx2 v.1.28 via source file downloaded from Bioconductor archive:
https://mghp.osn.xsede.org/bir190004-bucket01/index.html#archive.bioconductor.org/packages/3.15/bioc/src/contrib/Archive/ALDEx2/

I removed the currently installed version using : remove.packages("ALDEx2")
and installed using install.packages("archive.bioconductor.org_packages_3.15_bioc_src_contrib_Archive_ALDEx2_ALDEx2_1.28.0.tar.gz", repos = NULL, type="source")

@cafferychen777
Copy link
Owner

Dear @asgarhussain, @zhonglinma, and @SRuwi,

Thank you all for your valuable feedback and for sharing your experiences with the ALDEx2 issue in the pathway_daa function of ggpicrust2. I appreciate @asgarhussain's suggestion to resolve the issue by installing an older version of ALDEx2 (v.1.28) from the Bioconductor archive.

Based on your inputs, I will update the ggpicrust2 documentation to include this workaround for users encountering the same error. Additionally, I will continue to investigate the compatibility issue with the latest version of ALDEx2 to provide a more permanent solution in future updates of ggpicrust2.

Thank you once again for your contributions to improving ggpicrust2. Your patience and support are greatly appreciated.

Best regards,
Chen YANG

@Lacona
Copy link

Lacona commented May 3, 2024

Unfortunately I encounter the same error running ALDEx2. I installed ALDEx2 vs 1.28.0 to work around but I still get the error:
Running ALDEx2 with multiple groups. This might take some time, please wait patiently...
Error in Math.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, :
‘round’ not meaningful for factors
Is there any other solution for this problem?

@cafferychen777
Copy link
Owner

Hi @Lacona,

Thank you for reaching out and providing detailed information about the issue you're encountering with ALDEx2. It seems like several users have faced similar problems.

Could you please check your sessioninfo to ensure that you're using the correct version of ALDEx2? Sometimes, users inadvertently have an older version installed, which might lead to such errors even after attempting to update.

If you're still experiencing difficulties after confirming your ALDEx2 version, please let me know, and we'll explore other potential solutions together.

Best regards,

Chen YANG

@Lacona
Copy link

Lacona commented May 3, 2024

Thank you for your quick reply!

The error occurs with ALDEx2_1.34.0 but also with ALDEx2_1.28.0.
Check was done running sessionInfo().

@marwa38
Copy link

marwa38 commented Jan 26, 2025

ALDEx2 v.1.28 worked!

@cafferychen777
Copy link
Owner

Hi everyone,

After investigating the ALDEx2 source code, I believe I've found the root cause of the "round not meaningful for factors" error. The issue occurs when the group variable is stored as a factor type in R, which conflicts with ALDEx2's internal type conversion.

I've pushed a fix to resolve this issue. You can now get it working by:

  1. Reinstalling the package from GitHub
  2. Making sure your group variables are properly handled as characters before passing them to the ALDEx2 function

The underlying problem was related to automatic type conversion that ALDEx2 performs when dealing with factor variables. The fix ensures proper type handling during the analysis pipeline.

Please let me know if you encounter any other issues after updating the package.

Best regards

@marwa38
Copy link

marwa38 commented Jan 27, 2025

Thanks for your help.
I haven't tried yet but mine were not factors but characters. I changed to factors at the time I was working with this and I got the same round not meangiful error for characters as well as factors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants