pombase / allele_qc

Quality control for PomBase alleles
MIT License
1 stars 1 forks source link

improve format_negatives and num in grammar.py #86

Closed manulera closed 1 year ago

manulera commented 1 year ago

Maybe the group should match the negative number only, and not the parenthesis. This would be useful for future formatting.

manulera commented 1 year ago

Actually, this should not be the case, because we want to match the entire negative number with parenthesis e.g. (-123), and not just -123, otherwise when using replace_allele_features_with_syntax_rules, the parenthesis would be left out and unmatched.

I could think of a regex like \((-\d+)\)|\((-?\d+)\), which matches the entire thing but only captures the number in the group. However, when calling groups() on the match, it would return an empty group and a filled one, complicating things for apply_syntax.