Skip to content
Snippets Groups Projects
Commit fb8373ab authored by bow's avatar bow
Browse files

Initial report

parent 66bf4e3f
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ from os import path
from jinja2 import Environment, FileSystemLoader
# set locale for digit grouping
locale.setlocale(locale.LC_ALL, "")
......@@ -68,11 +69,15 @@ class LongTable(object):
# filter functions for the jinja environment
def nice_int(num):
def nice_int(num, default="None"):
if num is None:
return default
return locale.format("%i", int(num), grouping=True)
def nice_flt(num):
def nice_flt(num, default="None"):
if num is None:
return default
return locale.format("%.2f", float(num), grouping=True)
......@@ -84,7 +89,7 @@ def natural_sort(inlist):
return inlist
def write_template(summary_file, template_file, logo_file):
def write_template(run, template_file, logo_file):
template_file = path.abspath(path.realpath(template_file))
template_dir = path.dirname(template_file)
......@@ -109,17 +114,74 @@ def write_template(summary_file, template_file, logo_file):
# write tex template for pdflatex
jinja_template = env.get_template(path.basename(template_file))
run.logo = logo_file
render_vars = {
"gentrap": {
"version": "--testing--",
"logo": logo_file,
},
"run": run,
}
rendered = jinja_template.render(**render_vars)
print(rendered, file=sys.stdout)
class GentrapLib(object):
def __init__(self, run, sample, name, summary):
assert isinstance(run, GentrapRun)
assert isinstance(sample, GentrapSample)
self.run = run
self.sample = sample
self.name = name
self._raw = summary
self.flexiprep = summary.get("flexiprep", {})
self.clipping = not self.flexiprep["settings"]["skip_clip"]
self.trimming = not self.flexiprep["settings"]["skip_trim"]
self.is_paired_end = self.flexiprep["settings"]["paired"]
def __repr__(self):
return "{0}(sample=\"{1}\", lib=\"{2}\")".format(
self.__class__.__name__, self.sample.name, self.name)
class GentrapSample(object):
def __init__(self, run, name, summary):
assert isinstance(run, GentrapRun)
self.run = run
self.name = name
self._raw = summary
self.lib_names = sorted(summary["libraries"].keys())
self.libs = \
{l: GentrapLib(self.run, self, l, summary["libraries"][l]) \
for l in self.lib_names}
def __repr__(self):
return "{0}(\"{1}\")".format(self.__class__.__name__, self.name)
class GentrapRun(object):
def __init__(self, summary_file):
with open(summary_file, "r") as src:
summary = json.load(src)
self._raw = summary
self.summary_file = summary_file
self.sample_names = sorted(summary["samples"].keys())
self.samples = \
{s: GentrapSample(self, s, summary["samples"][s]) \
for s in self.sample_names}
self.files = summary["gentrap"]["files"]
self.executables = summary["gentrap"]["executables"]
self.settings = summary["gentrap"]["settings"]
self.version = self.settings["version"]
def __repr__(self):
return "{0}(\"{1}\")".format(self.__class__.__name__,
self.summary_file)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
......@@ -131,4 +193,5 @@ if __name__ == "__main__":
help="Path to main logo file")
args = parser.parse_args()
write_template(args.summary_file, args.template_file, args.logo_file)
run = GentrapRun(args.summary_file)
write_template(run, args.template_file, args.logo_file)
\section{Library "((( lib.name )))" Results}
\label{lib:(((lib.name)))}
((* include "lib_seqeval.tex" *))
......@@ -43,46 +43,57 @@
\begin{document}
\setlength{\parindent}{0in}
\title{\Huge Gentrap: Generic Transcriptome Analysis Pipeline}
%\title{\Huge Gentrap Run Report}
\title{\resizebox{0.7\linewidth}{!}{\itshape Gentrap Run Report}}
\author{LUMC Sequencing Analysis Support Core}
\maketitle
\begin{center}
{\LARGE Run Report v((( gentrap.version )))}
{\LARGE version ((( run.version )))}
\end{center}
\begin{figure}[h!]
\centering
\includegraphics[width=0.8\textwidth]{((( gentrap.logo )))}
\includegraphics[width=0.8\textwidth]{((( run.logo )))}
\end{figure}
\thispagestyle{empty}
\clearpage
\addtocontents{toc}{\protect\hypertarget{toc}{}}
\tableofcontents
\clearpage
\section{Introduction}
\part{Overview}
\label{sec:intro}
This document outlines the results obtained from running Gentrap, a generic
pipeline for transcriptome analysis.
\clearpage
% TODO: contents ~ preferrably in modules!
((* include "test.tex" *))
((* for sample in run.samples.values() *))
((* include "sample.tex" *))
\clearpage
((* endfor *))
\section{About Gentrap}
\part{About Gentrap}
\label{apx:about}
The Generic Transcript Analysis Pipeline (Gentrap) aims to to be a
generic pipeline for analyzing transcripts from RNA-seq experiments.
The Generic Transcriptome Analysis Pipeline (Gentrap) is a
generic pipeline for analyzing transcripts from RNA-seq experiments. \\
Gentrap was developed by Wibowo Arindrarto (\href{mailto:w.arindrarto@lumc.nl}{w.arindrarto@lumc.nl})
based on raw scripts written by Jeroen Laros
(\href{mailto:j.f.j.laros@lumc.nl}{j.f.j.laros@lumc.nl}) and
Peter-Bram 't Hoen
(\href{mailto:p.a.c._t_hoen@lumc.nl}{p.a.c._t_hoen@lumc.nl}).
(\href{mailto:p.a.c._t_hoen@lumc.nl}{p.a.c._t_hoen@lumc.nl}) as part of the
\href{https://git.lumc/nl/biopet/biopet}{Biopet framework}. \\
The Biopet framework is developed by the
\href{http://sasc.lumc.nl}{Sequencing Analysis Support Core} of the
\href{http://lumc.nl}{Leiden University Medical Center}, by extending the
\href{http://http://gatkforums.broadinstitute.org/discussion/1306/overview-of-queue}{Queue framework}.
Please see the respective web sites for licensing information.
\indent
......
\part{Sample "((( sample.name )))" Results}
\label{sample:(((sample.name)))}
Hello from module ((( sample ))) \\
((* for lib in sample.libs.values() *))
((* include "lib.tex" *))
\clearpage
((* endfor *))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment