gwforg / gwf

A flexible, pragmatic workflow tool.
https://gwf.app/
GNU General Public License v3.0
31 stars 12 forks source link

Added target group #414

Closed jakobjn closed 1 month ago

jakobjn commented 2 months ago

Added group attribute to Target and AnonymousTarget classes. The group attribute of AnonymousTarget defaults to the template function name.

The feature is useful for visualizing compact dependency graphs and has been tested on the example workflows in addition to an in-house workflow under development.

The post initiation assignment of the group attribute could potentially be removed or enhanced.

Tests on example workflows

  1. examples/minimal-workflow

    {
    'SayHello': {'group': None},
    'World': {'group': None},
    'Universe': {'group': None},
    'All': {'group': None}
    }
  2. examples/minimal-workflow-explicit-options

    {
    'SayHello': {'group': None},
    'World': {'group': None},
    'Universe': {'group': None},
    'All': {'group': None}
    }
  3. examples/named-inputs-outputs

    {
    'Producer': {'group': None},
    'Consumer1': {'group': None},
    'Consumer2': {'group': None}
    }
  4. examples/readmapping

    {
    'UnzipGenome': {'group': 'unzip'},
    'IndexGenome': {'group': 'bwa_index'},
    'MapReads': {'group': 'bwa_map'}
    }
  5. examples/simple-workflow

    {
    'Target1': {'group': None},
    'Target2': {'group': None}
    }
  6. examples/using-map

    {
    'filter_chromosomes_0': {'group': 'filter_chromosomes'},
    'filter_chromosomes_1': {'group': 'filter_chromosomes'},
    'filter_chromosomes_2': {'group': 'filter_chromosomes'},
    'compute_stats_0': {'group': 'compute_stats'},
    'compute_stats_1': {'group': 'compute_stats'},
    'compute_stats_2': {'group': 'compute_stats'},
    'sum_counts': {'group': 'sum_ts'},
    'compute_avg_len_0': {'group': 'compute_avg_len'},
    'compute_avg_len_1': {'group': 'compute_avg_len'},
    'compute_avg_len_2': {'group': 'compute_avg_len'}
    }
dansondergaard commented 1 month ago

Nice one, thanks!