This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate_examples.sh
62 lines (57 loc) · 2.74 KB
/
update_examples.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
declare -a dirs=("bs-seq" "hi-c" "rna-seq" "wgs")
for i in "public/examples/${dirs[@]}"; do
echo "--------------------------------------------------"
echo "Creating report for $i"
echo "--------------------------------------------------"
cd $i
rm -rf multiqc_report.html multiqc_report.zip multiqc_data
unzip -q data.zip
multiqc .
zip -q -r multiqc_report.zip multiqc_report.html multiqc_data
rm -r data/ multiqc_data/
cd ../
done
cd ../../
echo "--------------------------------------------------"
echo "Creating report for ngi-rna"
echo "--------------------------------------------------"
cd public/examples/ngi-rna
rm -rf *multiqc_report.html multiqc_report.zip *multiqc_data
unzip -q data.zip
pip install git+https://github.com/vladsavelyev/MultiQC_NGI
multiqc . --test-db ngi_db_data.json
pip uninstall -y multiqc_ngi
# plugin changed the name of the report, don't want to break links
mv P1234-test_ngi_project_multiqc_report.html test_ngi_project_multiqc_report.html
zip -q -r multiqc_report.zip *multiqc_report.html *multiqc_report_data
rm -r data/ *multiqc_report_data
cd ../
echo "--------------------------------------------------"
echo "Creating Jupyter example"
echo "--------------------------------------------------"
cd jupyter
rm -rf multiqc_report.zip multiqc_report.html multiqc_report_data
# Get the notebook from a separate repo
wget https://github.com/MultiQC/example-notebook/raw/master/multiqc_example.ipynb -O notebook.ipynb
# Hack the notebook a bit:
# 1. We don't need to re-install MultiQC as it's in our environment
sed -i '' 's/\%pip install/\# \%pip install/g' notebook.ipynb # remove the pip install command
sed -i '' 's/\%reset/\# \%reset/g' notebook.ipynb # remove the kernel restart command
# 2. GitHub doesn't render interactive plots, but the website does
sed -i '' 's/, flat=True//g' notebook.ipynb # remove the flat=True parameters
sed -i '' 's/(flat=True)/()/g' notebook.ipynb # remove the flat=True parameters
sed -i '' '/The rendered plot is a static image/d' notebook.ipynb # remove the explanation about flat=True
unzip -q data.zip
jupyter execute notebook.ipynb --inplace # Run the notebook
sed -i '' 's/\# \%pip install/\%pip install/g' notebook.ipynb # re-add the pip install command back
sed -i '' 's/\# \%reset/\%reset/g' notebook.ipynb # re-add the kernel restart command back
jupyter nbconvert --to html notebook.ipynb # Convert it to HTML
zip -q -r multiqc_report.zip notebook.ipynb multiqc_report.html multiqc_report_data
rm -r data/ multiqc_report_data/ notebook.ipynb gc_content.*
cd ../
echo "--------------------------------------------------"
echo "Opening completed reports"
echo "--------------------------------------------------"
open */*multiqc_report.html
cd ../../