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

Add GoogleSheet import feature from field guide #4

Merged
merged 16 commits into from
May 2, 2024
Merged
1 change: 1 addition & 0 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ permissions:
id-token: write

jobs:

build:
runs-on: ubuntu-latest
steps:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/update_guides.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

name: Update guides

on:
workflow_dispatch:

jobs:

update_guides:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.8.16'

- name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: execute table conversion script
run: python scripts/guides_table_conversion.py

- name: Commit if updated
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git diff-index --quiet HEAD || git commit -m "update guides"

- name: Push if changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
69 changes: 42 additions & 27 deletions _data/tool_and_resource_list.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,67 @@
- id: genome-assembly-hifi
description:
This How-to-Guide describes the steps required to assemble your genome on the Galaxy Australia platform, using multiple workflows developed in consultation between the Bioplatforms Australia Threatened Species Initiative, Galaxy Australia, and the Australian BioCommons.
url: https://australianbiocommons.github.io/how-to-guides/genome_assembly/hifi_assembly
- description: This How-to-Guide describes the steps required to assemble your genome
on the Galaxy Australia platform, using multiple workflows developed in consultation
between the Bioplatforms Australia Threatened Species Initiative, Galaxy Australia,
and the Australian BioCommons.
id: genome-assembly-hifi
name: Genome assembly with `hifiasm` on Galaxy Australia
registry:
tess: genome assembly
wfh-collection: https://workflowhub.eu/collections/5
related_pages:
- genome_assembly
- id: genome-assembly-qc
description:
Once a genome has been assembled, it is important to assess the quality of the assembly, and in the first instance, this quality control (QC) can be achieved using the workflow described here.
url: https://australianbiocommons.github.io/how-to-guides/genome_assembly/assembly_qc
- genome_assembly
url: https://australianbiocommons.github.io/how-to-guides/genome_assembly/hifi_assembly
- description: Once a genome has been assembled, it is important to assess the quality
of the assembly, and in the first instance, this quality control (QC) can be achieved
using the workflow described here.
id: genome-assembly-qc
name: Assess the quality of your genome assembly
registry:
tess: genome assembly
wfh: https://workflowhub.eu/workflows/403
related_pages:
- genome_assembly
- id: how-to-create-guide
description:
This web page describes How-to create new How-to Guide websites using a GitHub repository template.
url: https://australianbiocommons.github.io/how-to-guide-template/
- genome_assembly
url: https://australianbiocommons.github.io/how-to-guides/genome_assembly/assembly_qc
- description: This web page describes How-to create new How-to Guide websites using
a GitHub repository template.
id: how-to-create-guide
name: How-to Guide for creating a How-to Guide
related_pages:
- documentation
registry:
doi: https://doi.org/10.5281/zenodo.8210268
template: https://github.com/AustralianBioCommons/guide-template
- id: doc-guidelines
description:
The Australian BioCommons has been working with community bioinformaticians and our infrastructure partners to establish a guidelines repository that can act as a template for documentation of tools and workflows.
url: https://australianbiocommons.github.io/how-to-doc-guidelines/
name: How-to use the Australian BioCommons documentation guidelines
related_pages:
- documentation
- documentation
url: https://australianbiocommons.github.io/how-to-guide-template/
- description: The Australian BioCommons has been working with community bioinformaticians
and our infrastructure partners to establish a guidelines repository that can
act as a template for documentation of tools and workflows.
id: doc-guidelines
name: How-to use the Australian BioCommons documentation guidelines
registry:
template: https://github.com/AustralianBioCommons/doc_guidelines
- id: stacks
description:
This How-to Guide describes the steps required to run the Stacks workflows on Galaxy Australia to analyse RADseq data, using workflows developed in consultations between the Bioplatforms Australia Threatened Species Initiative, Galaxy Australia, and the Australian BioCommons.
url: https://australianbiocommons.github.io/how-to-guides/stacks_workflows/stacks
related_pages:
- documentation
url: https://australianbiocommons.github.io/how-to-doc-guidelines/
- description: This How-to Guide describes the steps required to run the Stacks workflows
on Galaxy Australia to analyse RADseq data, using workflows developed in consultations
between the Bioplatforms Australia Threatened Species Initiative, Galaxy Australia,
and the Australian BioCommons.
id: stacks
name: Stacks workflows in Galaxy Australia using RADseq
registry:
biotools: stacks
tess: RAD seq
related_pages:
- pop_gen
- pop_gen
url: https://australianbiocommons.github.io/how-to-guides/stacks_workflows/stacks
- description: This How-to Guide describes how to use the shotgun metagenomics workflow
with MetaPhlAn2 on Galaxy Australia. The workflow is using the tools MetaPhlAn2
for taxonomy classification and HUMAnN2 for functional profiling of the metagenomes.
id: shotgun-metagenomics-metaphlanv2
name: Shotgun metagenomics workflow with MetaPhlAn2 on Galaxy Australia
registry: {}
related_pages:
- metagenomics
url: https://vmurigneu.github.io/shotgun_howto_ga_workflows/shotgun_wf_guide
- id: scrnaseq_howto_ga_workflows
description: This guide describes how to use some scanpy-based single cell RNAseq workflows on Galaxy Australia.
url: https://swbioinf.github.io/scrnaseq_howto_ga_workflows/scrnaseq_wf_guide
Expand Down
2 changes: 2 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ If you have an idea for a new How-to Guide, or a new category, please visit the

## Acknowledgements

The authors would like to acknowledge Marion Shadbolt (@mshadbolt) for developing the GoogleSheet import and parsing that is being reused for the How-to Hub.

This work is supported by the [Australian BioCommons](https://www.biocommons.org.au/) via funding from [Bioplatforms Australia](https://bioplatforms.com/), the Australian Research Data Commons (https://doi.org/10.47486/PL105) and the Queensland Government Research Infrastructure Co-investment Fund (RICF) programme. Bioplatforms Australia and the Australian Research Data Commons are funded by the National Collaborative Research Infrastructure Strategy (NCRIS).

This guide makes use of the [ELIXIR toolkit theme](https://github.com/ELIXIR-Belgium/elixir-toolkit-theme)
Expand Down
9 changes: 9 additions & 0 deletions pages/metagenomics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Metagenomics
type: category
page_id: metagenomics
description: How-to Guides focused on metagenomics.
---



6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pandas
requests
argparse
PyYAML
python-frontmatter
urllib3
47 changes: 47 additions & 0 deletions scripts/guides_table_conversion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
Adapted from https://github.com/elixir-europe/rdmkit/blob/master/var/conversions.py
Adapted from https://github.com/AustralianBioCommons/human-omics-data-sharing-field-guide/blob/328e84634d10b0df51e798dbf1cc114c7cb26357/var/tools_table_conversion.py
"""

import pandas as pd
import yaml
import os

# --------- Variables ---------

google_id = "1CWSW5CAg0f8e5XB9Bl80jiDT8QCWOWhuCxKjDWLi5a4"
gid = "0"
url = f"https://docs.google.com/spreadsheets/d/{google_id}/export?format=csv&gid={gid}"
output_path = "_data/tool_and_resource_list.yml"
rootdir = '../pages'
allowed_registries = ['biotools', 'fairsharing', 'tess', 'wfh-collection', 'wfh', 'doi', 'template']

# --------- Converting the table ---------

print(f"----> Converting GoogleSheets table to {output_path} started.")
resource_table = pd.read_csv(url, dtype={'name': str, 'url': str, 'description': str, 'id': str, 'fairsharing': str,
'biotools': str, 'tess': str, 'wfh-collection': str, 'wfh': str,
'doi': str, 'template': str, 'related_pages': str})
resource_list = resource_table.to_dict("records")
clean_resource_list = []
for resource in resource_list:
if not pd.isna(resource['related_pages']):
category_list = resource['related_pages'].rsplit(sep=",")
else:
category_list = ""
registry_dict = {}
for registry in allowed_registries:
if not pd.isna(resource[registry]):
registry_dict[registry] = resource[registry]
del(resource[registry])
clean_resource = {k: resource[k] for k in resource if not pd.isna(resource[k])}
clean_resource_list.append(clean_resource)
clean_resource['registry'] = registry_dict
if category_list != "":
clean_resource['related_pages'] = category_list

print(os.getcwd())
with open(output_path, 'w+') as yaml_file:
documents = yaml.dump(clean_resource_list, yaml_file)

print("----> YAML is dumped successfully")
Loading