FEV_KEGG.settings module¶
Settings used across the application.
-
FEV_KEGG.settings.automaticallyStartProcessPool= True¶ Whether a pool of processes should automatically spin up.
You will want this False if:
- you
import FEV_KEGGinside a background thread or a child process only, because starting a process pool only works from within the main thread of the main process OR - you already have other means of providing parallelism OR
- you want to save on the rather big overhead of spinning up, using, and tearing down processes. Especially when you
import FEV_KEGGwithout actually using the process pool, e.g. when using something like Sphinx with autodoc.
If you do have this False, you will have to either:
- run
FEV_KEGG.startProcessPool(). You should do this as early as possible, because your whole main process will be copied, including all the RAM it hitherto occupied. Will only work within the main thread of the main process OR - replace
FEV_KEGG.Util.Parallelism.processPoolwith aconcurrent.futures.Executorof your choice, or else some functions will fail and raise an error, especially inFEV_KEGG.KEGG.Organism.Group. The object may be a dummy, as long as it adheres to the interface and successfully works on tasks.
You will want this True if:
- you
import FEV_KEGGin your main thread of the main process only AND - you want to use functions utilising parallelism in the process pool, especially in
FEV_KEGG.KEGG.Organism.GroupAND - you rarely import without actually using the process pool, because spinning up and tearing down processes can take several seconds.
See also
FEV_KEGG.Util.Parallelism.startProcessPool- Spins up a pool of processes. No further setup required.
- you
-
FEV_KEGG.settings.cachePath= '/home/docs/.cache/FEV-KEGG'¶ File system path for the cache directory.
This directory is used for caching downloads and calculations. It is automatically set depending on your OS’s default cache folder.
See also
- Caching
- Readmy entry explaining caching in general.
-
FEV_KEGG.settings.defaultEvalue= 1e-15¶ Default threshold for the statistical expectation value (E-value), below which a sequence alignment is considered significant. This can usually be overwritten for a whole module, or in a function’s parameters.
-
FEV_KEGG.settings.defaultNoMultifunctional= True¶ Whether to exclude multifunctional enzymes from analysis. This is useful to exclude complex cases of multi-domain enzymes and known promiscuous enzymes.
-
FEV_KEGG.settings.defaultOneOrganismPerSpecies= True¶ Whether to use only one organism per species in a taxonomy. This is useful to reduce overrepresentation of species with many sequenced genomes in a group.
-
FEV_KEGG.settings.downloadThreads= 32¶ Number of threads to download with at once.
Depends on the speed of your internet connection.
Warning
Should only be used inside the main process. Else, the total number of download threads will multiply by the number of available processors!
-
FEV_KEGG.settings.downloadThreadsPerProcess= 16¶ Number of threads to download with at once, divided by the number of available processors.
Should be used inside background processes. Depends on your computer.
-
FEV_KEGG.settings.downloadThreadsPerProcessSSDB= 6¶ Number of threads to download with at once from KEGG SSDB, divided by the number of available processors.
Should be used inside background processes. Depends on your computer.
-
FEV_KEGG.settings.downloadThreadsSSDB= 12¶ Number of threads to download with at once from KEGG SSDB.
Depends on the speed of your internet connection. Also depends on SSDB, because this part of KEGG can obviously withstand far fewer parallel connections. If you get frequent HTTP 403 Forbidden errors, despite of retrying upon such errors, lower this value until the progress bar moves smoothly.
Warning
Should only be used inside the main process. Else, the total number of download threads will multiply by the number of available processors!
-
FEV_KEGG.settings.downloadTimeout= 60¶ Time in seconds after which a blocking socket is considered failed.
Should be well below retryDownloadMax, or else you will not retry at all.
-
FEV_KEGG.settings.downloadTimeoutSocket= 30¶ Quirks for downloadTimeout in Python 3.4 (and maybe above).
For some reason, in Python 3.4, sockets double the timeout value passed to them.
-
FEV_KEGG.settings.fileThreads= 8¶ Number of threads to access files with at once.
Depends on the speed of your data storage.
Warning
Should only be used inside the main process. Else, the total number of file threads will multiply by the number of available processors!
-
FEV_KEGG.settings.fileThreadsPerProcess= 4¶ Number of threads to acces files with at once, divided by the number of available processors.
Should be used inside background processes. Depends on your computer.
-
FEV_KEGG.settings.organismInfoExpiration= 86400¶ Seconds after which an organism info file is considered outdated. This can be useful when relying upon a current database size for calculating E-values for a
FEV_KEGG.KEGG.SSDB.Match.
-
FEV_KEGG.settings.printElementUrl= False¶ If True, when a
Graph.Elements.Elementis returned in its string representation, append its URL to KEGG. This can quickly overencumber output!
-
FEV_KEGG.settings.processes= 2¶ Number of processes to calculate with.
Depends on your computer. Defaults to the number of logical CPU cores, or if unretrievable, to 1.
Warning
Processes have much more overhead than threads.
-
FEV_KEGG.settings.retryDownloadBackoffFactor= 1000¶ Factor in milliseconds for exponential backoff.
The backoff function waits
2^x * retryDownloadBackoffFactormilliseconds between retries, where x is the count of tries already failed.
-
FEV_KEGG.settings.retryDownloadBackoffMax= 10000¶ Maximum time between two retries, which the exponential backoff function can not exceed.
-
FEV_KEGG.settings.retryDownloadMax= 60000¶ Maximum total time in milliseconds a download should be retried before giving up.
Warning
Giving up usually throws an error and halts the whole program!
-
FEV_KEGG.settings.verbosity= 1¶ Verbosity of the output on the console.
0 = no unecessary output, only errors. 1 = informative output, including progess for long-running tasks. 2 = including short description of the process shown as a progress bar, e.g. ‘Calculating redundancy…’ 3 = debug output, including whether a file is downloaded or already in cache.