streetslab / dimelo

python package for analysis of dimelo-seq & nanopore modified base data
MIT License
3 stars 5 forks source link

Issue when running plot_browser #109

Closed mmahlke closed 1 month ago

mmahlke commented 1 month ago

I've received this error before and got around it by changing the name of my input file.bam But that is not working this time Why am I getting hit with a syntax error?

Command: dm.plot_browser("/mypath/file.bam", "X", "assembly_hap1:79000000-79500000", "A", "/mypath/out/test", colorA='#cc322f', threshA=205, smooth=5000, dotsize=2, static=True)

Producing error: Traceback (most recent call last): File "", line 1, in File "/mypath/.conda/envs/dimelo/lib/python3.7/site-packages/dimelo/plot_browser.py", line 197, in plot_browser cores=num_cores, File "/mypath/.conda/envs/dimelo/lib/python3.7/site-packages/dimelo/parse_bam.py", line 284, in parse_bam make_db(fileName, sampleName, outDir) File "/mypath/.conda/envs/dimelo/lib/python3.7/site-packages/dimelo/parse_bam.py", line 154, in make_db create_sql_table(DATABASE_NAME, table_name, cols, dtypes) File "/mypath/.conda/envs/dimelo/lib/python3.7/site-packages/dimelo/utils.py", line 31, in create_sql_table c.execute("""DROP TABLE IF EXISTS """ + table_name + """;""") sqlite3.OperationalError: near "-": syntax error

mmahlke commented 1 month ago

I thought I had resolved this as being a python issue, but has not been the case. Any advice?

thekugelmeister commented 1 month ago

Hi! To start, for full transparency, this version of the package is in the process of being deprecated in favor of a much more robust version. We hope to make that more publicly available soon. Part of the reason for this change is to help make debugging this sort of thing much easier, and to make it harder to trigger strange edge cases like this.

That being said, I will do my best to help! Based on the (mostly unhelpful) error message and your comment about file naming, it does seem as if this might be a file name issue? Are there any hyphens in the name of your bam file? I'm not sure why that would break things but I'm starting with a small shot in the dark.

mmahlke commented 1 month ago

I figured it out. An errant '-' in the plot title! I guess plot title is a part of the table name. Thanks!