Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Membrane components, mechanism, and examples #286

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

zjuradoq
Copy link

This pull request contains membrane components, mechanisms, and a specialized example for each type. Additionally, the component was updated to have a compartment attribute. Unit tests for each new component and mechanism have also been included. This pull request supersedes previous pull requests, which aimed to add membrane components.

This request also is in place of the 1/16/2025 pull request.

The addition of all membrane components,  transport mechanism, associated unit tests, and an example.
Copy link
Collaborator

@ayush9pandey ayush9pandey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The notebook runs fine (and all examples are great!) I have some code-specific comments that I have added to the files directly. Some refactoring may be needed there. I also noticed some unit tests are failing: test_membrane_signaling and test_simple_diffusion (variables not defined).

I can take a look at the PR again and possibly also try to refactor some code soon, if needed.


def update_reactions(self):
mech_cat = self.get_mechanism('membrane_sensor')
return mech_cat.update_reactions(self.membrane_sensor_protein, self.response_protein, self.assigned_substrate, self.signal_substrate, self.energy, self.waste, component=self, part_id=self.name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"IntegralMembraneProtein" is another class after this one (also, membrane channel). So, is this description accurate?

def __init__(self, membrane_protein: Union[Species, str, Component],
product: Union[Species,str, Component],
direction= None, size=None, attributes=None, **keywords):
"""Initialize a MembraneChannel object to store membrane channel related information.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "Initialize an IntegralMembraneProtein component"?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "direction" a string that will be used in species attribute?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should be "Initialize an IntegralMembraneProtein component" and has been updated.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Direction" is a string, and will be in species attribute. Is this a clarifying question or do I need to address an issue?


def update_reactions(self):
mech_cat = self.get_mechanism('membrane_insertion')
print(self)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove print?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This print and others have been removed. They were part of the debugging process.

substrate: Union[Species, str, Component],
direction=None, internal_compartment='Internal', external_compartment='External',
ATP=None, cell=None, attributes=None, **keywords):
"""Initialize a Transporter object to store Transport membrane related information.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused: does this initialize a "MembranePump" object?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I used a general term as a transport but changed it to a specific object, as Transporter is not a class.

substrate: Union[Species, str, Component],
direction=None, internal_compartment='Internal', external_compartment='External',
cell=None, attributes=None, **keywords):
"""Initialize a Transporter object to store transport membrane related information.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's a Transporter? Is it a class defined somewhere?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the language to the specific class.


from .mechanism import Mechanism
from .reaction import Reaction
from .species import Complex, Species, WeightedSpecies
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a few of these are unused, and so can be removed from the imports.

Mechanism.__init__(self, name, mechanism_type)

def update_species(self, membrane_sensor_protein, response_protein,
assigned_substrate, signal_substrate, energy, waste,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there is a better way to describe the complexes in the code here than naming 1 to 6. Maybe a list or a dict of complexes could be used to make this code a bit more streamlined.

Copy link
Author

@zjuradoq zjuradoq Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would adding a dict i.e. Complexes={"Signal_Sub:Sensor_Protein":complex1, "Signal_Sub:Sensor_Protein:ATP":complex2,...} be sufficient? Then, would this dictionary be used when calling the complexes in the reactions?

if part_id is None and component is not None:
part_id = component.name

if component is None and (kb1 is None or ku1 is None or kb2 is None or ku2 is None or kcat is None or kex is None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ku2 is not defined.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to be a remnant from a previous line; ku2 is not a parameter in the membrane protein integration reactions.


return [integral_membrane_protein, product, complex1, complex2]

def update_reactions(self, integral_membrane_protein, product, component=None, part_id=None, complex=None, complex2 = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to my previous comment, I think we should think about representing the complexes and parameters differently. The Parameter class may be helpful here..I can take a look at refactoring this to address this comment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have time to meet, I would appreciate it, not sure how best to resolve this comment.

zjuradoq and others added 2 commits January 23, 2025 09:14
Minor changes to PR BuildACell#286 on BioCRNpyler master
These changes do not address the comment about representing the complexes and parameters differently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants