feat: add parameter class
2 unresolved threads
2 unresolved threads
Edited by Alex Kanitz
Merge request reports
Activity
requested review from @kanitz
- src/parameter_parser.py 0 → 100644
28 rna_sd_length: RNA fragment length standard deviation. 29 read_length: Read length. 30 intron_rate: Constant probability of retaining an intron. 31 add_poly_a: Boolean option to add a poly A tail. 32 poly_a_func: Function to add a poly_a tail. 33 primer_seq: Sequence of the primer. 34 priming_func: Function that evaluates internal priming. 35 """ 36 37 def __init__(self, param_file: Path) -> None: 38 """Class constructor.""" 39 self.param_file: Path = Path(param_file) 40 with open(param_file) as f: 41 LOG.info("Loading parameters...") 42 for line in f: 43 s = line.split(':') - src/parameter_parser.py 0 → 100644
29 read_length: Read length. 30 intron_rate: Constant probability of retaining an intron. 31 add_poly_a: Boolean option to add a poly A tail. 32 poly_a_func: Function to add a poly_a tail. 33 primer_seq: Sequence of the primer. 34 priming_func: Function that evaluates internal priming. 35 """ 36 37 def __init__(self, param_file: Path) -> None: 38 """Class constructor.""" 39 self.param_file: Path = Path(param_file) 40 with open(param_file) as f: 41 LOG.info("Loading parameters...") 42 for line in f: 43 s = line.split(':') 44 if s[0] == 'Csv transcripts file': It's not very robust to look for kind of prose/literal strings like that. Better to use a YAML file where you can specify keys and values, and then use the same keys you use in the class also as keys in the YAML file. Here's a pointer to get you started on YAML: https://www.cloudbees.com/blog/yaml-tutorial-everything-you-need-get-started
However, you can leave the implementation as it is now, as we may not use it (if we use Nextflow, we can have that take care of parsing the configuration, from a YAML file)
Please register or sign in to reply