-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #593 from csbrasnett/idp-go
Idp go
- Loading branch information
Showing
10 changed files
with
489 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2024 University of Groningen | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
""" | ||
Provides processors that can add and remove IDR specific bonds | ||
""" | ||
|
||
from .processor import Processor | ||
from ..rcsu.go_utils import _in_resid_region | ||
from ..log_helpers import StyleAdapter, get_logger | ||
LOGGER = StyleAdapter(get_logger(__name__)) | ||
|
||
|
||
def annotate_disorder(molecule, id_regions, annotation="cgidr"): | ||
""" | ||
Annotate the disordered regions of the molecule | ||
molecule: :class:`vermouth.molecule.Molecule` | ||
the molecule | ||
idr_regions: list | ||
list of tuples defining the resids of the idrs in the molecule | ||
annotation: str | ||
name of the annotation in the node | ||
""" | ||
|
||
for key, node in molecule.nodes.items(): | ||
_old_resid = node['_old_resid'] | ||
if _in_resid_region(_old_resid, id_regions): | ||
molecule.nodes[key][annotation] = True | ||
|
||
class AnnotateIDRs(Processor): | ||
""" | ||
Processor to annotate intrinsically disordered regions of a molecule. | ||
This processor is designed primarily for the work described in the reference | ||
M3_GO, but is generally applicable for such circumstances where extra | ||
addition/removals are necessary. | ||
""" | ||
|
||
def __init__(self, id_regions=None): | ||
""" | ||
Parameters | ||
---------- | ||
id_regions: | ||
regions defining the IDRs | ||
""" | ||
self.id_regions = id_regions | ||
|
||
def run_molecule(self, molecule): | ||
""" | ||
Assign disordered regions for a single molecule | ||
""" | ||
|
||
annotate_disorder(molecule, self.id_regions) | ||
|
||
return molecule | ||
|
||
def run_system(self, system): | ||
""" | ||
Assign the water bias of the Go model to file. Biasing | ||
is always molecule specific i.e. no two different | ||
vermouth molecules can have the same bias. | ||
Parameters | ||
---------- | ||
system: :class:`vermouth.system.System` | ||
""" | ||
if not self.id_regions: | ||
return system | ||
LOGGER.info("Annotating disordered regions", type="step") | ||
super().run_system(system) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
|
||
# -ff martini 3001 | ||
# BB-W bias for idr | ||
# add extra IDR potentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ martinize2 | |
-water-bias | ||
-water-bias-eps idr:0.5 | ||
-id-regions 1:24 | ||
-idr-tune |
Oops, something went wrong.