bridge process diagrams (for GitHub ⇄ bio.tools)#

General flow of the GitHub ⇄ bio.tools bridge#

This sequence diagram illustrates the high-level runtime flow of the GitHub ⇄ bio.tools bridge. It shows how user input is handled by the interface, routed through the central handler, and executed depending on the selected direction of the bridge.

        ---
config:
  theme: base
  look: neo
  themeVariables:
    darkMode: true
    background: "#121212"
    sequenceNumberColor: "#005a7a"
    actorBkg: "#005a7a"
    actorBorder: "#005a7a"
    actorLineColor: "#005a7a"
    activationBkgColor: "#1099c9"
    activationBorderColor: "#1099c9"
    labelBoxBorderColor: "#5DD3FC"
    loopTextColor: "#5DD3FC"
    labelTextColor: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
sequenceDiagram

    actor user
    participant interface
    participant bootstrap
    participant handler

    participant gh-composer as builder<br/>GitHub composer
    participant bt-composer as builder<br/>bio.tools composer
    participant gh-provider as service<br/> GitHubRepoProvider

    autonumber

    activate interface

    alt API usage
        user->>interface: bridge api
    else CLI usage
        user->>interface: bridge cli
    else Python package usage
        user->>interface: import bridge
    end

    activate bootstrap
    critical
        interface->>bootstrap: register_handler()<br/>{goal}
        bootstrap-->>interface: register handler for goal
        bootstrap-->>interface: wire app registry
    end
    deactivate bootstrap
    interface-->>interface: load config settings
    interface-->>interface: setup logging

    user->>interface: trigger handler
    activate handler

    alt GitHub → bio.tools
        interface-)handler: extract_meta_from_repo() <br/> {owner, repo, biotools_id?}
    else bio.tools → GitHub
        interface-)handler: create_pr_issues_from_meta() <br/> {biotools_id, owner, repo, allow_issues?}
    end

    activate gh-composer
    handler-)gh-composer: repo_composer() / compose_github_repo()<br/>{owner, repo}
    note over gh-composer: REF composing<br/>fetch GitHub repo metadata (GitHubIngestor)<br/>and transform (GitHubRepoTransformer) to GitHubRepoModel
    gh-composer-->>handler: GitHubRepoModel<br/>composed repo model
    deactivate gh-composer

    alt bio.tools id provided
        activate bt-composer
        handler-)bt-composer: metadata_composer() / compose_biotools_metadata()<br/>{identifier}
        note over bt-composer: REF composing<br/>fetch bio.tools metadata (BiotoolsIngestor)<br/>and transform (BiotoolsToolTransformer) to BiotoolsToolModel
        bt-composer-->>handler: BiotoolsToolModel<br/>composed metadata model
        deactivate bt-composer
    end

    activate gh-provider
    handler->>gh-provider: <<create>> GitHubRepoProvider
    handler-)gh-provider: clone_context()
    gh-provider-->>handler: path to temp cloned repo

    alt GitHub → bio.tools

        note over handler: REF GitHub → bio.tools pipeline

        handler-->>handler: dump BiotoolsToolModel
        handler-->>interface: bio.tools json metadata
    else bio.tools → GitHub
        handler-)gh-provider: fork()

        note over handler: REF bio.tools → GitHub pipeline

        handler-)gh-provider: apply_changes_and_push()<br/>{file changes} (to the new branch in fork)
        handler-)gh-provider: create_pull_request()<br/>(to the head branch of OG repo)
        gh-provider-->>handler: PR metadata
        opt issues allowed
            loop every issue
                handler-)gh-provider: create_issue()<br/>(to the OG repo)
                gh-provider-->>handler: issue metadata
            end
        end
        handler-->>interface: metadata about created PR and issues
    end

    deactivate gh-provider
    deactivate handler

    deactivate interface

    

Composing models#

The sequence diagram below details the process of composing the metadata models from GitHub repositories and bio.tools entries.

        ---
config:
  theme: base
  look: neo
  themeVariables:
    darkMode: true
    background: "#121212"
    sequenceNumberColor: "#005a7a"
    actorBkg: "#005a7a"
    actorBorder: "#005a7a"
    actorLineColor: "#005a7a"
    activationBkgColor: "#1099c9"
    activationBorderColor: "#1099c9"
    labelBoxBorderColor: "#5DD3FC"
    loopTextColor: "#5DD3FC"
    labelTextColor: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
sequenceDiagram

    actor composer as builder<br/>composer

    participant ingestor as service<br/>Ingestor
    participant transformer as builder<br>Transformer
    participant model as core<br>Model

    autonumber

    activate ingestor
    composer->>ingestor: <<create>> Ingestor
    activate transformer
    composer->>transformer: <<create>> Transformer
    composer-)transformer: transform()<br/>{ingestor}
    transformer-)ingestor: fetch()
    ingestor-->>transformer: raw API data
    deactivate ingestor
    activate model
    transformer->>model: <<create>> Model<br/>(cast raw data)
    deactivate transformer
    deactivate model


    

GitHub → bio.tools pipeline#

The sequence diagram below details the pipeline for mapping GitHub repository to a bio.tools tool metadata.

        ---
config:
  theme: base
  look: neo
  themeVariables:
    darkMode: true
    background: "#121212"
    sequenceNumberColor: "#005a7a"
    actorBkg: "#005a7a"
    actorBorder: "#005a7a"
    actorLineColor: "#005a7a"
    activationBkgColor: "#1099c9"
    activationBorderColor: "#1099c9"
    labelBoxBorderColor: "#5DD3FC"
    loopTextColor: "#5DD3FC"
    labelTextColor: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
sequenceDiagram

    actor handler

    participant gh2bt as pipeline<br/>GitHub → bio.tools
    participant mapper as pipeline<br/>MapGitHub2BioTools
    participant map_item as pipeline<br/>MapItem
    participant model as core<br/>BiotoolsToolModel

    activate  gh2bt

    handler-)gh2bt: run()<br/>{repo_model, repo_path, existing_metadata?}
    activate mapper
    gh2bt->>mapper: <<create>> MapGitHub2BioTools

    loop every mappable metadata entry
        gh2bt-)mapper: call map function
        activate map_item
        mapper-)map_item: run()<br/>{bio.tools relevant fields, GitHub relevant fields}
        note over map_item: REF GitHub → bio.tools mapping
        map_item-->>gh2bt: mapped metadata entry
        deactivate map_item
    end

    activate model
    gh2bt->>model: <<create>> BiotoolsToolModel<br/>{mapped entries}
    gh2bt-->>handler: BiotoolsToolModel
    deactivate model
    deactivate mapper
    deactivate  gh2bt

    

GitHub → bio.tools mapping#

The flowcharts below detail the mapping of specific fields from GitHub to bio.tools.

Map description#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    subgraph GitHub entry
        gh_description[/GitHub description/]
        gh_readme[/GitHub README/]
    end
    subgraph bio.tools entry
        bt_description[/bio.tools description/]
    end
    conflict@{ shape: braces, label: "log conflict" }
    style conflict fill:#F47D22,stroke:#F47D22

    start --> gh_description & gh_readme & bt_description
    gh_description & gh_readme & bt_description --> gh_check{is GitHub description None?}

    gh_check -->|no| bt_not_check{is bio.tools description NOT None?}
    bt_not_check -->|yes| equal_check{are descriptions in GitHub and bio.tools equal?}
    equal_check -->|yes| nochange
    equal_check -->|no| conflict
    conflict --> return_gh(["return GitHub description"]):::success
    bt_not_check -->|no| return_gh

    gh_check -->|yes| bt_check{is bio.tools description None?}
    bt_check -->|no| nochange
    bt_check -->|yes| gh_readme_check{is GitHub README None?}
    gh_readme_check -->|yes| nochange
    gh_readme_check -->|no| prompt[prepare LLM prompt to generate a description based on README]
    prompt --> hf[[generate a description with HuggingFaceProvider API service]]
    hf --> success_check{does the generating succeed?}
    success_check -->|no| nochange
    success_check -->|yes| return_hf(["return generated description"]):::success
    
    

Map version#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    subgraph GitHub entry
        gh_version[/GitHub latest version tag/]
    end
    subgraph bio.tools entry
        bt_versions[/bio.tools versions/]
    end
    conflict@{ shape: braces, label: "log conflict" }
    style conflict fill:#F47D22,stroke:#F47D22

    start --> gh_version & bt_versions
    gh_version & bt_versions --> check_gh{is GitHub latest version tag None?}
    check_gh -->|no| check_bt{is bio.tools versions None or empty?}
    check_bt -->|yes| return_gh([return GitHub latest version tag]):::success
    check_bt -->|no| check_gh_in_bt{is GitHub latest version tag present in the bio.tools versions?}
    check_gh_in_bt -->|no| nochange
    check_gh_in_bt -->|yes| check_bt_newer{is any version in bio.tools versions newer than GitHub latest version tag?}
    check_bt_newer -->|yes| conflict
    conflict --> return_gh
    check_bt_newer -->|no| add[append GitHub latest version tag to bio.tools versions]
    add --> return_result([return combined result]):::success
    check_gh -->|yes| nochange
    

Map maturity#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    subgraph GitHub entry
        gh_archived[/GitHub archived/]
        gh_stargazers[/GitHub stargazers count/]
        gh_forks[/GitHub forks count/]
        gh_watchers[/GitHub watchers count/]
        gh_subscribers[/GitHub subscribers count/]
    end
    subgraph bio.tools entry
        bt_maturity[/bio.tools maturity/]
    end
    nochange([no change, exit]):::terminal
    nochange_legacy([no change, exit]):::terminal
    nochange_mature([no change, exit]):::terminal
    nochange_emerging([no change, exit]):::terminal
    conflict_legacy@{ shape: braces, label: "log conflict" }
    conflict_mature@{ shape: braces, label: "log conflict" }
    conflict_emerging@{ shape: braces, label: "log conflict" }
    style conflict_legacy fill:#F47D22,stroke:#F47D22
    style conflict_mature fill:#F47D22,stroke:#F47D22
    style conflict_emerging fill:#F47D22,stroke:#F47D22

    start --> gh_archived & gh_stargazers & gh_forks & gh_watchers & gh_subscribers & bt_maturity
    gh_archived & gh_stargazers & gh_forks & gh_watchers & gh_subscribers & bt_maturity --> check_gh{is GitHub entry None?}
    check_gh -->|yes| nochange
    check_gh -->|no| gh_archive_check{is GitHub archived None?}
    gh_archive_check -->|yes| gh_archive_false[GitHub archived = False]
    gh_archive_false --> gh_archive_bool_check{is GitHub archived True?}
    gh_archive_check -->|no| gh_archive_bool_check
    gh_archive_bool_check -->|yes| bt_check_legacy{is bio.tools maturity NOT None AND equal to Legacy?}
    subgraph mapping when archived on GitHub
        bt_check_legacy -->|yes| nochange_legacy
        bt_check_legacy -->|no| bt_check1{is bio.tools maturity NOT None?}
        bt_check1 -->|no| return_legacy([return Legacy]):::success
        bt_check1 -->|yes| conflict_legacy
        conflict_legacy --> return_legacy
    end

    gh_archive_bool_check -->|no| ints_check{"are any of the GitHub counts (stargazers, forks, watchers, subscribers) None?"}
    ints_check -->|yes| assign_zeros[assign 0 to None counts]
    assign_zeros --> score["score = log1p(stargazers) + log1p(forks) + log1p(watchers) + log1p(subscribers)"]
    ints_check -->|no| score
    score --> score_check{is score > 3?}

    score_check -->|yes| bt_check_mature{is bio.tools maturity NOT None AND equal to Mature?}
    subgraph bigscore[mapping when score > threshold]
        bt_check_mature -->|yes| nochange_mature
        bt_check_mature -->|no| bt_check2{is bio.tools maturity NOT None?}
        bt_check2 -->|no| return_mature([return Mature]):::success
        bt_check2 -->|yes| conflict_mature
        conflict_mature --> return_mature
    end

    score_check -->|no| bt_check_emerging{is bio.tools maturity NOT None AND equal to Emerging?}
    subgraph smallscore[mapping when score <= threshold]
        bt_check_emerging -->|yes| nochange_emerging
        bt_check_emerging -->|no| bt_check3{is bio.tools maturity NOT None?}
        bt_check3 -->|no| return_emerging([return Emerging]):::success
        bt_check3 -->|yes| conflict_emerging
        conflict_emerging --> return_emerging
    end

    

Map publications#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    subgraph GitHub entry
        gh_cff[/"GitHub CITATION.cff file (parsed to dict)"/]
    end
    subgraph bio.tools entry
        bt_pubs[/bio.tools publications/]
    end

    start --> gh_cff & bt_pubs
    gh_cff & bt_pubs --> gh_check{"is GitHub CITATION.cff dict falsy/empty?"}
    gh_check -->|yes| nochange
    gh_check -->|no| extract[["extract publications from cff file"]]
    extract --> refs[/publications from cff/] & preferred[/preferred publication from cff/]
    refs & preferred --> start_empty[start with an empty list of publications]
    start_empty --> check_preferred{"is the preferred publication from cff NOT empty/None?"}
    check_preferred -->|yes| cast_preferred[[cast preferred publication to a bio.tools Primary publication]]
    cast_preferred --> add_preferred[append cast preferred publication to the publications list]
    check_preferred -->|no| cast_all[[cast publications from cff file to bio.tools publications]]
    add_preferred --> cast_all
    cast_all --> add_all[append cast publications to the publications list]
    add_all --> clean["remove any invalid (None) or empty publications from the publications list"]
    clean --> list_check{is the publications list empty?}
    list_check -->|yes| nochange
    list_check -->|no| combine["combine the publications with bio.tools publications (if any)"]
    combine --> deduplicate[deduplicate combined publications]
    deduplicate --> return([return combined publications]):::success

    

Map documentation#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    subgraph GitHub entry
        gh_url[/GitHub html url/]
        gh_has_wiki[/GitHub has wiki enabled/]
        gh_coc[/GitHub code of conduct/]
        gh_pages[/GitHub pages/]
    end
    subgraph bio.tools entry
        bt_docs[/bio.tools documentations/]
    end

    start --> gh_url & gh_has_wiki & gh_coc & gh_pages & bt_docs
    gh_url & gh_has_wiki & gh_coc & gh_pages & bt_docs --> check_gh_entry{is GitHub entry None?}
    check_gh_entry -->|yes| nochange

    check_gh_entry -->|no| check_wiki_exists[[check the existense of GitHub wiki repository and build its URL]]
    subgraph map wiki
        check_wiki_exists --> check_wiki{is wiki enabled on GitHub AND does wiki repo exist?}
        check_wiki -->|yes| check_wiki_in_bt{is wiki URL already included in bio.tools documentations?}
        check_wiki_in_bt -->|no| add_wiki[add wiki URL to the bio.tools documentations, assign type General]:::success
    end
    add_wiki --> coc_check{is code of conduct configured on GitHub and has a URL?}
    check_wiki_in_bt -->|yes| coc_check
    check_wiki -->|no| coc_check
    subgraph map code of conduct
        coc_check -->|yes| check_coc_in_bt{is code of conduct URL already included in bio.tools documentations?}
        check_coc_in_bt --> |no| add_coc[add code of conduct URL to the bio.tools documentations, assign type Code of conduct]:::success
    end
    add_coc --> pages_check{is cGitHub pages configured on GitHub and has a URL?}
    check_coc_in_bt --> |yes| pages_check
    coc_check -->|no| pages_check
    subgraph map GitHub pages
        pages_check -->|yes| check_pages_in_bt{is GitHub pages URL already included in bio.tools documentations?}
        check_pages_in_bt -->|no| add_pages[add GitHub pages URL to the bio.tools documentations, assign type General]:::success
    end
    add_pages --> return([return updated bio.tools documentations]):::success
    check_pages_in_bt -->|yes| return
    pages_check -->|no| return
    

Map biotools ID#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    subgraph GitHub entry
        gh_name[/GitHub repo name/]
    end
    subgraph bio.tools entry
        bt_id[/bio.tools ID/]
    end
    conflict_name@{ shape: braces, label: "log conflict" }
    conflict_exist@{ shape: braces, label: "log conflict" }
    style conflict_name fill:#F47D22,stroke:#F47D22
    style conflict_exist fill:#F47D22,stroke:#F47D22

    start --> gh_name & bt_id
    gh_name & bt_id --> gh_check{is GitHub repo name None?}
    gh_check -->|yes| nochange
    gh_check -->|no| bt_contain_check{"is bio.tools ID NOT None AND bio.tools ID and GitHub name contain each other (one is a substring on another)?"}
    bt_contain_check -->|yes| nochange
    bt_contain_check -->|no| bt_not_contain_check{"is bio.tools ID NOT None AND bio.tools ID and GitHub name do NOT contain each other?"}
    bt_not_contain_check -->|yes| confliconflict_namect
    bt_not_contain_check -->|no| check_gh_in_bt[["check if the GitHub repo name already taken as a bio.tools ID (check bio.tools for existence)"]]
    conflict_name --> check_gh_in_bt
    check_gh_in_bt --> check_gh_taken{is GitHub repo name taken?}
    check_gh_taken -->|no| return_gh([return GitHub repo name]):::success
    check_gh_taken -->|yes| conflict_exist
    conflict_exist --> loop["for each number (suffix) from 1 to 99"]
    subgraph generate unique ID
        loop --> new_candidate["create a new cadidate ID by adding suffix to the GitHub name"]
        new_candidate --> check_candidaate_in_bt[["check if the candidate ID already taken as a bio.tools ID"]]
        check_candidaate_in_bt -->|yes| check_candidate_taken{is candidate ID taken?}
        check_candidate_taken -->|yes| check_all_nr{checked all suffixes?}
        check_all_nr -->|no| loop
    end
    check_all_nr -->|yes| return_candidate([return candidate ID]):::success
    check_candidate_taken -->|no| nochange

    

Map name#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    subgraph GitHub entry
        gh_name[/GitHub name/]
    end
    subgraph bio.tools entry
        bt_name[/bio.tools name/]
    end

    start --> gh_name & bt_name
    gh_name & bt_name --> check_gh{is GitHub name None?}
    check_gh -->|yes| nochange
    check_gh -->|no| policy[["REF Policy: GitHub name over bio.tools name (but check equality by seeing if one string is a substring of another)"]]:::ref
    policy --> return_resolved([return resolved]):::success
    

Map homepage#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    subgraph GitHub entry
        gh_homepage[/GitHub homepage/]
        gh_url[/GitHub html url/]
    end
    subgraph bio.tools entry
        bt_homepage[/bio.tools homepage/]
    end

    start --> gh_homepage & gh_url & bt_homepage
    gh_homepage & gh_url & bt_homepage --> check_gh_bt_homepage{are GitHub homepage AND bio.tools homepage None?}

    check_gh_bt_homepage -->|yes| check_gh_url{is GitHub html url None?}
    check_gh_url -->|no| return_gh_url([return GitHub html url]):::success
    check_gh_url -->|yes| nochange

    check_gh_bt_homepage -->|no| check_gh_homepage{is GitHub homepage None?}
    check_gh_homepage -->|yes| nochange
    check_gh_homepage -->|no| policy[[REF Policy: GitHub homepage over bio.tools homepage]]:::ref
    policy --> return_resolved([return resolved]):::success

    

Map language#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    subgraph GitHub entry
        gh_languages[/GitHub languages/]
    end
    subgraph bio.tools entry
        bt_languages[/bio.tools languages/]
    end

    start --> gh_languages & bt_languages
    gh_languages & bt_languages --> check_gh{is GitHub languages None or empty?}
    check_gh -->|yes| nochange
    check_gh -->|no| policy[[REF Policy: GitHub languages over bio.tools languages]]:::ref
    policy --> return_resolved([return resolved]):::success

    

Map license#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    subgraph GitHub entry
        gh_license[/GitHub license SPDX ID/]
    end
    subgraph bio.tools entry
        bt_license[/bio.tools license/]
    end

    start --> gh_license & bt_license
    gh_license & bt_license --> check_gh{is GitHub license SPDX ID None?}
    check_gh -->|yes| nochange
    check_gh -->|no| policy[[REF Policy: GitHub license over bio.tools license]]:::ref
    policy --> return_resolved([return resolved]):::success

    

Policy: GitHub over bio.tools#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    lineColor: "#fff"
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no change, exit]):::terminal
    gh[/GitHub entry/]
    bt[/bio.tools entry/]
    return([return cast entry]):::success
    conflict@{ shape: braces, label: "log conflict" }
    style conflict fill:#F47D22,stroke:#F47D22

    start --> gh & bt
    gh & bt --> gh_check{is GitHub entry None?}
    gh_check -->|yes| nochange
    gh_check -->|no| build[[cast GitHub entry as bio.tools]]
    build --> check_cast{is cast entry None / cast unsuccessful?}
    check_cast -->|yes| nochange
    check_cast -->|no| bt_check{is bio.tools entry None?}
    bt_check -->|yes| return
    bt_check -->|no| equal_check{are entries in GitHub and bio.tools equal?}
    equal_check -->|yes| nochange
    equal_check -->|no| conflict
    conflict --> return
    
    

bio.tools → GitHub pipeline#

The sequence diagram below details the pipeline for mapping a bio.tools tool metadata to a GitHub repository in the form of a pull request and, optionally, issues.

        ---
config:
  theme: base
  look: neo
  themeVariables:
    darkMode: true
    background: "#121212"
    sequenceNumberColor: "#005a7a"
    actorBkg: "#005a7a"
    actorBorder: "#005a7a"
    actorLineColor: "#005a7a"
    activationBkgColor: "#1099c9"
    activationBorderColor: "#1099c9"
    labelBoxBorderColor: "#5DD3FC"
    loopTextColor: "#5DD3FC"
    labelTextColor: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
sequenceDiagram

    actor handler

    participant bt2gh as pipeline<br/>bio.tools → GitHub
    participant mapper as MapBioTools2GitHub
    participant map_destination as MapDestination
    participant map_item as MapItem

    activate  bt2gh

    handler-)bt2gh: run()<br/>{repo_model, repo_path, metadata_model}
    activate mapper
    bt2gh->>mapper: <<create>> MapBioTools2GitHub
    activate map_destination
    bt2gh->>map_destination: <<create>> MapDestination<br/>(differentiates issues/PR in MapBioTools2GitHub)
    bt2gh-)map_destination: get issues in MapBioTools2GitHub

    loop every issue
        bt2gh-)mapper: call map function
        activate map_item
        mapper-)map_item: run()<br/>{bio.tools relevant fields, GitHub relevant fields}
        note over map_item: REF perform bio.tools → GitHub mapping for issues
        map_item-->>bt2gh: new issue info (if needed)
        deactivate map_item
    end

    bt2gh-)map_destination: get file_changes (for PR) in MapBioTools2GitHub

    loop every file change
        bt2gh-)mapper: call map function
        activate map_item
        mapper-)map_item: run()<br/>{bio.tools relevant fields, GitHub relevant fields}
        note over map_item: REF perform bio.tools → GitHub mapping for file changes
        map_item-->>bt2gh: new/changed file info (if needed)
        deactivate map_item
    end

    bt2gh-->>handler: new issues info, file changes info
    deactivate map_destination
    deactivate mapper
    deactivate  bt2gh


    

bio.tools → GitHub mapping for issues#

The flowcharts below detail the mapping of specific fields from bio.tools to GitHub in the form of issues.

Map description#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no issue, exit]):::terminal
    subgraph GitHub entry
        gh_description[/GitHub description/]
    end
    subgraph bio.tools entry
        bt_description[/bio.tools description/]
    end

    start --> gh_description & bt_description
    gh_description & bt_description --> policy[[REF Policy: bio.tools description over GitHub description]]:::ref
    policy --> policy_check{does the policy decide to create an issue?}
    policy_check -->|no| nochange
    policy_check -->|yes| issue[create issue info: suggesting to add description from bio.tools metadata]
    issue --> return([return issue info]):::success

    

Map homepage#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no issue, exit]):::terminal
    subgraph GitHub entry
        gh_homepage[/GitHub homepage/]
        gh_url[/GitHub html url/]
    end
    subgraph bio.tools entry
        bt_homepage[/bio.tools homepage/]
    end

    start --> gh_homepage & bt_homepage & gh_url
    gh_homepage & bt_homepage & gh_url --> check_equal_url{"are bio.tools homepage and GitHub html url equal AND both NOT None?"}
    check_equal_url -->|yes| nochange
    check_equal_url -->|no| policy[[REF Policy: bio.tools homepage over GitHub homepage]]:::ref
    policy --> policy_check{does the policy decide to create an issue?}
    policy_check -->|no| nochange
    policy_check -->|yes| issue[create issue info: suggesting to add homepage from bio.tools metadata]
    issue --> return([return issue info]):::success

    

Map topics#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no issue, exit]):::terminal
    subgraph GitHub entry
        gh_topics[/GitHub topics/]
    end
    subgraph bio.tools entry
        bt_topics[/bio.tools topics/]
        bt_functions[/bio.tools functions/]
    end

    start --> gh_topics & bt_topics & bt_functions
    gh_topics & bt_topics & bt_functions --> check_bt{"is bio.tools entry None?"}
    check_bt -->|yes| nochange
    check_bt -->|no| bt_none_checks{"are any of the bio.tools components (topics, functions) None?"}
    bt_none_checks -->|yes| assign_empty[assign empty lists to None components]
    assign_empty --> flatten_functions[[flatten bio.tools functions to EDAM terms list of functions]]
    bt_none_checks -->|no| flatten_functions
    flatten_functions --> combine[[combine and deduplicate the bio.tools EDAM terms lists of functions and topics]]
    combine -->|no| policy[[REF Policy: bio.tools EDAM terms on top of GitHub topics]]:::ref
    policy --> policy_check{does the policy decide to create an issue?}
    policy_check -->|no| nochange
    policy_check -->|yes| issue[create issue info: suggesting to add EDAM annotations from bio.tools metadata]
    issue --> return([return issue info]):::success

    

Map version#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no issue, exit]):::terminal
    subgraph GitHub entry
        gh_version[/GitHub latest version tag/]
    end
    subgraph bio.tools entry
        bt_versions[/bio.tools versions/]
    end
    conflict_newer@{ shape: braces, label: "log conflict" }
    conflict_exist@{ shape: braces, label: "log conflict" }
    style conflict_newer fill:#F47D22,stroke:#F47D22
    style conflict_exist fill:#F47D22,stroke:#F47D22

    start --> gh_version & bt_versions
    gh_version & bt_versions --> check_bt{is bio.tools versions empty or None?}
    check_bt -->|yes| nochange
    check_bt -->|no| find_latest_bt[[find the latest bio.tools version]]
    find_latest_bt --> check_latest_bt{is the latest bio.tools version None?}
    check_latest_bt -->|yes| nochange
    check_latest_bt -->|no| check_latest_gh{is GitHub latest version tag None?}
    check_latest_gh -->|yes| conflict_exist
    conflict_exist --> issue_no_rel["create issue info: suggesting to create a first release to match bio.tools (latest) release"]
    issue_no_rel --> return([return issue info]):::success
    check_latest_gh -->|no| check_newer{are any of the bio.tools versions newer than GitHub latest version?}
    check_newer -->|no| nochange
    check_newer -->|yes| conflict_newer
    conflict_newer --> issue_newer["create issue info: suggesting to create a new release to match bio.tools (latest) release"]
    issue_newer --> return

    

bio.tools → GitHub mapping for pull requests#

The flowcharts below detail the mapping of specific fields from bio.tools to GitHub in the form of pull requests.

Map name#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no issue, exit]):::terminal
    subgraph GitHub entry
        gh_name[/GitHub name/]
    end
    subgraph bio.tools entry
        bt_name[/bio.tools name/]
        bt_id[/bio.tools ID/]
    end

    start --> gh_name & bt_name & bt_id
    gh_name & bt_name & bt_id --> check_bt{is bio.tools entry None?}
    check_bt -->|yes| nochange
    check_bt -->|no| policy[["REF Policy: bio.tools ID over GitHub name but check equality by seeing if one string is a substring of another for GitHub name and bio.tools ID, for GitHub name and bio.tools name)"]]:::ref
    policy --> policy_check{does the policy decide to create an issue?}
    policy_check -->|no| nochange
    policy_check -->|yes| issue[create issue info: suggesting to update repository name from bio.tools metadata]
    issue --> return([return issue info]):::success

    

Map license#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no PR, exit]):::terminal
    subgraph GitHub entry
        gh_license[/GitHub license/]
    end
    subgraph bio.tools entry
        bt_license[/bio.tools license/]
    end

    start --> gh_license & bt_license
    gh_license & bt_license --> check_cast{can GitHub license SPDX ID be cast as bio.tools license?}
    check_cast -->|yes| cast[[cast GitHub license SPDX ID as as bio.tools license]]
    check_cast -->|no| nocast[cast GitHub license SPDX ID as None]
    cast & nocast --> policy[["REF Policy: bio.tools license over (cast) GitHub license"]]:::ref
    policy --> policy_check{does the policy decide to create a PR?}
    policy_check -->|no| nochange
    policy_check -->|yes| composing[["REF composing<br/>fetch license metadata (SPDXLicenseIngestor) and transform (SPDXLicenseTransformer) to SPDXLicense"]]:::ref
    composing --> compose_ok{is composing successful?}
    compose_ok -->|no| nochange
    compose_ok -->|yes| spdxlicense[/SPDX license metadata from bio.tools license SPDX ID/]
    spdxlicense --> fulltxt[get full text from the SPDX license]
    fulltxt --> pr[create PR info: use full text as content of LICENSE.txt]
    pr --> return([return PR info]):::success

    

Map citation#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no PR, exit]):::terminal
    subgraph GitHub entry
        gh_cff[/"GitHub CITATION.cff file (parsed to dict)"/]
    end
    subgraph bio.tools entry
        bt_pubs[/bio.tools publications/]
        bt_basic[/"bio.tools basic metadata (name, id, homepage, license, topics, description)"/]
    end

    start --> gh_cff & bt_pubs & bt_basic
    gh_cff & bt_pubs & bt_basic --> gh_check{"is GitHub CITATION.cff dict falsy/empty?"}
    gh_check -->|no| extract[["extract publications from cff file"]]
    extract --> refs[/publications from cff/] & preferred[/preferred publication from cff/]
    refs & preferred --> start_empty["start with an empty (extracted) bio.tools lists: publications and primary publications"]
    start_empty --> loop["For each bio.tools publication (repeat for every item)"]
    
    subgraph loop through bio.tools publications
        loop --> composing[["REF composing<br/>fetch publication metadata (EuropePMCIngestor) and transform (EuropePMCTransformer) to Publication"]]:::ref
        composing --> compose_ok{is composing successful?}
        compose_ok -->|no| check_done_loop{checked all bio.tools publications?}
        compose_ok -->|yes| is_preferred{is the bio.tools publication Primary?} 
        is_preferred -->|no| add[append extracted publication to the publications list]
        add --> check_done_loop
        check_done_loop -->|no| loop
        is_preferred -->|yes| add_preferred[append extracted publication to the primary publications list]
        add_preferred --> add
    end

    check_done_loop -->|yes| combine[["combine and deduplicate the list of (extracted) bio.tools publications and the list of GitHub publications from cff"]]

    combine --> compose_base[["compose base top-level cff content from basic bio.tools metadata"]]
    compose_base --> keep_existing["keep existing non-empty values from cff"]
    subgraph  merge base top-level content with existing cff:   
        keep_existing --> fill_missing[fill missing/empty values using bio.tools base fields]
        fill_missing --> remove_refs[remove references + preferred-citation for now]
    end

    remove_refs --> check_preferred{is the preferred publication from cff file NOT None?}
    subgraph choose preferred publication
        check_preferred -->|yes| return_gh["choose preferred: the preferred publication from cff file (no change)"]
        check_preferred -->|no| check_bt_primary{"is the list (extracted) bio.tools primary publications empty?"}
        check_bt_primary -->|no| return_bt_primary["choose preferred: most recent publication from list of (extracted) bio.tools primary publications"]
        check_bt_primary -->|yes| check_bt{"is the list (extracted) bio.tools publications empty?"}
        check_bt -->|no| return_bt["choose preferred: most recent publication from list of (extracted) bio.tools publications"]
        check_bt -->|yes| return_none["choose preferred: None"]
    end

    return_gh & return_bt_primary & return_bt & return_none --> check_combined{"are there any publications (in the combined and deduplicated list)?"}
    check_combined -->|no| pr_base_top_lvl["create PR info: use merged top-level content as content of CITATION.cff"]
    pr_base_top_lvl --> return([return PR info]):::success
    subgraph combine top-level content and publications into a cff
        check_combined -->|yes| add_pubs["add publications to the references key in the merged top-level content"]
        add_pubs --> check_set_preferred{"is the chosen preferred publication NOT None?"}
        check_set_preferred -->|yes| add_preferred_pub["add chosen preferred publication to the preferred-citation key in the merged top-level content"]
    end
    add_preferred_pub --> pr_refs_citation["create PR info: use merged top-level content + references + preferred-citation as content of CITATION.cff"]
    pr_refs_citation --> return
    check_set_preferred -->|no| pr_refs["create PR info: use merged top-level content + references as content of CITATION.cff"]
    pr_refs --> return

    

Map readme#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef ref fill:#F47D22
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no PR, exit]):::terminal
    subgraph GitHub entry
        gh_readme[/"GitHub README content"/]
    end
    subgraph bio.tools entry
        bt_name[/bio.tools name/]
        bt_id[/bio.tools id/]
        bt_tt[/bio.tools tool types/]
    end

    start --> gh_readme & bt_name & bt_tt

    gh_readme & bt_name & bt_tt --> bridge_badge[["create a badge for bridge (this tool)"]]
    subgraph extract and create badges
        bridge_badge --> bt_badge[["create a badge for the bio.tools id"]]
        bt_badge --> check_tt{"is bio.tools tool types list empty/None?"}
        check_tt -->|no| tt_badge[["create a badge for tool types"]]
        tt_badge --> extract_badges[["extract existing badged from GitHub README content"]]
        check_tt -->|yes| extract_badges
        extract_badges --> merge_badges[[combine and deduplicate existing and new badges]]
    end

    merge_badges --> try_title[[try to extract project title from GitHub README]]
    subgraph extract project title
        try_title --> title_found{has an existing title been found?}
        title_found -->|yes| use_title[use existing title]
        title_found -->|no| bt_title[use bio.tools name as a title]
    end

    use_title & bt_title --> content[["extract remaining content of GitHub README (without title and badges)"]]
    subgraph extract content
        content
    end

    content --> render[["Render the final README using a template:<br/>project title<br/>badges<br/>remaining original content"]]
    render --> diff{is the rendered README content different from GitHub README?}
    diff -->|no| nochange
    diff -->|yes| pr["create PR info: use rendered README as content of README.md"]
    pr --> return([return PR info]):::success

    

Policy: bio.tools over GitHub#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no issue or PR, exit]):::terminal
    gh[/GitHub entry/]
    bt[/bio.tools entry/]
    conflict@{ shape: braces, label: "log conflict" }
    style conflict fill:#F47D22,stroke:#F47D22

    start --> gh & bt
    gh & bt --> bt_check{is bio.tools entry None?}
    bt_check -->|yes| nochange
    bt_check -->|no| gh_check{is GitHub entry NOT None?}
    gh_check -->|yes| equal_check{are entries in GitHub and bio.tools equal?}
    equal_check -->|yes| nochange
    equal_check -->|no| conflict
    conflict --> return([create issue or PR]):::success
    gh_check -->|no| return

    

Policy: bio.tools on top of GitHub#

        ---
config:
  theme: base
  look: neo
  layout: elk
  elk:
    nodePlacementStrategy: NETWORK_SIMPLEX
  themeVariables:
    darkMode: true
    background: "#121212"
    primaryColor: "#005a7a"
    primaryBorderColor: "#121212"
    secondaryBorderColor:  "#121212"
    edgeLabelBackground: transparent
    labelTextColor: "#5DD3FC"
    clusterBkg: transparent
    clusterBorder: "#5DD3FC"
    noteBkgColor: "#F47D22"
    noteBorderColor: "#F47D22"
    noteTextColor: "#fff"
---
flowchart LR
    classDef notestyle fill:#F47D22
    classDef notestyle stroke:#F47D22
    classDef terminal fill:#1099c9
    classDef terminal stroke:#1099c9
    classDef success fill:#299967
    classDef success stroke:#299967

    start([start]):::terminal
    nochange([no issue or PR, exit]):::terminal
    gh[/GitHub entry/]
    bt[/bio.tools entry/]

    start --> gh & bt
    gh & bt --> bt_check{is bio.tools entry None?}
    bt_check -->|yes| nochange
    bt_check -->|no| gh_check{is GitHub entry None?}
    gh_check -->|yes| return([create issue or PR]):::success
    gh_check -->|no| diff["identify elements in GitHub entry that are missing in bio.tools entry (set difference)"]
    diff --> check_diff{is the set difference empty?}
    check_diff -->|yes| nochange
    check_diff -->|no| return