doc.sh 3.78 KB
Newer Older
1
2
3
4
5
6
#!/bin/bash -l
#SBATCH -J geneder:03:doc
#SBATCH --mail-type=all
#SBATCH --mail-user=leon-charles.tranchevent@uni.lu
#SBATCH -N 1
#SBATCH -n 1
7
#SBATCH --time=0-00:01:00
8
9
10
11
12
13
14
15
16
#SBATCH -p batch
#SBATCH --qos=qos-batch

echo "== Starting run at $(date)"
echo "== Job ID: ${SLURM_JOBID}"
echo "== Node list: ${SLURM_NODELIST}"
echo "== Submit dir. : ${SLURM_SUBMIT_DIR}"
echo ""

17
18
# I/Os and parameters
OUTPUT_FOLDER=/home/users/ltranchevent/Data/GeneDER/Analysis/03/
19
CODE_FOLDER=/home/users/ltranchevent/Projects/GeneDER/Analysis/03-Predict_gender/
20
21
22
23

# Load configuration
source ../libs/conf/confSH.sh
create_variables ../Confs/datasets_config.yml
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

# Clean start
rm -rf ${OUTPUT_FOLDER}/results_summary.*

# Print header
echo '\documentclass[]{article}' > ${OUTPUT_FOLDER}/results_summary.tex
echo '' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '\usepackage{graphicx}' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '\title{GeneDER - step 03 - Gender prediction}' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '\author{Leon-Charles Tranchevent}' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '\begin{document}' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '\maketitle' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '\textsl{}' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '\begin{abstract}' >> ${OUTPUT_FOLDER}/results_summary.tex
41
echo 'This document summarizes the results of the step 03-Predict\_gender. Heatmaps of the expression' >> ${OUTPUT_FOLDER}/results_summary.tex
42
43
44
echo 'signal of Y-chromosome probes are displayed for all datasets. Clustering results are displayed on top of' >> ${OUTPUT_FOLDER}/results_summary.tex
echo 'the heatmaps to see if samples with shared gender are clustered together. In addition, signal from' >> ${OUTPUT_FOLDER}/results_summary.tex
echo 'Y-chromosome probes versus signal from X-chromosome probes is are also plotted. Blue samples are' >> ${OUTPUT_FOLDER}/results_summary.tex
45
46
47
48
49
50
echo 'females, green are males, grey are unknown (missing data - to be predicted). \\' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '' >> ${OUTPUT_FOLDER}/results_summary.tex
echo 'Note: this document is automatically generated.' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '\end{abstract}' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '' >> ${OUTPUT_FOLDER}/results_summary.tex

51
52
nbDatasets=${#datasets__dataset_name[@]}
for (( i=0; i<=$nbDatasets; i++ ))
53
do
54
55
56
57
58
	datasetName=${datasets__dataset_name[$i]}
	if [ "${datasetName}" != "" ]
	then
		echo '\begin{figure}[ht]' >> ${OUTPUT_FOLDER}/results_summary.tex
		echo '	\centering' >> ${OUTPUT_FOLDER}/results_summary.tex
59
60
61
		echo '	\includegraphics[scale=0.32]{'"$OUTPUT_FOLDER"''"${datasetName}"'_heatmap_yprobes.png}' >> ${OUTPUT_FOLDER}/results_summary.tex
		echo '  \includegraphics[scale=0.32]{'"$OUTPUT_FOLDER"''"${datasetName}"'_plot_YvsX.png}' >> ${OUTPUT_FOLDER}/results_summary.tex
		echo '	\caption{Plots for the '"$datasetName"' dataset. (Left) Heatmap for all Y-chromosome probes.' | sed -r 's/_/\\_/g' >> ${OUTPUT_FOLDER}/results_summary.tex
62
		echo '	(Right) Plot of the ratio between the average Y and average X signals.' >> ${OUTPUT_FOLDER}/results_summary.tex
63
		echo '	Blue is for females, green for males and grey for unknown gender.}' >> ${OUTPUT_FOLDER}/results_summary.tex
64
65
66
		echo '\end{figure}' >> ${OUTPUT_FOLDER}/results_summary.tex
		echo '' >> ${OUTPUT_FOLDER}/results_summary.tex
	fi
67
68
69
70
71
72
done

# Print footer
echo '' >> ${OUTPUT_FOLDER}/results_summary.tex
echo '\end{document}' >> ${OUTPUT_FOLDER}/results_summary.tex

73
# Compilation
74
75
76
pdflatex -synctex=1 -interaction=nonstopmode ${OUTPUT_FOLDER}/results_summary.tex
mv results_summary.pdf ${OUTPUT_FOLDER}/
rm results_summary*
77
78
79

# Moving the slurm log file to data
mv ${CODE_FOLDER}/slurm-*out ${OUTPUT_FOLDER}/