Skip to content

Commit

Permalink
Simpler regex, allows for dashes
Browse files Browse the repository at this point in the history
  • Loading branch information
iquasere committed Jan 3, 2024
1 parent 2c62e4c commit d7ad3a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keggcharter.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def read_input_file(args: argparse.Namespace) -> pd.DataFrame:
patterns = {
"kegg_column": (r"^[A-Za-z]{3}:.+$", 'tax_id:KEGG_ID'),
"ko_column": (r"^K\d{5}$", 'KXXXXX'),
"ec_column": (r"^[1-9]\d*(\.\d+){3}(,[1-9]\d*(\.\d+){3})*$", 'X.X.X.X'),
"ec_column": (r"^(\d+)(\.(\d+|-)){3}$", 'X.X.X.X'),
"cog_column": (r"^COG\d{4}$", 'COGXXXX')
}
for col in ["kegg_column", "ko_column", "ec_column", "cog_column"]:
Expand Down

0 comments on commit d7ad3a4

Please sign in to comment.