Skip to content

Make component retrieval automatic #145

Description

@ODiogoSilva

Right now, components are added to flowcraft by including a nextflow template file and a python class with the attributes of that component. Then, we have a dictionary that maps the template and the class. This is cumbersome to maintain, as the dictionary is getting quite large with the addition of new components and we could improve on this.

By using a similar system to the recipes (see https://github.com/assemblerflow/flowcraft/blob/recipes/flowcraft/generator/recipe.py#L647), we could automate the "loading" of components into flowcraft by searching for all classes in one or more submodules. We can also extend this search to other paths, which would allow users to add new components locally without having to push them to flowcraft.

For this, we would need to:

  • Create a loader function that gathers all classes in specified modules/paths
  • Add a new attribute (e.g. name) to each class, containing the same key as in the current dictionary mapping.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions