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

Error after not finding pre-training models (ir.dill) #21

Open
ivandatasci opened this issue Apr 25, 2022 · 3 comments
Open

Error after not finding pre-training models (ir.dill) #21

ivandatasci opened this issue Apr 25, 2022 · 3 comments

Comments

@ivandatasci
Copy link

Hello everyone.

I just installed the latest cello-classify version with pip. Version 2.0.3. Installation went fine.

When I try to use it, I get an error.

I execute this cell in a JupyterLab notebook:

cello.scanpy_cello(adata0a,
                   clust_key='leiden',
                   rsrc_loc='/mnt/b0/compbio-ebs-01/igr/d0/220317_000000/130',
                   out_prefix='/mnt/b0/compbio-ebs-01/igr/d0/220317_000000/130/cello_model00',
                   log_dir='/mnt/b0/compbio-ebs-01/igr/d0/220317_000000/130')

and this is the error:

       Could not find the CellO resources directory called
        'resources' in '/mnt/b0/compbio-ebs-01/igr/d0/220317_000000/130'. Will download resources to current 
        directory.
        
Running command: curl http://deweylab.biostat.wisc.edu/cell_type_classification/resources_v2.0.0.tar.gz > /mnt/b0/compbio-ebs-01/igr/d0/220317_000000/130/resources_v2.0.0.tar.gz
Running command: tar -C /mnt/b0/compbio-ebs-01/igr/d0/220317_000000/130 -zxf resources_v2.0.0.tar.gz
Running command: rm /mnt/b0/compbio-ebs-01/igr/d0/220317_000000/130/resources_v2.0.0.tar.gz
Checking if any pre-trained model is compatible with this input dataset...
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-45-2570c77cb08a> in <module>
      4 #sc.pp.neighbors(adata0a, n_neighbors=15)
      5 #sc.tl.leiden(adata0a, resolution=2.0)
----> 6 cello.scanpy_cello(adata0a,
      7                    clust_key='leiden',
      8                    rsrc_loc='/mnt/b0/compbio-ebs-01/igr/d0/220317_000000/130',

/usr/local/lib/python3.9/site-packages/cello/scanpy_cello.py in cello(adata, clust_key, rsrc_loc, algo, out_prefix, model_file, log_dir, term_ids, remove_anatomical_subterms)
    127     else:
    128         # Load or train a model
--> 129         mod = ce._retrieve_pretrained_model(adata, algo, rsrc_loc)
    130         if mod is None:
    131             mod = ce.train_model(

/usr/local/lib/python3.9/site-packages/cello/cello.py in _retrieve_pretrained_model(ad, algo, rsrc_loc)
    329                 model_fname
    330             )
--> 331             with open(model_f, 'rb') as f:
    332                 mod = dill.load(f)
    333             feats = mod.classifier.features

FileNotFoundError: [Errno 2] No such file or directory: '/mnt/b0/compbio-ebs-01/igr/d0/220317_000000/130/resources/trained_models/ir.dill'

Could somebody offer some guidance?

Thank you.

Ivan

@alexisthermofisher
Copy link

Hi Ivan,

Were you ever able to figure it out? I am also having issues with my CellO resources directory.

Thanks!

@mbernste
Copy link
Member

mbernste commented Jul 8, 2023

My apologies for the trouble. I just fixed the bug. If you re-install CellO via pip install -U cello-classify, then the new version should hopefully work now. Let me know if you still experience an issue.

@TomSmithCGAT
Copy link

I'm getting the same error. I downloaded the resources and unpacked with:

wget https://deweylab.biostat.wisc.edu/cell_type_classification/resources_v2.0.0.tar.gz; tar -xvf resources_v2.0.0.tar.gz

which gives me the following output:

x resources/
x resources/gene_metadata/
x resources/trained_models/
x resources/README
x resources/training_set/
x resources/training_set/labels.json
x resources/training_set/experiment_to_study.json
x resources/training_set/experiment_to_tags.json
x resources/training_set/log_tpm.h5: truncated gzip input
tar: Error exit delayed from previous errors.

and the following files:

 ls resources/* 
resources/README

resources/gene_metadata:

resources/trained_models:

resources/training_set:
experiment_to_study.json	experiment_to_tags.json		labels.json			log_tpm.h5

I installed cello-classify v 2.1.1 in my conda env with pip:

$conda list|grep cello
cello-classify            2.1.1                    pypi_0    pypi

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

4 participants