Hi Reece and Keith.
I have had this error and have solved it. It is not caused specifically by SeqRepo. Are you using a package that uses multi-threading to call hgvs package and SeqRepo, e.g. a web micro-framework?
If so, you will need to do a couple of things to get SeqRepo to work.
1. Check that your install of SQLite3 (the actual SQLite3 not the python library) supports multi-threading. Most up-to-date versions do, however, you may need to re-install ensuring that your specific build has not been innstalled in a non-thread-safe way (This is an option and is, as far as I understand it, selected to speed SQLite3 up because the standard thread-safe install with no flags set is supposed to be slower).
2. You will then need to ensure your Python install is directed to load the thread-safe version of SQLite3. I personally chose to re-install Python from scratch.
3. This is where it gets tricky. I do not use hgvs nor SeqRepo as a through Docker. I have them installed locally and have complete access to the install. I guess that this will be a decision for Reece to take.
I adjusted the SeqRepo connection files as follows:
Python../site-packages/biocommons/seqrepo/seqaliasdb/seqaliasdb.py and change line 35 to
self._db = sqlite3.connect(self._db_path, check_same_thread=False)
also line 69 of /site-packages/biocommons/seqrepo/fastadir.py needs to be set to
self._db = sqlite3.connect(self._db_path, check_same_thread=False).
The problem is that Reece will not be able to make sure that everyones build of SQLite has been installed in thread-safe mode, so there may not be a safe way for him to make this check_same_thread=False option available in the docker instance. If you do some looking around, you will notice that check_same_thread=False is under-documented because SQLite3 was historically not thread safe.
Some folk will still criticise this fix, but I have been running this for about 2 months on
variantvalidator.org with no problems what so ever. It has been rigorously tested using our
variantvalidator.org/batchvalidator with several hundred thousand variants and it is proving to be a stable and fast option.
Hope this helps.
Pete