Shenhav-and-Korem-labs / SCRuB

Other
25 stars 2 forks source link

Error in torch_tensor_cpp #18

Closed xiazhongkui closed 10 months ago

xiazhongkui commented 11 months ago

Hi, I got a wrong information. Could you please to help me?

#

scr_out <- SCRuB(otu_p,metadata,control_order = control_order)

[1] "Incorporating the well metadata to track well-to-well leakage!" [1] "SCRuBbing away contamination in the control blank DNA extraction controls..." Error in torch_tensor_cpp(data, dtype, device, requires_grad, pin_memory) : Lantern is not loaded. Please use install_torch() to install additional dependencies. #

Thanks a lot

gaustin15 commented 11 months ago

Running torch::install_torch() usually resolves this error; does doing that help on your end?

If that doesn't fix it, could you please let me know which version of the torch package you are using

xiazhongkui commented 11 months ago

torch::install_torch() cannot fix. packageVersion("torch") [1] ‘0.11.0’

Warning: ℹ torch failed to start, restart your R session to try again. ℹ You might need to reinstall torch using install_torch() ✖ /ngsdata1/tNGS/xiazhongkui/0.bin/mamba/envs/R4/lib/R/library/torch/lib/liblantern.so

gaustin15 commented 11 months ago

Ok, that torch version is able to run on my machine, which makes me think that there's something else in your environment that's causing the discrepancy between our SCRuB runs.

Would you by any chance be able to run the following script to create a new qiime environment and see if SCRuB can be executed in there? Hopefully this will sidestep the error you're facing.

wget -q https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py38-osx-conda.yml
conda env create -n qiime2 --file qiime2-latest-py38-osx-conda.yml # if applicable replace 'osx' with 'linux' in both this and the previous line
conda activate qiime2
conda install -c conda-forge -c bioconda -c r r-devtools
Rscript -e 'devtools::install_github("Shenhav-and-Korem-labs/SCRuB")'
Rscript -e 'torch::install_torch()'
Rscript -e 'library(SCRuB)' # just to make sure we can run this line
## you could stop the script and test SCRuB in R at this point
pip install git+https://github.com/Shenhav-and-Korem-labs/q2-SCRuB.git
mkdir SCRuB-example # setting up the data
mkdir SCRuB-example/plasma-data
mkdir SCRuB-example/results
cd SCRuB-example/plasma-data
wget https://github.com/Shenhav-and-Korem-labs/q2-SCRuB/raw/main/ipynb/plasma-data/table.qza
wget https://github.com/Shenhav-and-Korem-labs/q2-SCRuB/raw/main/ipynb/plasma-data/metadata.tsv
cd ..
qiime SCRuB SCRuB --i-table plasma-data/table.qza --m-metadata-file plasma-data/metadata.tsv --p-control-idx-column is_control --p-sample-type-column sample_type --p-well-location-column well_id --p-control-order "control blank library prep,control blank DNA extraction" --o-scrubbed results/scrubbed.qza
talkorem commented 10 months ago

Hi @xiazhongkui, please reopen if the issue persists.