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

Sanitize strings in run_pycistarget #112

Open
alexlenail opened this issue Feb 14, 2023 · 1 comment
Open

Sanitize strings in run_pycistarget #112

alexlenail opened this issue Feb 14, 2023 · 1 comment
Labels
question Further information is requested

Comments

@alexlenail
Copy link

the run_pycistarget wrapper function contains a few occurrences of a line like this one:

out_file = os.path.join(out_folder, str(x) +'.html')

Which doesn't work if your celltype includes special characters:

  File "/lab/solexa_weissman/lenail/tools/scenicplus/src/scenicplus/wrappers/run_pycistarget.py", line 247, in run_pycistarget
    menr['CTX_'+key+'_No_promoters'][str(x)].motif_enrichment.to_html(open(out_file, 'w'), escape=False, col_space=80)
FileNotFoundError: [Errno 2] No such file or directory: '/home/lenail/solexa/mouse_brain_aging/ATAC/pycisTopic/hippo/pycisTarget/CTX_DARs_No_promoters/L2/3 IT CTX_young_VS_L2/3 IT CTX_old.html'

My hacky solution locally was just:

out_file = os.path.join(out_folder, str(x).replace('/','_') +'.html')

But in general, str(x) should be replaced with sanitize(x)

@alexlenail alexlenail added the question Further information is requested label Feb 14, 2023
@SeppeDeWinter
Copy link
Collaborator

Hi @alexlenail

Yes, this is an issue that should be fixed!

Thank you.

Best,

Seppe

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

No branches or pull requests

2 participants