15. FAIR in Practice

Course: 5BI00A Computing for Data-Driven Biology · Umeå University
Slides: PDF
Exercises: See exercises/

This is a self-study exercise page, not a taught session. Work through Parts 1–4 at your own pace, following on from Lecture 14: FAIR and Open Science, where Jamie McCann introduced PlantGenIE live. Bring questions to office hours or post on the Canvas discussion board.


Hands-On Exercises in Interoperability and Reusability

Master’s Programme in Bioinformatics — Umeå University

Computing for Data-Driven Biology (5BI00A)


Session Aims

By the end of these exercises you should be able to:

  1. Run a BLAST search via a website, from the command line on HPC, and via an API (Application Programming Interface) — and explain when and why you would choose each
  2. Query a REST API from the command line and parse the response — demonstrating Interoperability in practice
  3. Explain how a well-designed API embodies the Interoperable and Reusable principles of FAIR
  4. Apply a structured metadata sufficiency checklist to a real GEO or ENA dataset
  5. Identify specific metadata fields whose absence would prevent reanalysis of a published RNA-seq study
  6. Assess the computational reproducibility of a published bioinformatics study using a structured framework
  7. (Optional preview, not covered in the taught session) Recognise what a minimal reproducible report (Jupyter notebook) looks like, ahead of writing Python and R properly in later courses
  8. Commit all exercise outputs, commands, and findings to Git

Links to course ILOs: These exercises directly address ILOs 1, 3, 7, 9, 12, and 13. They are the practical companion to Lecture 14 and provide direct preparation for the FAIR essay assessment. For background on BLAST itself, see the BLAST background reference.

PlantGenIE guest contribution: Jamie McCann, developer of PlantGenIE (plantgenie.se) at Umeå University, introduced the platform live in Lecture 14. Part 1 below puts that introduction into practice, working directly with the API he described.


Part 1 — Interoperability: Three Ways to Run BLAST

Background reading: If you have not used BLAST before, or want a refresher on what it does and how to interpret its output (E-values, bit scores, the BLOSUM matrix), read the BLAST background reference before starting this part. This part assumes you already know what BLAST is — it focuses on how, when, and why you would run it in each of three different ways.

1.1 The Same Search, Three Different Tools

Running a BLAST search is not just “go to the NCBI website.” The same search can be run through a web interface, from the command line against a local database, or programmatically via an API — and which one you should use depends entirely on the task.

Way How When to use it Why
Website NCBI BLAST web interface (or a resource’s own web BLAST, e.g. PlantGenIE’s) Exploring a single sequence interactively; sharing results with non-CLI collaborators No setup required; results viewer with alignments, taxonomy, and distance trees built in
Command line (local/HPC) BLAST+ installed on Kebnekaise, run against a local database copy via Slurm Large-scale or routine searches; integrating BLAST into a documented, reproducible pipeline No rate limits; fully scriptable; the script itself is your record of exactly what was run
API Submit a query and retrieve results programmatically over HTTP (EBI’s or NCBI’s BLAST API, or a resource’s own API such as PlantGenIE’s) Automating a small number of searches; integrating BLAST into another tool without a browser Demonstrates Interoperability directly — the same data a browser shows you, exposed through a documented, machine-readable interface

The exercises below walk through all three using the same query sequence, so you can compare the experience directly.

1.2 What is PlantGenIE?

PlantGenIE (plantgenie.se) is a bioinformatics resource for plant and tree genomics developed at Umeå University, with primary development by Jamie McCann and contributions from the research groups of Nathaniel Street and others at UPSC. It integrates genome browsers, gene expression and co-expression data, functional annotations, a BLAST search interface, and REST API endpoints exposing all of the above — for boreal forest tree species including Picea abies (Norway spruce) and Populus tremula (European aspen).

PlantGenIE is currently undergoing active redevelopment, including a new Picea abies genome assembly with a different gene identifier scheme than earlier versions. The base URL, endpoints, and example gene ID used in these exercises have been verified against the live API. If an endpoint has changed since, check the current API documentation (Section “Further Reading” below) or post on the Canvas discussion board.

The PlantGenIE codebase is publicly available on GitHub: https://github.com/plantgenie

1.3 Why PlantGenIE Demonstrates Interoperability

Recall from Lecture 14 that Interoperability requires: - Using standard formats and protocols - Using ontologies and controlled vocabularies for metadata - Providing cross-references to related databases - Making data accessible via documented, machine-readable interfaces

PlantGenIE’s REST API embodies each of these:

  • Standard protocol: HTTP/HTTPS — the same protocol your browser uses; any programming language or command-line tool can query it
  • Standard formats: Responses are returned as JSON (a widely used, machine-readable format) or FASTA (a standard bioinformatics format)
  • Ontology cross-references: Gene entries link to GO terms, InterPro domains, and NCBI taxonomy identifiers
  • Documentation: The API endpoints are documented, which means any researcher can query them programmatically without needing to contact the authors or navigate a specific web interface

Querying PlantGenIE from the command line — rather than through the web browser — is exactly what Interoperability enables. The same data that is presented visually in the browser is accessible programmatically, in a standard format, to any researcher or tool.

1.4 REST APIs: A Brief Technical Overview

A REST (Representational State Transfer) API is an interface to a web service that follows a set of conventions, allowing resources to be retrieved using standard HTTP methods and URLs.

The key concept is that each endpoint is a URL that returns a specific piece of data — for example, a gene-information endpoint, an expression-data endpoint, and a BLAST endpoint. You query these endpoints using curl or equivalent tools, and the response arrives as JSON or plain text. This is identical in structure to the NCBI and UniProt API calls you made in Lecture 11 — the same concept, a different resource.

GET vs. POST — the two HTTP methods you will use here:

  • GET requests ask a server to return something, with any parameters usually written directly into the URL (e.g. .../gene/Potra2n4c9093). This is what the NCBI and UniProt calls in Lecture 11 used, and what curl -s "${BASE}/v1/expression/available-experiments" below uses — no -X flag is needed because GET is curl’s default.
  • POST requests send data to the server as part of the request — normally used for creating or submitting something (e.g. uploading a file, submitting a form), but PlantGenIE also uses it here to ask for data, because the query itself is a structured object (a list of gene IDs, an experiment ID) that does not fit cleanly into a URL. You mark a POST request explicitly with curl -X POST, and supply the data with -d (as JSON, in PlantGenIE’s case).

Both are just conventions built on top of ordinary HTTP — the server ultimately decides what each endpoint does with a given method, which is why you always need to check the documentation for a specific API rather than assume.

JSON (JavaScript Object Notation) is the standard response format for most REST APIs, structured as key-value pairs, e.g. a gene ID, organism, description, and lists of GO/InterPro cross-references. You can parse JSON responses at the command line using jq (if available) or Python, or simply use grep for extracting specific fields.

PlantGenIE’s endpoints take a JSON request body via POST, unlike the simpler path-based GET requests used for NCBI and UniProt in Lecture 11 — a useful contrast in REST API design. The base URL and gene ID used below are confirmed working; if the API has changed since, check the current documentation or ask on the Canvas discussion board.

1.4 Hands-On: Querying the PlantGenIE API

Prerequisites: Login to Kebnekaise via OnDemand. Create a working directory and initialise Git.

mkdir -p ~/course/lecture15-fair-practice && cd ~/course/lecture15-fair-practice

# Neither git nor curl is on PATH by default on every Kebnekaise node -
# load both explicitly. They share the same GCCcore/14.3.0 toolchain, so
# loading them together here is safe; do NOT later load a *different*
# GCC/GCCcore version (e.g. for Exercise 1D's BLAST+) in this same
# terminal - Lmod silently deactivates git/curl when the toolchain
# changes underneath them, with no warning. Use a separate terminal tab
# for Exercise 1D instead (see that section).
module load GCCcore/14.3.0 git/2.50.1 cURL/8.14.1
git init
cat > README.md << 'EOF'
# Lecture 15: FAIR in Practice
## Exercises in Interoperability and Reusability
EOF
git add README.md
git commit -m "initial commit: lecture15 FAIR practical exercises"

# Exercises 1D and 1E need the TP53 protein sequence as a local file.
# This is the same accession fetched in Lecture 11, but re-fetch it here
# rather than relying on that lecture's separate working directory still
# being around - the same command as Lecture 11, Part B.
curl "https://rest.uniprot.org/uniprotkb/P04637.fasta" > TP53_protein.fasta

Exercise 1A — Retrieve gene information from PlantGenIE

Confirmed working against the live API — if it has since changed, check the current documentation or ask on the Canvas discussion board.

BASE="https://www.plantgenie.se/api"
SPECIES="populus-tremula"
GENE_ID="Potra2n18c32336"

# Retrieve annotation for a specific gene — note this is a POST with a JSON
# body, not a simple GET-by-path like the NCBI/UniProt calls in Lecture 11
curl -s -X POST "${BASE}/v1/annotations" \
  -H "Content-Type: application/json" \
  -d "{\"species\": \"${SPECIES}\", \"geneIds\": [\"${GENE_ID}\"]}" \
  > gene_info.json

# Inspect the JSON response
cat gene_info.json

Questions to answer in your README: - What is the functional annotation of this gene? Note that geneName is null even though description is populated — what does a resource choosing to leave one metadata field empty while populating another tell you about how that annotation was assigned (e.g. inferred from sequence similarity vs. a curated, named gene symbol)? - Try a gene ID with no description at all (for example Potra2n4c9093) — what does the difference tell you about the completeness of this resource’s annotation, versus the resource’s design? - What does needing a JSON request body, rather than a simple URL, tell you about this API’s design compared to NCBI/UniProt’s?


Exercise 1B — Query gene expression data

PlantGenIE integrates gene expression data from multiple experiments. The expression endpoint allows retrieval of expression values for a gene across the samples in a chosen experiment.

# List available experiments and note one for Populus tremula
curl -s "${BASE}/v1/expression/available-experiments" > experiments.json
cat experiments.json

EXPERIMENT_ID=15   # "Potra Wood Development" — likely the AspWood dataset (ERP016242) from Part 2

# Retrieve expression data for the same gene across this experiment's samples
curl -s -X POST "${BASE}/v1/expression" \
  -H "Content-Type: application/json" \
  -d "{\"experimentId\": ${EXPERIMENT_ID}, \"geneIds\": [\"${GENE_ID}\"]}" \
  > expression_data.json
cat expression_data.json

# How many samples are represented?
python3 -c "import json; d=json.load(open('expression_data.json')); print(len(d['samples']))"

# Which sample shows the highest expression?
python3 -c "
import json
d = json.load(open('expression_data.json'))
pairs = sorted(zip(d['samples'], d['values']), key=lambda x: x[1], reverse=True)
for sample, value in pairs[:5]:
    print(sample, value)
"

Questions to answer in your README: - In which sample(s) is this gene most highly expressed? - Does that pattern match what you would predict from the gene’s annotation in Exercise 1A? (Hint: think about which stage of wood formation a “cellulose synthase” family gene should be most active in.) - What are the expression units (check the units field)? Are they specified? - What information would you need to reproduce an analysis using this expression data?


Exercise 1C — BLAST via the website

Go to the PlantGenIE website (or NCBI BLAST at https://blast.ncbi.nlm.nih.gov/ for comparison) and run a blastp search using the TP53 protein sequence retrieved in Lecture 11.

Questions to answer in your README: - What parameters did you set (database, programme, E-value threshold)? - How long did the search take, and what did the results viewer show you that a plain text file would not? - What would make this approach impractical if you needed to search 500 sequences instead of one?


Exercise 1D — BLAST from the command line (local/HPC)

Run the same search locally on Kebnekaise, against a local database copy, submitted as a Slurm job.

Open a second terminal tab for this step (in OnDemand’s desktop: another “MATE Terminal”). BLAST+’s toolchain (GCC/14.2.0) is not compatible with the GCCcore/14.3.0 that git/curl need above - loading it in the same terminal silently breaks git and curl for the rest of this exercise, with no error message at the point it happens. Keeping this step in its own terminal avoids the conflict entirely; you only need this tab to submit the job and can switch back to your first terminal immediately after sbatch.

cd ~/course/lecture15-fair-practice   # a new terminal starts in your home directory
module load GCC/14.2.0 OpenMPI/5.0.7 BLAST+/2.17.0
module list   # Verify it loaded correctly

# Check the local database is accessible
ls /proj/nobackup/cddb_course/databases/swissprot/

cat > blast_tp53.sh << 'EOF'
#!/bin/bash
#SBATCH --job-name=blast_tp53
#SBATCH --account=hpc2ncourses2026-013
#SBATCH --time=00:10:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --output=blast_tp53_%j.out
#SBATCH --error=blast_tp53_%j.err

module load GCC/14.2.0 OpenMPI/5.0.7 BLAST+/2.17.0

blastp \
  -query TP53_protein.fasta \
  -db /proj/nobackup/cddb_course/databases/swissprot/swissprot \
  -out TP53_blastp_local.txt \
  -outfmt 6 \
  -evalue 1e-5 \
  -num_threads 4 \
  -max_target_seqs 50

echo "BLAST complete: $(date)"
EOF

sbatch blast_tp53.sh
squeue -u $USER

# Once complete, inspect the tabular output (format 6)
head -5 TP53_blastp_local.txt

Reading the tabular output. Format 6 has one line per hit and 12 columns, separated by tabs. The columns have no header, so you refer to them by number:

Column Name Meaning Column Name Meaning
1 qseqid your query 7 qstart start of the match in the query
2 sseqid the hit (subject) 8 qend end of the match in the query
3 pident percent identity 9 sstart start of the match in the hit
4 length alignment length 10 send end of the match in the hit
5 mismatch number of mismatches 11 evalue E-value
6 gapopen number of gap openings 12 bitscore bit score
# Show only the columns you need: hit, percent identity, E-value, bit score
cut -f2,3,11,12 TP53_blastp_local.txt | head -5

# BLAST already lists the hits best first, so the top 3 hits are simply
# the first three lines - no sorting needed
head -3 TP53_blastp_local.txt

# How many hits have an E-value below 1e-10?
awk -F'\t' '$11 < 1e-10' TP53_blastp_local.txt | wc -l

# Sort by E-value, smallest first. -t$'\t' splits on tabs, -k11,11 uses
# column 11 only, and g ("general numeric") understands e-notation
sort -t$'\t' -k11,11g TP53_blastp_local.txt | head -5

# Sort by percent identity, largest first (r = reverse)
sort -t$'\t' -k3,3gr TP53_blastp_local.txt | head -5

Three things to watch for when sorting:

  • sort -n does not understand e-notation. It reads 2.1e-150 as 2.1 and 1.1e-90 as 1.1, so it puts 1.1e-90 first. Use g for E-values.
  • sort puts the smallest values first. For percent identity or bit score, where larger is better, add r.
  • For a well-conserved protein many hits have an E-value of exactly 0.0. Sorting by E-value then puts those hits in alphabetical order, not in order of quality. BLAST’s own order, from the bit score, is the one to use for “top hits”: that is why head -3 of the unsorted file is the answer.

For more practice with cut, sort and awk on this BLAST table, including finding the best non-self hit, see the self-study page Reading and querying bioinformatics text files.

Questions to answer in your README: - How does the setup effort compare to the website approach — and how does that change once the database and script already exist? - What does the Slurm script itself give you that the website result page does not?


Exercise 1E — BLAST via an API

Two ways to submit a BLAST search programmatically:

EBI’s Job Dispatcher API (fully documented, dedicated asynchronous REST API — confirmed working, completed in under 30 seconds during testing):

# The sequence is sent as a plain-text form field (not a file upload) —
# reuse the TP53_protein.fasta file you already have from Exercise 1D
SEQ=$(cat TP53_protein.fasta)

# Check what is in the variable. Use echo for a variable; cat is for files
echo "$SEQ" | head -3    # the header and the start of the sequence
printf '%s' "$SEQ" | wc -c    # its length in characters; 0 means it is empty

JOB_ID=$(curl -s -X POST "https://www.ebi.ac.uk/Tools/services/rest/ncbiblast/run" \
  --data-urlencode "email=your@email.se" \
  --data-urlencode "program=blastp" \
  --data-urlencode "stype=protein" \
  --data-urlencode "database=uniprotkb_swissprot" \
  --data-urlencode "sequence=${SEQ}")

echo "Job submitted. Job ID: $JOB_ID"

Do not use cat $SEQ to check the variable: cat opens files, so it treats every word of the sequence as a file name and prints No such file or directory for each one. If the variable is wrong, run the SEQ=$(cat ...) line again; it replaces the old value.

In each --data-urlencode line, the field name ends in =, as in email=... and sequence=.... The form name@file means “read the value from this file”, so a typo in a file name, or email@ instead of email=, gives the error option --data-urlencode: error encountered when reading a file. The error does not say which line caused it.

A job ID looks like ncbiblast-R20260924-204334-0606-96444088-p1m. If echo shows an HTML page or an error message instead, the service did not accept the job: note the message and try once more after a few minutes.

# Poll until the search is ready. Check every 30 seconds, not more often:
# EBI asks users to avoid unnecessary polling, which adds load to the shared service
while true; do
  sleep 30
  STATUS=$(curl -s "https://www.ebi.ac.uk/Tools/services/rest/ncbiblast/status/${JOB_ID}")
  echo "$STATUS"
  [ "$STATUS" = "FINISHED" ] && break
  [ "$STATUS" = "FAILURE" ] && { echo "Job failed"; break; }
done

# Retrieve the results as a table: "tsv" gives one line per hit, best
# first, with a header line that names the columns
curl -s "https://www.ebi.ac.uk/Tools/services/rest/ncbiblast/result/${JOB_ID}/tsv" \
  > TP53_blastp_swissprot.tsv
head -4 TP53_blastp_swissprot.tsv    # the header and the top 3 hits

# The same results as BLAST's full text report, with the alignments;
# "json", "ids" and other formats are also available
# (see .../resulttypes/${JOB_ID} for the full list)
curl -s "https://www.ebi.ac.uk/Tools/services/rest/ncbiblast/result/${JOB_ID}/out" \
  > TP53_blastp_swissprot.txt
grep "Score\|Expect\|Identities" TP53_blastp_swissprot.txt | head -20

The tsv result names its columns in the first line (Hit, Accession, Description, Identities(%), E() and others), and its columns are not the same as those of the local format-6 output. The Description column contains spaces, so use cut -f or awk -F'\t', which split on tabs, to pick columns from it. The text report (out) is not a table at all: column numbers do not apply to it.

A note on NCBI’s BLAST API: NCBI (https://blast.ncbi.nlm.nih.gov/) offers a comparable, fully documented API using the same submit/poll/retrieve pattern (CMD=Put / CMD=Get against Blast.cgi — see NCBI’s BLAST URL API documentation). It is a legitimate resource and worth trying in your own time, but it is a shared, best-effort queue layered on the public BLAST website’s own CGI script, with no documented turnaround guarantee — the same query used here has been observed to take anywhere from under a minute to well over 30 minutes depending on server load. That variability is exactly why this exercise uses EBI’s API instead.

PlantGenIE’s BLAST API — PlantGenIE also exposes a BLAST endpoint, confirmed working against the live API. Unlike the annotation and expression endpoints, this one needs a sequence as input — and PlantGenIE does not currently expose a sequence-retrieval endpoint of its own (its API returns gene metadata and expression data, but not sequence). A query sequence for Potra2n18c32336 has therefore been provided for you: potra-Potra2n18c32336-1.fasta. This gap is itself worth noting for your FAIR assessment — a resource can be Interoperable for some data types and not yet for others.

# Download the provided query file onto Kebnekaise - the markdown link
# above only works from a browser, not from this terminal
curl -sL "https://raw.githubusercontent.com/hpc2n/bioinformatics-hpc/main/docs/exercises/15.fair-in-practice/potra-Potra2n18c32336-1.fasta" \
  -o potra-Potra2n18c32336-1.fasta

# Submit — species_id and genome_id are 3 for Populus tremula (from the
# available-experiments response in Exercise 1B); database_type selects
# which BLAST database to search against (cds, here)
JOB_ID=$(curl -s -X POST "${BASE}/v1/blast/blastn/submit?database_type=cds" \
  -F "species_id=3" \
  -F "genome_id=3" \
  -F "file=@potra-Potra2n18c32336-1.fasta" \
  | python3 -c "import json,sys; print(json.load(sys.stdin)['jobId'])")

echo "Job submitted. Job ID: $JOB_ID"

# Poll until the search is ready
while true; do
  sleep 5
  STATUS=$(curl -s "${BASE}/v1/blast/poll/${JOB_ID}" \
    | python3 -c "import json,sys; print(json.load(sys.stdin)['status'])")
  echo "$STATUS"
  [ "$STATUS" = "SUCCESS" ] && break
done

# Retrieve results (tsv or html — try both)
curl -s "${BASE}/v1/blast/retrieve/${JOB_ID}/tsv" > blast_result.tsv
cat blast_result.tsv

Important: always use www.plantgenie.se, not dev.plantgenie.se, for the BLAST endpoint specifically — BLAST is not set up correctly on the development server (submitting there returns a 500 Internal Server Error). The annotation and expression endpoints work fine on both.

Questions to answer in your README: - What makes submitting a BLAST job via API different from the website — in terms of what you get back and how you’d use it in a pipeline? - What makes this interaction an example of Interoperability? - Look at the top hit in your results — is it the query sequence itself? What does that tell you about how BLAST scores a perfect match?


Exercise 1F — Compare the three approaches and commit your findings

Approach Speed Scalability Reproducibility Control
Website Fast for 1 sequence Not scalable Low (no record of parameters) Limited
API Moderate ~10s of sequences Good (parameters in code) Moderate
Local HPC Slow to set up, fast to run Highly scalable Excellent (script + Slurm log) Full
# Document your findings in the README
cat >> README.md << 'EOF'

## Part 1: Three Ways to Run BLAST + PlantGenIE API (Interoperability)

### Gene information and expression (PlantGenIE)
<!-- Add your findings here -->

### BLAST — website, local/HPC, API
<!-- Add your findings and the comparison table here -->

### Interoperability assessment of PlantGenIE
<!-- In 3-4 sentences: how does the PlantGenIE API demonstrate the I principle of FAIR? -->

EOF

git add .
git commit -m "lecture15: three ways to run BLAST + PlantGenIE API exercises complete

- BLAST via website, local/HPC Slurm job, and API (NCBI + PlantGenIE)
- Gene information and expression queries via PlantGenIE REST API
- Findings documented in README"

Part 2 — Reusability: GEO/ENA Metadata Assessment

2.1 The Core Question

The Reusable principle of FAIR requires that data has sufficient metadata to enable someone other than the original authors to understand and reuse it for a new analysis. In practice for RNA-seq data, this means: could a researcher who finds this dataset in GEO or ENA run a differential expression analysis without contacting the authors?

This exercise asks you to answer that question for a specific, provided dataset.

2.2 The Metadata Sufficiency Checklist

Work through the following checklist for the dataset below. Record your findings — yes/no and supporting evidence — in your README.

The dataset accession for this exercise: ERP016242 (a European Nucleotide Archive Study accession — see Lecture 11 for how the SRR/ERR, SRP/ERP, etc. prefixes are decoded)

The associated paper: Sundell D. et al. (2017). AspWood: High-Spatial-Resolution Transcriptome Profiles Reveal Uncharacterized Modularity of Wood Formation in Populus tremula. The Plant Cell 29(7): 1585–1604. DOI: 10.1105/tpc.17.00153

Data accessible at: https://www.ebi.ac.uk/ena/browser/view/ERP016242

Why this dataset: The data are directly integrated into PlantGenIE, creating strong continuity with Exercise 1 — you can query PlantGenIE for genes identified as differentially expressed in this study. Published in 2017 — one year after the FAIR principles were formalised — it provides an instructive temporal perspective on the evolution of FAIR practices. As data from the course leader’s own research group, it can be discussed with complete transparency about what decisions were made at deposition time and what would be done differently under current standards. This framing — that FAIR assessment is about continuous improvement, not fault-finding — is itself an important lesson.

Finding the dataset: - [ ] Can you locate the dataset by searching the GEO or ENA database without knowing the accession in advance? - [ ] Is there a persistent, stable identifier (accession number) for the dataset? - [ ] Is the identifier cited in the paper?

Sample identification: - [ ] Can you tell how many samples are in the dataset? - [ ] Can you assign each sample to an experimental condition (control vs treated, genotype A vs B, etc.) from the metadata alone? - [ ] Are biological replicates identifiable?

Biological metadata: - [ ] Is the organism identified with a taxonomy ID (not just a name)? - [ ] Is the tissue or cell type specified? Is it annotated with an ontology term (e.g. UBERON, EFO, CL)? - [ ] Is the treatment or experimental condition specified? Is it annotated with an ontology term (e.g. EFO, CHEBI)? - [ ] Are any other relevant variables specified (age, sex, genotype, growth conditions, time point)?

Technical metadata: - [ ] Is the sequencing platform specified? - [ ] Is the library preparation protocol specified (stranded/unstranded, poly-A/ribo-depleted)? - [ ] Is read length and paired/single end specified?

Data availability: - [ ] Are raw FASTQ files available (not only processed count matrices)? - [ ] Are processed results available (count matrix, normalised data)? - [ ] Is the reference genome/transcriptome version specified? - [ ] Is the alignment tool and version specified?

Reproducibility: - [ ] Is analysis code available? - [ ] Are software versions specified for all tools used? - [ ] Is there a workflow definition (Snakemake, Nextflow) or equivalent? - [ ] Does the paper declare adherence to a community metadata standard (e.g. MINSEQE)?

2.3 Scoring and Documenting Your Assessment

For each item in the checklist, record: - Pass — the information is clearly present - Partial — the information is present but incomplete (e.g. tissue type is given as text but no ontology term) - Fail — the information is absent

Then write a brief paragraph (3–5 sentences) answering: If you wanted to reproduce the main differential expression analysis from this paper, what specific information is missing that would prevent you from doing so?

# In your README, add the metadata assessment section
cat >> README.md << 'EOF'

## Part 2: GEO/ENA Metadata Assessment (Reusability)

### Dataset assessed
Accession: <!-- add -->
Paper: <!-- add -->

### Checklist summary
| Category | Pass | Partial | Fail |
|----------|------|---------|------|
| Sample identification | | | |
| Biological metadata | | | |
| Technical metadata | | | |
| Data availability | | | |
| Reproducibility | | | |

### Key finding
<!-- 3-5 sentences: what is missing and what would it prevent? -->

EOF

git add README.md
git commit -m "lecture15: GEO metadata assessment complete"

Part 3 — Paper Reproducibility Exercise

3.1 Overview

This exercise uses your chosen essay paper. Working individually, you will systematically assess the computational reproducibility of the published analysis — using the same framework you will apply in the essay itself.

Note: you are not re-running the analysis. You are assessing whether you could re-run it from what the paper reports.

3.2 The Reproducibility Assessment

Open your chosen paper and work through the following:

Step 1 — Map the analysis pipeline List every computational step mentioned in the methods section, in order. For each step, record: - What tool was used? - Was the version specified? - Were the key parameters reported?

Example table structure:

Step Tool Version specified? Parameters reported?
Quality trimming Trimmomatic v0.39 ✓ LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36 ✓
Alignment HISAT2 v2.1.0 ✓ Default ✗ — “default parameters” is insufficient
Quantification featureCounts Not specified ✗ Not specified ✗
DE (differential expression) analysis DESeq2 v1.20.0 ✓ Shrinkage estimator not specified ✗

Step 2 — Assess code availability - Is analysis code available at all? - If yes: is it versioned (Git tag, Zenodo DOI)? Is it documented? Does it specify software dependencies? - If no: is there any indication of how the analysis could be reproduced?

Step 3 — Assess the reference genome situation - Is the reference genome specified? - Is a version (assembly accession) given? - Is the annotation version (GTF/GFF) specified? - Could you identify exactly the same reference genome and annotation to reproduce the alignment?

Step 4 — Write a reproducibility verdict In 2–3 sentences: based on what the paper reports, could an independent researcher reproduce the main analysis? What would they need to obtain from the authors that is not in the paper?

cat >> README.md << 'EOF'

## Part 3: Paper Reproducibility Assessment

### Paper assessed
<!-- Title, DOI -->

### Analysis pipeline reconstruction
| Step | Tool | Version? | Parameters? |
|------|------|----------|-------------|
| | | | |

### Code availability
<!-- What is available and what is not -->

### Reference genome situation
<!-- Is the exact genome/annotation version reproducible? -->

### Reproducibility verdict
<!-- 2-3 sentences -->

EOF

git add README.md
git commit -m "lecture15: paper reproducibility assessment complete

- Pipeline reconstruction table
- Code and reference genome assessment
- Ready for essay development"

Part 4 — Building a Reproducible Report (Optional)

This part is optional and not covered in the taught session. It previews two languages you have not been taught yet — Python and R — which are covered properly in later courses (Python Programming for Bioinformatics and Data Science for Biology with R). The point here is only to see what the finished result looks like: copy the code exactly as given rather than trying to understand or adapt every line of syntax. If you are short on time, skip this part entirely.

4.1 Why This Exercise

In Part 3 you assessed whether someone else’s paper was computationally reproducible. Here, you do the positive version yourself: turn a small piece of this exercise into an actual reproducible report — a notebook that combines code, narrative, and live output in one rerunnable file, rather than a terminal transcript and a folder of output files. See Lecture 14, Section 4.5 for why this matters.

4.2 Build a Minimal Jupyter Notebook

This is likely your first time using Jupyter, so here is every click, not just the outline.

Launch it: Via OnDemand, launch a Jupyter Notebook session (if the launcher offers a “Working Directory” field, setting it to ~/course/lecture15-fair-practice is worth trying, but has been observed not to reliably take effect — the code below is written to work regardless, using a full path rather than depending on it). In the Launcher screen that appears, click the “Python 3 (ipykernel)” tile under “Notebook” (ignore any other kernels listed, e.g. “pandastest” — plain Python 3 is all this needs).

What you’ll see: A new notebook with one empty box, called a cell. Every cell has a type — Code or Markdown — shown in a dropdown in the toolbar above it. New cells default to Code. To run whichever cell is selected, press Shift+Enter: this executes it and creates a new cell below.

Build these three cells in order:

  1. Click the toolbar dropdown and switch the first cell to Markdown. Type a one-sentence description, e.g. “Summarises the PlantGenIE expression query for Potra2n4c9093 from Exercise 1B.” Press Shift+Enter — it renders as text, not code.
  2. A new cell appears, already Code — leave it as Code. Paste this exactly (you do not need to understand the Python syntax yet). It uses the full path to expression_data.json rather than just its filename, so it works regardless of which directory Jupyter happened to start in:
    import json, os
    path = os.path.expanduser("~/course/lecture15-fair-practice/expression_data.json")
    data = json.load(open(path))
    print(len(data["samples"]), "samples returned for this gene")
    
    Press Shift+Enter. The printed result should appear directly below the cell. If you instead see FileNotFoundError, your Jupyter session started somewhere other than that directory — the full path above should fix it regardless.
  3. A new cell appears — switch it to Markdown again, type one sentence interpreting the output, press Shift+Enter.

Save and rename: Cmd+S (or File → Save Notebook), then right-click the tab at the top (or File → Rename) and name it expression_report.ipynb.

Confirm it actually reproduces: Kernel menu → “Restart Kernel and Run All Cells”. This re-runs every cell from a blank slate — that is the test that matters, not just that it ran once while you were writing it.

Export to HTML: File → “Save and Export Notebook As” → HTML.

Then commit both files:

git add expression_report.ipynb expression_report.html
git commit -m "lecture15: minimal reproducible report (Jupyter)

- Notebook reproduces the Exercise 1B expression summary from scratch
- HTML export committed alongside the source notebook"

4.3 The R Equivalent (optional preview — you will use this properly in Data Science for Biology with R)

The same idea in R uses R Markdown, rendered with knitr, via RStudio Server (also available on OnDemand). As with the Python above, this is only to see the pattern — copy it exactly rather than trying to understand the R syntax yet. If you want to try running it yourself:

  1. Launch an RStudio Server session via OnDemand.
  2. File → New File → Text File, then save it (Cmd/Ctrl+S) in ~/course/lecture15-fair-practice, typing the filename as exactly report.Rmd. Check the tab title or Files pane afterwards to confirm it saved as report.Rmd and not something else (e.g. report.Rmd.txt or report.html) — some save dialogs silently change or append to the extension you type, and RStudio will not treat the file as R Markdown (or offer a working Knit) if the extension is wrong. Avoid the “New R Markdown…” wizard for this — it pre-fills its own boilerplate content you would otherwise need to delete around.
  3. Paste the entire block below exactly as given, including the --- header at the top.
  4. Click Knit — the blue yarn-ball icon in the toolbar above the file — to render it. This runs the whole document in one go and should open a preview of the rendered HTML: the narrative text, the R code, and its printed output together, the same idea as exporting a Jupyter notebook to HTML. On RStudio Server the preview does not always pop up (likely a browser popup blocker) even though the render succeeded — if nothing appears, check the Files pane for a new report.html and open it directly; the absence of a preview does not by itself mean it failed.

A minimal .Rmd file looks like this:

---
title: "Expression query summary"
output: html_document
---

Summarises the PlantGenIE expression query for Potra2n4c9093.

```{r}
path <- path.expand("~/course/lecture15-fair-practice/expression_data.json")
data <- jsonlite::fromJSON(path)
cat(length(data$samples), "samples returned for this gene\n")
```

Running it is entirely optional — the point is only to recognise the pattern before you meet it properly in the next course, not to produce a graded output the way Part 4.2 does. Skip it if you are short on time.

Questions to answer in your README: - What did the notebook approach make explicit that a bare script or terminal history would not? - If you handed only your .ipynb file to a labmate with no other context, could they understand what it did and why, and reproduce the output themselves?

cat >> README.md << 'EOF'

## Part 4: Reproducible Report (Jupyter)

### What the notebook makes explicit
<!-- vs a bare script or terminal history -->

### Could a labmate reproduce this from the notebook alone?
<!-- yes/no and why -->

EOF

git add README.md
git commit -m "lecture15: reproducible report reflection complete"

Exam Preparation: Pushing Your Work to GitHub

Throughout this lecture you have run git init, git add, and git commit repeatedly — but always locally. The exam requires one more step you have not yet practised here: pushing that work to a remote repository on GitHub, exactly as Lecture 7 (Git) covered. This is a good point to actually do it once, using the lecture15-fair-practice repository you already have.

Before the exam

  • Create a personal GitHub account now if you do not already have one — it is free, and you will use it throughout the rest of the programme, not just for this exam.
  • Send your instructor your GitHub username before the exam. A private repository for the exam is created for you in advance, under the course’s GitHub organisation, with you added as a collaborator — this cannot happen without your username on file first.
  • You will receive an announcement closer to the exam date with the deadline for sending your username and any further details. This is just an early heads-up so you have an account ready in time.

Practice: push lecture15-fair-practice to your own GitHub

Use the SSH URL below, not an https:// one. GitHub no longer accepts your account password for git push over HTTPS — that needs a Personal Access Token instead, which this course does not otherwise set up. The SSH URL uses an SSH key instead, with no token needed. That key must exist on Kebnekaise — a key on your own computer will not work for a push made from Kebnekaise. If you have not set one up there yet, or are unsure, follow the step-by-step guide to pushing to GitHub from Kebnekaise first (about 20 minutes); it covers creating the key, adding it to GitHub, testing the connection, and a practice push.

# On github.com: click "New repository", give it a name (e.g. lecture15-fair-practice),
# leave it empty (no README/license) - you already have a local repo to push.

# Back in your terminal, still in ~/course/lecture15-fair-practice:
git remote add origin git@github.com:<your-username>/lecture15-fair-practice.git
git branch -M main
git push -u origin main

Refresh the repository page on GitHub — your README and everything you have committed throughout this lecture should now be visible there. This is precisely the mechanism the exam relies on: the repository’s push history is what gets checked, not local commit timestamps. See Lecture 7, “Adding a Remote Repository” and “Uploading Changes” for the full explanation of remotes if any of this felt unfamiliar.


Essay Assessment

The full FAIR essay assignment — what it asks, what distinguishes a G from a VG response, and the curated paper shortlist — is covered in Lecture 14, Section 10. The metadata assessment (Part 2) and paper reproducibility exercise (Part 3) you have just completed are direct practice for the essay — the same frameworks apply. Bring questions to office hours or post on the Canvas discussion board.


What You Should Know After These Exercises

✅ Run a BLAST search via a website, from the command line on HPC, and via an API, and explain when and why you would choose each.

✅ Query a REST API from the command line using curl and parse the response with grep or jq.

✅ Explain why APIs embody the Interoperable principle of FAIR — standardised protocols, standard formats, documented endpoints.

✅ Describe PlantGenIE as an example of a specialist research resource that exposes its data through a documented API, enabling programmatic access from any tool.

✅ Apply the metadata sufficiency checklist to a real GEO or ENA dataset and identify which missing fields would prevent reanalysis.

✅ Reconstruct the analysis pipeline from a published methods section, noting which steps have complete version and parameter information and which do not.

✅ (Optional) Recognise what a minimal Jupyter notebook that reproduces its own output from scratch looks like, and explain what it makes explicit that a bare script does not — you will write this kind of Python and R yourself in later courses.

✅ Commit all exercise outputs and findings to Git with structured README documentation and meaningful commit messages.

✅ Describe what distinguishes a G from a VG essay response and apply this distinction to your own paper assessment.


Further Reading

  • PlantGenIE documentation and API reference: https://www.plantgenie.se/api/docs (confirmed by Jamie McCann)
  • PlantGenIE GitHub: https://github.com/plantgenie
  • EBI Job Dispatcher REST API (BLAST and other tools): https://www.ebi.ac.uk/jdispatcher/docs/webservices/
  • NCBI BLAST URL API documentation: https://blast.ncbi.nlm.nih.gov/doc/blast-help/urlapi.html
  • MINSEQE (Minimum Information about a high-throughput Nucleotide SeQuencing Experiment): https://fairsharing.org/FAIRsharing.a55z32
  • MIxS (Minimum Information about any (x) Sequence): https://www.gensc.org/pages/standards-intro.html
  • The Turing Way — Reproducible Research: https://the-turing-way.netlify.app/reproducible-research
  • Jupyter documentation: https://jupyter.org/documentation
  • R Markdown documentation: https://rmarkdown.rstudio.com/
  • HPC2N OnDemand interactive apps (Jupyter Notebook, RStudio Server): https://docs.hpc2n.umu.se/tutorials/connections/