Skip to content

Add Composite Check Functionality to SBOL Utilities #238

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

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

Conversation

vinayakjeet
Copy link

#69

Overview

This PR introduces a new helper function, is_composite, to the SBOL Utilities package, addressing the need for an efficient way to determine if an SBOL Component is a composite. This functionality was proposed to tackle issue #69, focusing on components that are of DNA type and linked to an assembly plan via the generated_by attribute.

Changes

  • is_composite Function: Determines whether an SBOL Component is a composite by checking for DNA type and assembly plan linkage.
  • Supporting Functions: Added has_dna_type and has_assembly_plan as helper functions to modularize the checks required for the is_composite function.

Justification

The need for a composite check function was identified as a part of enhancing the SBOL utilities package to support more nuanced checks for components within SBOL documents. The ability to identify composite components efficiently is crucial for developers working with synthetic biology data, facilitating more sophisticated data analysis and manipulation tasks.

Implementation Details

  • The has_dna_type function utilizes the tyto library to map component types to known DNA terms, ensuring that the component is of DNA type.
  • The has_assembly_plan function searches for the generated_by attribute in the component and verifies that any linked activities are marked with both http://sbols.org/v3#assemblyPlan and sbol:design types, adhering to SEP 054 specifications.
  • The is_composite function integrates these checks, offering a straightforward way to determine if a component meets the criteria for being considered a composite.

Future Work

While this PR addresses the immediate need for composite component identification, future enhancements could include:

  • Expanding the criteria for what constitutes a composite component based on evolving standards.
  • Optimizing performance for large SBOL documents through more efficient data structures or caching mechanisms.

Acknowledgements

Special thanks to contributors and reviewers who have offered insights and feedback throughout the development of this feature, especially those involved in the discussion of issue #69.

closes #69

Signed-off-by: Vinayakjeet Singh Karki <[email protected]>
@jakebeal
Copy link
Contributor

jakebeal commented Apr 7, 2024

Tests are failing, but currently only the two caused by #231, so the testing is sufficient to proceed to a full review.

Copy link
Contributor

@jakebeal jakebeal left a comment

Choose a reason for hiding this comment

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

A few minor adjustments are needed.
More importantly, a test needs to be added that will validate that this function behaves as expected.

Hi @jakebeal,  

I have implemented all requested changes:  

- **Removed** the unnecessary `hasattr(o, "generated_by")` check.  
- **Replaced** `'sbol:design'` with `sbol3.SBOL_DESIGN`.  
- **Added** a docstring to `is_composite()` for better documentation.  

Please review and let me know if any further modifications are needed. Thanks! 🚀
Hi @jakebeal,  

I have implemented all requested changes:  

- **Removed** the unnecessary `hasattr(o, "generated_by")` check.  
- **Replaced** `'sbol:design'` with `sbol3.SBOL_DESIGN`.  
- **Added** a docstring to `is_composite()` for better documentation.  

Please review and let me know if any further modifications are needed. Thanks! 🚀
@vinayakjeet
Copy link
Author

vinayakjeet commented Feb 10, 2025

Hi @jakebeal,

Implemented all requested changes:

  • Removed the unnecessary hasattr(o, "generated_by") check.
  • Replaced 'sbol:design' with sbol3.SBOL_DESIGN.
  • Added a docstring to is_composite()

Please review and let me know if any further modifications are needed. Thanks! 🚀

@vinayakjeet
Copy link
Author

vinayakjeet commented Feb 11, 2025

Added test cases for composite component checks. Please review and run.

@vinayakjeet
Copy link
Author

@Gonza10V @jakebeal Can you please run the changes in the PR. Thanks🚀

@vinayakjeet vinayakjeet requested a review from jakebeal March 19, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function to check if a part is a composite
2 participants