dpchris / MLVA

2 stars 0 forks source link

_csv. Error #1

Open keyburn opened 6 years ago

keyburn commented 6 years ago

HI,

I tried running your script following the readme file for Brucella. It gets to the end of strain 43 and then it comes up with an error: Traceback (most recent call last): File "/PATH_TO/MLVA-master/MLVA_finder.py", line 627, in main() File "/PATH_TO/MLVA-master/MLVA_finder.py", line 567, in main out.writerow(row) _csv.Error: need to escape, but no escapechar set

Do you know what could be causing this?

HBrendy commented 6 years ago

Dear David,

I am getting an identical traceback note. I am testing your script on my own SPAdes draft assemblies from ENA raw reads. Re-running the script leads to an exit at the same multi-contig fasta, the position in the queue of assemblies does not matter. I have examined the assemblies but cannot find a structural difference. Seems to be a sequence-specific problem.

Thank you for looking into this, if you have the time.

best, Chris

btw: i can provide you with the error causing assembly, if that helps. Or just try Brucella_suis_NZ_CP009094.1_NZ_CP009095.1 from your test data (strain 43). Brucella_suis_NZ_CP009096.1_NZ_CP009097.1 will produce the same error.

HBrendy commented 6 years ago

When generating the file "assemblies_output.csv", column 7 named "sequence" will be filled with the contig numbers where amplicons are found. In my case two hits are written, separated by a comma, which is also used as the delimiter when writing the csv.

To solve this, I changed the options in the csv.writer() calls from quoting=csv.QUOTE_NONE to quoting=csv.QUOTE_ALL with quotechar='"'.