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

No such file or directory "assets" #30

Open
LucaMannino opened this issue Feb 8, 2024 · 3 comments
Open

No such file or directory "assets" #30

LucaMannino opened this issue Feb 8, 2024 · 3 comments

Comments

@LucaMannino
Copy link

Hi,

Aplogies if I am sking something pointless I am fairly inexperienced in coding.

I got this error: no such file or directory "assets"
image

When running the Loading and instantiating of the Identify MHC-bound neoantigens (T-antigen) part of the protocol without netMHCpan but using MHCflurry using the code below:

import os,sys
import pandas as pd
import numpy as np
import anndata as ad
import snaf

read in the splicing junction matrix

df = pd.read_csv('/nasdata/lmannino/PersonalisedCancer/SNAF/altanalyze_output/ExpressionInput/counts.original.pruned.txt',index_col=0,sep='\t')

database directory (where you extract the reference tarball file) and netMHCpan folder

db_dir = '/nasdata/lmannino/PersonalisedCancer/SNAF/data/'

demonstrate how to add additional control database, see below note for more

tcga_ctrl_db = ad.read_h5ad(os.path.join(db_dir,'controls','tcga_matched_control_junction_count.h5ad'))
gtex_skin_ctrl_db = ad.read_h5ad(os.path.join(db_dir,'controls','gtex_skin_count.h5ad'))
add_control = {'tcga_control':tcga_ctrl_db,'gtex_skin':gtex_skin_ctrl_db}

initiate

snaf.initialize(df=df,db_dir=db_dir,add_control=add_control)

I fixed the error by commenting out from line 18 to 22 of the app.py file in the snaf conda environment:
image

I was wondering is this the correct approach? the code seams to be working now I just wanted to check with you and hopefully if it is correct other people that might encouter the same problem can use this solution.

@frankligy
Copy link
Owner

Hi @LucaMannino,

Thanks for bringing this up, for the particular error message that you mentioned, you did it correctly. This is not my proudest design, the reason is just for the T antigen and B antigen viewer, every time after using that, it will generate a lot of temporary images so I wrote this to automatically purge them when I exit the program. It will cause confusion if you are not using the viewer, but it doesn't do any harm for the program so I've been procrastinating resolving it. I hope this clear your confusion, and I'll try to find a better way to do that in the next release.

But from you logging, it immediately exit the program (showing this message) after initialization, this sounds weird to me because it basically says nothing has been executed. You can refer to this reply to see normally how the logging should look like (#27 (comment)).

You mentioned you are using mhcflurry, although it should work for smaller data, I do experience longer running time and the issue people brought up (the link I sent) saying it has memory overhead. Internally, I have been using netMHCpan for all my analysis. I had a youtube link to demo how to install & configure that, it is very straightforward. And I am happy to help if you encounter any issue.

Let me know if that makes sense,
Frank

@sufyazi
Copy link

sufyazi commented Feb 19, 2025

Hi Frank, loving the idea of this pipeline. I'm in the middle of testing this to incorporate into a larger Nextflow pipeline that we plan to publish down the road and I encountered the same bug too, and I wasn't even doing anything: I was just going into iPython interactively and imported snaf. The error showed up when I exit iPython.

Why not just add a try block instead if you think the atexit decorator should stay? I'll fork a copy of this repo so I can add exception handling myself and test it without waiting for the next release in the meantime, but let me know if you think I just make a pull request instead.

Suffian

@frankligy
Copy link
Owner

Hi @sufyazi,

Sorry yes you are absolutely right, you can either comment them out or adding a try-except catch, feel free to make a pull request if your fix will solve this problem and won't break other components.

Best,
Frank

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

3 participants