Skip to content

Commit 5c03ae6

Browse files
committed
Add parameter page
1 parent a56a8d0 commit 5c03ae6

File tree

4 files changed

+158
-10
lines changed

4 files changed

+158
-10
lines changed

preprocess.ipynb

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 23,
5+
"execution_count": 50,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -11,29 +11,33 @@
1111
"import json\n",
1212
"from collections import defaultdict\n",
1313
"from itertools import product\n",
14-
"import numpy as np"
14+
"import numpy as np\n",
15+
"import yaml"
1516
]
1617
},
1718
{
1819
"cell_type": "code",
19-
"execution_count": 24,
20+
"execution_count": 51,
2021
"metadata": {},
2122
"outputs": [],
2223
"source": [
23-
"indir = Path(\"/home/nico/Software/nf-core/tfactivity/testing/work/61/1c5dc465e6b56743422f90800e0b13/\")\n",
24+
"indir = Path(\"/home/nico/Software/nf-core/tfactivity/testing/work/82/d26ec8c82550eedc7e354a5b166ed1\")\n",
2425
"assets_dir = Path(\"src/assets\")\n",
2526
"public_dir = Path(\"public\")"
2627
]
2728
},
2829
{
2930
"cell_type": "code",
30-
"execution_count": 25,
31+
"execution_count": 52,
3132
"metadata": {},
3233
"outputs": [],
3334
"source": [
34-
"counts_design_path = indir / \"counts_design/samplesheet_rnaseq.csv\"\n",
35+
"counts_design_path = indir / \"samplesheet_rnaseq.csv\"\n",
3536
"assert counts_design_path.exists()\n",
3637
"\n",
38+
"params_path = indir / \"params.yaml\"\n",
39+
"assert params_path.exists()\n",
40+
"\n",
3741
"affinity_ratio_dir = indir / \"affinity_ratio\"\n",
3842
"assert affinity_ratio_dir.exists()\n",
3943
"\n",
@@ -67,28 +71,38 @@
6771
},
6872
{
6973
"cell_type": "code",
70-
"execution_count": 26,
74+
"execution_count": 53,
7175
"metadata": {},
7276
"outputs": [
7377
{
7478
"name": "stderr",
7579
"output_type": "stream",
7680
"text": [
77-
"/tmp/ipykernel_26974/1389659800.py:3: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
81+
"/tmp/ipykernel_26974/1292875757.py:3: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n",
7882
" \"conditions\": df_design.groupby(\"condition\").apply(lambda x: x[\"sample\"].tolist()).to_dict()\n"
7983
]
8084
}
8185
],
8286
"source": [
83-
"df_design = pd.read_csv(indir / \"counts_design/samplesheet_rnaseq.csv\")\n",
87+
"df_design = pd.read_csv(counts_design_path)\n",
8488
"metadata = {\n",
8589
" \"conditions\": df_design.groupby(\"condition\").apply(lambda x: x[\"sample\"].tolist()).to_dict()\n",
8690
"}"
8791
]
8892
},
8993
{
9094
"cell_type": "code",
91-
"execution_count": 29,
95+
"execution_count": 55,
96+
"metadata": {},
97+
"outputs": [],
98+
"source": [
99+
"params = yaml.load(open(params_path), yaml.CSafeLoader)\n",
100+
"json.dump(params, open(assets_dir / \"params.json\", \"w\"), indent=4)"
101+
]
102+
},
103+
{
104+
"cell_type": "code",
105+
"execution_count": 47,
92106
"metadata": {},
93107
"outputs": [],
94108
"source": [

src/assets/params.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"Core Nextflow options": {
3+
"configFiles": "/home/nico/Software/nf-core/tfactivity/nextflow.config, /home/nico/Software/nf-core/tfactivity/testing/nextflow.config",
4+
"containerEngine": "docker",
5+
"launchDir": "/home/nico/Software/nf-core/tfactivity/testing",
6+
"profile": "test,docker",
7+
"projectDir": "/home/nico/Software/nf-core/tfactivity",
8+
"runName": "silly_franklin",
9+
"userName": "nico",
10+
"workDir": "/home/nico/Software/nf-core/tfactivity/testing/work"
11+
},
12+
"Generic options": {
13+
"trace_report_suffix": "2025-06-29_13-46-35"
14+
},
15+
"Input/output options": {
16+
"counts": "https://raw.githubusercontent.com/nf-core/test-datasets/tfactivity/rna-seq/Gene_id.txt",
17+
"counts_design": "https://raw.githubusercontent.com/nf-core/test-datasets/tfactivity/samplesheet/samplesheet_rnaseq.csv",
18+
"input": "https://raw.githubusercontent.com/nf-core/test-datasets/tfactivity/samplesheet/samplesheet_peaks.csv",
19+
"input_bam": "https://raw.githubusercontent.com/nf-core/test-datasets/tfactivity/samplesheet/samplesheet_bam.csv",
20+
"outdir": "results"
21+
},
22+
"Institutional config options": {
23+
"config_profile_description": "Minimal test dataset to check pipeline function",
24+
"config_profile_name": "Test profile"
25+
},
26+
"Reference genome options": {
27+
"blacklist": "/home/nico/Software/nf-core/tfactivity/assets/blacklists/mm10-blacklist.bed",
28+
"fasta": "https://github.com/nf-core/test-datasets/raw/tfactivity/reference/chr1.fa.gz",
29+
"genome": "mm10",
30+
"gtf": "https://github.com/nf-core/test-datasets/raw/tfactivity/reference/chr1.gtf.gz",
31+
"snps": "https://github.com/nf-core/test-datasets/raw/tfactivity/reference/snps_chr1.bed.gz",
32+
"taxon_id": 10090
33+
},
34+
"SNEEP options": {
35+
"sneep_motif_file": "/home/nico/Software/nf-core/tfactivity/assets/sneep_transfac_mouse_218.txt",
36+
"sneep_scale_file": "/home/nico/Software/nf-core/tfactivity/assets/sneep_scale_mouse_218.txt"
37+
}
38+
}

src/pages/index.astro

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ import RankingContainer from "../components/RankingContainer.astro";
1818
<img src={logo.src} alt="nf-core/tfactivity Pipeline Logo" class="h-40 w-auto" />
1919
</div>
2020

21+
<!-- Navigation -->
22+
<div class="max-w-4xl mx-auto px-4 mb-8">
23+
<nav class="flex justify-center space-x-6">
24+
<a href="/" class="text-gray-800 font-bold">Rankings</a>
25+
<a href="/parameters" class="text-blue-600 hover:text-blue-800 font-medium">Parameters</a>
26+
</nav>
27+
</div>
28+
2129
<RankingContainer />
2230
</div>
2331
</body>

src/pages/parameters.astro

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
import "../styles/global.css";
3+
import logo from "../assets/images/nf-core-tfactivity_logo_light.png";
4+
import params from "../assets/params.json";
5+
6+
// Type the params properly
7+
const typedParams = params as Record<string, Record<string, string | number>>;
8+
---
9+
10+
<html lang="en">
11+
<head>
12+
<meta charset="utf-8" />
13+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
14+
<meta name="viewport" content="width=device-width" />
15+
<meta name="generator" content={Astro.generator} />
16+
<title>Pipeline Parameters - nf-core/tfactivity report</title>
17+
</head>
18+
<body class="bg-gray-50">
19+
<div class="max-w-6xl mx-auto py-8 px-4">
20+
<div class="flex justify-center py-8">
21+
<img src={logo.src} alt="nf-core/tfactivity Pipeline Logo" class="h-40 w-auto" />
22+
</div>
23+
24+
<!-- Navigation -->
25+
<div class="max-w-4xl mx-auto px-4 mb-8">
26+
<nav class="flex justify-center space-x-6">
27+
<a href="/" class="text-blue-600 hover:text-blue-800 font-medium">Rankings</a>
28+
<a href="/parameters" class="text-gray-800 font-bold">Parameters</a>
29+
</nav>
30+
</div>
31+
32+
<div class="max-w-4xl mx-auto px-4 py-6">
33+
<h1 class="text-3xl font-bold text-gray-800 mb-6 text-center">Pipeline Parameters</h1>
34+
35+
<p class="text-gray-600 text-center mb-8">
36+
Configuration parameters used for this nf-core/tfactivity pipeline run
37+
</p>
38+
39+
<div class="space-y-8">
40+
{Object.entries(typedParams).map(([sectionName, sectionParams]) => (
41+
<div class="bg-white rounded-lg border border-gray-200 shadow-sm overflow-hidden">
42+
<div class="px-6 py-4 border-b border-gray-200 bg-gray-50">
43+
<h2 class="text-xl font-semibold text-gray-800">{sectionName}</h2>
44+
</div>
45+
<div class="px-6 py-4">
46+
<div class="space-y-3">
47+
{Object.entries(sectionParams).map(([paramKey, paramValue]) => (
48+
<div class="flex flex-col sm:flex-row sm:justify-between border-b border-gray-100 pb-3 last:border-b-0 last:pb-0">
49+
<dt class="font-medium text-gray-700 mb-1 sm:mb-0">{paramKey}</dt>
50+
<dd class="text-gray-900 font-mono text-sm break-all max-w-md">
51+
{typeof paramValue === 'string' && (paramValue.startsWith('http://') || paramValue.startsWith('https://')) ? (
52+
<a href={paramValue} target="_blank" rel="noopener noreferrer" class="text-blue-600 hover:text-blue-800 underline">
53+
{paramValue}
54+
</a>
55+
) : (
56+
String(paramValue)
57+
)}
58+
</dd>
59+
</div>
60+
))}
61+
</div>
62+
</div>
63+
</div>
64+
))}
65+
</div>
66+
67+
<!-- Back to Rankings Button -->
68+
<div class="mt-12 text-center">
69+
<a
70+
href="/"
71+
class="inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors duration-200"
72+
>
73+
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
74+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
75+
</svg>
76+
Back to Rankings
77+
</a>
78+
</div>
79+
</div>
80+
</div>
81+
</body>
82+
</html>
83+
84+
<style>
85+
html {
86+
font-family: system-ui, sans-serif;
87+
}
88+
</style>

0 commit comments

Comments
 (0)