moca.helpers.configuration_parser.
ConfigurationParser
(config_file)[source]¶Bases: future.types.newobject.newobject
Parse config file
Parameters: | config_file (str) – absolute path to configuration file |
---|
get_all_genomes
()[source]¶Get all genome names as specified in config file
Returns: | genome_names – List of all genome names |
---|---|
Return type: | list |
get_all_sections
()[source]¶Get all sections in config file
Returns: | sections – List of all sections |
---|---|
Return type: | list |
get_binary_path
(binary_name)[source]¶Returns absolute path to installed binaries
Parameters: | binary_name (string) – Program name |
---|---|
Returns: | binary_path – Absolute path to installed binary |
Return type: | string |
get_genome_data
(genome_name)[source]¶Return all files associated with a genome in the config file
Parameters: | genome_name (str) – Genome name as specified in ‘genome:<genome_name>’ format |
---|---|
Returns: | genome_dict – Dictionary specifying the files associated with a genome Format: {‘genome_name’: {‘<wig_prefix>’: wig_prefix_path, ‘genome_table’: genome_table_path}} |
Return type: | str |
Utility function to run jobs
moca.helpers.job_executor.
chdir
(*args, **kwds)[source]¶Context manager to temporarily change to a new directory.
http://lucentbeing.com/blog/context-managers-and-the-with-statement-in-python/ Credits: Brad Chapman for bcbio-nextgen: https://github.com/chapmanb/bcbio-nextgen/blob/master/bcbio/utils.py#L192
Parameters: | new_dir (str) – Location of directory to be created |
---|
moca.helpers.job_executor.
run_job
(cmd, cwd)[source]¶Execute command line jobs passed as str argument
Parameters: | cmd (str) – Absolute command line statement as would be run on command line |
---|---|
Returns: |
|
moca.helpers.job_executor.
safe_makedir
(dname)[source]¶Make a directory if it doesn’t exist, handling concurrent race conditions.
Credits: Brad Chapman for bcbio-nextgen: https://github.com/chapmanb/bcbio-nextgen/blob/master/bcbio/utils.py#L172
Parameters: | dname (str) – Path of directory to be created |
---|