Skip to content

Commit

Permalink
Merge pull request #4881 from nomadscientist/header_example_history
Browse files Browse the repository at this point in the history
GTN Header - Adding a Answer Key Histories drop-down menu
  • Loading branch information
hexylena authored May 13, 2024
2 parents 2534da7 + 740a40e commit 48d0f4f
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 3 deletions.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ icon-tag:
galaxy-gear: fas fa-cog
galaxy-history: fas fa-columns
galaxy-history-archive: fas fa-archive
galaxy-history-input: fas fa-sign-in-alt
galaxy-history-answer: fas fa-sign-out-alt
galaxy-home: fas fa-home
galaxy-info: fas fa-info-circle
galaxy-lab: fa fa-tv
Expand Down
21 changes: 21 additions & 0 deletions _includes/resource-answer-histories.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% if include.material.answer_histories %}
<a href="#" class="btn btn-default dropdown-toggle topic-icon" data-toggle="dropdown" aria-expanded="false" title="Answer Histories">
{% icon galaxy-history-answer %}{% if include.label %}&nbsp;Answer Histories{% endif %}
</a>
<ul class="dropdown-menu">
{% for key in include.material.answer_histories %}
<li>
<a class="dropdown-item" href="{{ key.history }}">
{{ key.label }}
{% if key.date %}
<br/><span class="text-muted">{{ key.date }}</span>
{% endif %}
</a>
</li>
{% endfor %}
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item" href="{{ site.baseurl }}/faqs/gtn/gtn_example_histories.html">{% icon help %} How to Use This</a>
</li>
</ul>
{% endif %}
21 changes: 21 additions & 0 deletions _includes/resource-input-histories.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% if include.material.input_histories %}
<a href="#" class="btn btn-default dropdown-toggle topic-icon" data-toggle="dropdown" aria-expanded="false" title="Input Histories">
{% icon galaxy-history-input %}{% if include.label %}&nbsp;Input Histories{% endif %}
</a>
<ul class="dropdown-menu">
{% for key in include.material.input_histories %}
<li>
<a class="dropdown-item" href="{{ key.history }}">
{{ key.label }}
{% if key.date %}
<br/><span class="text-muted">{{ key.date }}</span>
{% endif %}
</a>
</li>
{% endfor %}
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item" href="{{ site.baseurl }}/faqs/gtn/gtn_example_histories.html">{% icon help %} How to Use This</a>
</li>
</ul>
{% endif %}
8 changes: 8 additions & 0 deletions _layouts/tutorial_hands_on.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ <h4 class="alert-heading">Under Development!</h4>
<li class="btn btn-default supporting_material">{% include _includes/resource-tours.html material=own_material topic=topic.name label=true %}</li>
{% endif %}

{% if own_material.input_histories %}
<li class="btn btn-default supporting_material">{% include _includes/resource-input-histories.html material=own_material topic=topic.name label=true %}</li>
{% endif %}

{% if own_material.answer_histories %}
<li class="btn btn-default supporting_material">{% include _includes/resource-answer-histories.html material=own_material topic=topic.name label=true %}</li>
{% endif %}

{% if own_material.notebook %}
<li class="btn btn-default supporting_material">{% include _includes/resource-notebooks.html material=own_material topic=topic.name label=true %}</li>
{% endif %}
Expand Down
29 changes: 28 additions & 1 deletion bin/schema-tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,31 @@ mapping:
link to the external tutorial
examples:
- "https://docs.qiime2.org/jupyterbooks/cancer-microbiome-intervention-tutorial/index.html#"

answer_histories:
type: seq
examples: |
- label: "UseGalaxy.eu"
history: https://humancellatlas.usegalaxy.eu/u/j.jakiela/h/generating-a-single-cell-matrix-using-alevin-3
- label: "Older Alevin version"
history: https://humancellatlas.usegalaxy.eu/u/wendi.bacon.training/h/cs1pre-processing-with-alevin---answer-key
sequence:
- type: map
mapping: &answer_histories
label:
type: str
required: true
history:
type: str
required: true
date:
type: date
pattern: /[0-9]{4,}-[0-9]{2}-[0-9]{2}/
input_histories:
type: seq
examples: |
input_histories:
- label: "UseGalaxy.eu"
history: https://humancellatlas.usegalaxy.eu/u/wendi.bacon.training/h/cs1pre-processing-with-alevin---input-1
sequence:
- type: map
mapping: *answer_histories
13 changes: 11 additions & 2 deletions bin/validate-frontmatter.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'date'
require 'yaml'
require 'find'
require 'pathname'
Expand All @@ -11,7 +12,11 @@
module SchemaValidator
# Schemas
@TOPIC_SCHEMA_UNSAFE = YAML.load_file('bin/schema-topic.yaml')
@TUTORIAL_SCHEMA_UNSAFE = YAML.load_file('bin/schema-tutorial.yaml')
begin
@TUTORIAL_SCHEMA_UNSAFE = YAML.load_file('bin/schema-tutorial.yaml', aliases: true)
rescue
@TUTORIAL_SCHEMA_UNSAFE = YAML.load_file('bin/schema-tutorial.yaml')
end
@SLIDES_SCHEMA_UNSAFE = YAML.load_file('bin/schema-slides.yaml')
@FAQ_SCHEMA_UNSAFE = YAML.load_file('bin/schema-faq.yaml')
@QUIZ_SCHEMA_UNSAFE = YAML.load_file('bin/schema-quiz.yaml')
Expand Down Expand Up @@ -104,7 +109,11 @@ def self.validate_requirements(requirements)

def self.lintable?(fn)
begin
data = YAML.load_file(fn)
begin
data = YAML.load_file(fn, permitted_classes:[Date])
rescue
data = YAML.load_file(fn)
end
rescue StandardError => e
return ["YAML error, failed to parse #{fn}, #{e}"]
end
Expand Down
25 changes: 25 additions & 0 deletions faqs/gtn/gtn_example_histories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Using Answer Key Histories
area: introduction
layout: faq
box_type: tip
contributors: [nomadscientist]
---

If you get stuck, you can first check your history against an exemplar history, from your tutorial.

First, import the target history.

{% snippet faqs/galaxy/histories_import.md %}

Next, compare the answer key history with your own history.

{% snippet faqs/galaxy/histories_side_by_side_view.md %}

You can compare there, or if you're really stuck, you can also click and drag a given dataset to your history to continue the tutorial from there.

{% snippet faqs/galaxy/histories_copy_dataset.md %}

You can also use our handy troubleshooting guide.

{% snippet faqs/galaxy/analysis_troubleshooting.md %}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,27 @@ The alternative is to figure out the ID for the tool you want to use:

![Finding the tool ID](../../images/tool-id.png)

## Example Histories

If you have example input histories for your tutorial, perhaps for specific servers where trainees will often follow a tutorial but want to skip a slow input step, then you can provide example histories as part of your tutorial.

> <code-in-title>Tutorial Frontmatter</code-in-title>
> ```yaml
> answer_histories:
> - label: "UseGalaxy.eu"
> history: https://humancellatlas.usegalaxy.eu/u/j.jakiela/h/generating-a-single-cell-matrix-using-alevin-3
> - label: "Older Alevin version"
> history: https://humancellatlas.usegalaxy.eu/u/wendi.bacon.training/h/cs1pre-processing-with-alevin---answer-key
> date: 2024-01-01
> input_histories:
> - label: "UseGalaxy.eu"
> history: https://humancellatlas.usegalaxy.eu/u/wendi.bacon.training/h/cs1pre-processing-with-alevin---input-1
> ```
{: .code-in}
> <code-out-title>Rendered Tutorial</code-out-title>
> ![a screenshot of the GTN metadata box showing a dropdown for input histories and answer histories. The answer histories features two examples one on UseGalaxy.eu and an older alevin one, each with a date. In the dropdown is also a link to an FAQ titled how to use this](images/example-histories.png)
{: .code-out}
## Workflows
Expand Down
12 changes: 12 additions & 0 deletions topics/single-cell/tutorials/scrna-case_alevin/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ redirect_from:
questions:
- I have some single cell FASTQ files I want to analyse. Where do I start?

answer_histories:
- label: "UseGalaxy.eu"
history: https://humancellatlas.usegalaxy.eu/u/j.jakiela/h/generating-a-single-cell-matrix-using-alevin-3
date: 2024-05-01
- label: "Older Alevin version"
history: https://humancellatlas.usegalaxy.eu/u/wendi.bacon.training/h/cs1pre-processing-with-alevin---answer-key
date: 2024-01-01

input_histories:
- label: "UseGalaxy.eu"
history: https://humancellatlas.usegalaxy.eu/u/wendi.bacon.training/h/cs1pre-processing-with-alevin---input-1

objectives:
- Generate a cellxgene matrix for droplet-based single cell sequencing data
- Interpret quality control (QC) plots to make informed decisions on cell thresholds
Expand Down

0 comments on commit 48d0f4f

Please sign in to comment.