diff --git a/.github/workflows/test-and-lint.yml b/.github/workflows/test-and-lint.yml index 28ef790..6227181 100644 --- a/.github/workflows/test-and-lint.yml +++ b/.github/workflows/test-and-lint.yml @@ -5,9 +5,9 @@ name: Test & Lint on: push: - branches: [ "main" ] + branches: [ "dev" ] pull_request: - branches: [ "main", "release" ] + branches: [ "main" ] permissions: contents: read diff --git a/fgutils/fgconfig.py b/fgutils/fgconfig.py index e914dad..464024e 100644 --- a/fgutils/fgconfig.py +++ b/fgutils/fgconfig.py @@ -27,9 +27,24 @@ }, {"name": "amide", "pattern": "RC(=O)N(R)R", "group_atoms": [1, 2, 3]}, {"name": "alcohol", "pattern": "COH", "group_atoms": [1, 2]}, - {"name": "primary_alcohol", "pattern": "C(C)OH", "group_atoms": [2, 3]}, - {"name": "secondary_alcohol", "pattern": "C(C)(C)OH", "group_atoms": [3, 4]}, - {"name": "tertiary_alcohol", "pattern": "C(C)(C)(C)OH", "group_atoms": [4, 5]}, + { + "name": "primary_alcohol", + "pattern": "CCOH", + "group_atoms": [2, 3], + "anti_pattern": ["CC(O)O"], + }, + { + "name": "secondary_alcohol", + "pattern": "C(C)(C)OH", + "group_atoms": [3, 4], + "anti_pattern": ["CC(O)O"], + }, + { + "name": "tertiary_alcohol", + "pattern": "C(C)(C)(C)OH", + "group_atoms": [4, 5], + "anti_pattern": ["CC(O)O"], + }, {"name": "enol", "pattern": "C=COH"}, {"name": "acetal", "pattern": "RC(OC)(OC)H", "group_atoms": [1, 2, 4, 6]}, {"name": "ketal", "pattern": "RC(OR)(OR)R", "group_atoms": [1, 2, 4]}, diff --git a/pyproject.toml b/pyproject.toml index aa8975f..9991726 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "fgutils" -version = "0.0.13" +version = "0.0.14" authors = [{name="Klaus Weinbauer", email="klaus@bioinf.uni-leipzig.de"}] description = "Library to get functional groups from molecular graphs." readme = "README.md" diff --git a/test/test_query.py b/test/test_query.py index 1e2dd15..b9ce2ce 100644 --- a/test/test_query.py +++ b/test/test_query.py @@ -79,6 +79,10 @@ def test_get_functional_group_once(): pytest.param("CCO", ["primary_alcohol"], [[2]], id="Primary Alcohol"), pytest.param("CC(C)O", ["secondary_alcohol"], [[3]], id="Secondary Alcohol"), pytest.param("CC(C)(C)O", ["tertiary_alcohol"], [[4]], id="Teritary Alcohol"), + pytest.param( + "C(O)(O)C=CO", ["hemiketal", "enol"], [[0, 1, 2], [3, 4, 5]], id="Hemiketal" + ), + pytest.param("C=CO", ["enol"], [[0, 1, 2]], id="Enol") # pytest.param("", [""], [[]], id=""), ], )