mavis.config
CONVERT_OPTIONS
CONVERT_OPTIONS = WeakMavisNamespace()
class mavis.config.CustomHelpFormatter
inherits argparse.ArgumentDefaultsHelpFormatter
subclass the default help formatter to stop default printing for required arguments
class mavis.config.RangeAppendAction
inherits argparse.Action
allows an argument to accept a range of arguments
mavis.config.RangeAppendAction.__init__()
def __init__(self, nmin=1, nmax=None, **kwargs):
Args
- nmin
- nmax
class mavis.config.LibraryConfig
inherits MavisNamespace
holds library specific configuration information
mavis.config.LibraryConfig.__init__()
def __init__(
self,
library,
protocol,
disease_status,
bam_file=None,
inputs=None,
read_length=None,
median_fragment_size=None,
stdev_fragment_size=None,
strand_specific=False,
strand_determining_read=2,
**kwargs
):
Args
- library
- protocol
- disease_status
- bam_file
- inputs
- read_length
- median_fragment_size
- stdev_fragment_size
- strand_specific
- strand_determining_read
mavis.config.LibraryConfig.build()
Builds a library config section and gathers the bam stats
@staticmethod
def build(
library,
protocol,
bam_file,
inputs,
annotations=None,
log=DEVNULL,
distribution_fraction=0.98,
sample_cap=3000,
sample_bin_size=1000,
sample_size=500,
**kwargs
):
Args
- library
- protocol
- bam_file
- inputs
- annotations
- log
- distribution_fraction
- sample_cap
- sample_bin_size
- sample_size
class mavis.config.MavisConfig
inherits MavisNamespace
mavis.config.MavisConfig.read()
reads the configuration settings from the configuration file
@staticmethod
def read(filepath):
Args
- filepath (
str
): path to the input configuration file
Returns
List[Namespace]
: namespace arguments for each library
mavis.config.validate_section()
given a dictionary of values, returns a new dict with the values casted to their appropriate type or set to a default if the value was not given
def validate_section(section, namespace, use_defaults=False):
Args
- section
- namespace
- use_defaults
mavis.config.get_metavar()
For a given argument type, returns the string to be used for the metavar argument in add_argument
def get_metavar(arg_type):
Args
- arg_type
Examples
>>> get_metavar(bool)
'{True,False}'
mavis.config.nameable_string()
A string that can be used for library and/or filenames
def nameable_string(input_string):
Args
- input_string
mavis.config.augment_parser()
Adds options to the argument parser. Separate function to facilitate the pipeline steps all having a similar look/feel
def augment_parser(arguments, parser, required=None):
Args
- arguments
- parser
- required