ahmohamed / lipidr

Data Mining and Analysis of Lipidomics datasets in R
https://www.lipidr.org/
Other
27 stars 13 forks source link

Issue with "as_lipidomics_experiment" function #37

Closed Rotimz closed 2 years ago

Rotimz commented 2 years ago

Hi Ahmed,

I'm a 3rd year PhD Student new to coding with R. Unfortunately I am encountering an issue with the lipidr package. In response to:

d <- as_lipidomics_experiment(read.csv(dm_path))

R returns: Error in as_lipidomics_experiment(read.csv(dm_path)) : could not find function "as_lipidomics_experiment"

Any help would be much appreciated.

Thank you, Rotimi

ahmohamed commented 2 years ago

Please add the following to your script:

library(lipidr)

Rotimz commented 2 years ago

Hi Ahmed,

The message I receive after that is:

Error: package or namespace load failed for ‘lipidr’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/gmm/libs/gmm.so': dlopen(/Library/Frameworks/R.framework/Versions/4.2/Resources/library/gmm/libs/gmm.so, 0x0006): Library not loaded: '/usr/local/gfortran/lib/libgomp.1.dylib' Referenced from: '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/gmm/libs/gmm.so' Reason: tried: '/usr/local/gfortran/lib/libgomp.1.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64h))), '/Library/Frameworks/R.framework/Resources/lib/libgomp.1.dylib' (no such file), '/Users/rotimi/lib/libgomp.1.dylib' (no such file), '/usr/local/lib/libgomp.1.dylib' (no such file), '/usr/lib/libgomp.1.dylib' (no such file), '/lib/libgomp.1.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre/lib/server/libgomp.1.dylib' (no such file), '/var/fol

I have also copied the full script below:

Using lipidr for analysis using 2 files for numerical matrix input

Installing BioConductor

if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("lipidr") a yes

library("BiocManager") # loading package to access its functions - redundant due to row 33 I think

BiocManager::available()

Loading lipidr

library(lipidr) installed.packages()

lipidr file conversion to LipidomicsExperiment

dir_path = getwd() dir_name = "/lipidr_data" dm_path = paste(dir_path,dir_name,"/Reordered_AN_11_In_Log_2_Data_Matrix.csv", sep="") ta_path = paste(dir_path,dir_name,"/Reordered_In_Log_2_Data_Clin.csv", sep="")

df <- as_lipidomics_experiment(read.csv(dm_path)) df <- add_sample_annotation(d, ta_path)

d <- as_lipidomics_experiment(read.csv("Reordered_AN_11_In_Log_2_Data_Matrix.csv")) d <- add_sample_annotation(d, "Reordered_In_Log_2_Data_Clin")

Neither set of d <- works

Thank you for your help

ahmohamed commented 2 years ago

You need to install Fortran library on your Mac. Please refer to #29 for details.

Rotimz commented 2 years ago

Thanks Ahmed. Works a treat now. Looking forward to working with your analysis tool!