Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
8811baae
Commit
8811baae
authored
Mar 07, 2015
by
bow
Browse files
Initial mapping subsection in report
parent
de316ff7
Changes
3
Hide whitespace changes
Inline
Side-by-side
public/gentrap/src/main/resources/nl/lumc/sasc/biopet/pipelines/gentrap/scripts/pdf_report.py
View file @
8811baae
...
...
@@ -324,13 +324,28 @@ class LongTable(object):
def
nice_int
(
num
,
default
=
"None"
):
if
num
is
None
:
return
default
return
locale
.
format
(
"%i"
,
int
(
num
),
grouping
=
True
)
try
:
return
locale
.
format
(
"%i"
,
int
(
num
),
grouping
=
True
)
except
:
return
default
def
nice_flt
(
num
,
default
=
"None"
):
if
num
is
None
:
return
default
return
locale
.
format
(
"%.2f"
,
float
(
num
),
grouping
=
True
)
try
:
return
locale
.
format
(
"%.2f"
,
float
(
num
),
grouping
=
True
)
except
:
return
default
def
float2nice_pct
(
num
,
default
=
"None"
):
if
num
is
None
:
return
default
try
:
return
locale
.
format
(
"%.2f"
,
float
(
num
)
*
100.0
,
grouping
=
True
)
except
:
return
default
# and some handy functions
...
...
@@ -363,6 +378,7 @@ def write_template(run, template_file, logo_file):
# put in out filter functions
env
.
filters
[
"nice_int"
]
=
nice_int
env
.
filters
[
"nice_flt"
]
=
nice_flt
env
.
filters
[
"float2nice_pct"
]
=
float2nice_pct
# write tex template for pdflatex
jinja_template
=
env
.
get_template
(
path
.
basename
(
template_file
))
...
...
@@ -384,6 +400,7 @@ class GentrapLib(object):
self
.
sample
=
sample
self
.
name
=
name
self
.
_raw
=
summary
# flexiprep settings
self
.
flexiprep
=
summary
.
get
(
"flexiprep"
,
{})
self
.
clipping
=
not
self
.
flexiprep
[
"settings"
][
"skip_clip"
]
self
.
trimming
=
not
self
.
flexiprep
[
"settings"
][
"skip_trim"
]
...
...
@@ -400,6 +417,8 @@ class GentrapLib(object):
if
"fastqc_R2_qc"
in
self
.
flexiprep
[
"files"
]:
self
.
fastqc_r2_qc_files
=
self
.
flexiprep
[
"files"
][
"fastqc_R2_qc"
]
self
.
fastqc_r2_qc
=
FastQC
(
self
.
fastqc_r2_qc_files
[
"fastqc_data"
][
"path"
])
# mapping metrics settings
self
.
aln_metrics
=
summary
.
get
(
"bammetrics"
,
{}).
get
(
"stats"
,
{}).
get
(
"alignment_metrics"
,
{})
def
__repr__
(
self
):
return
"{0}(sample=
\"
{1}
\"
, lib=
\"
{2}
\"
)"
.
format
(
...
...
public/gentrap/src/main/resources/nl/lumc/sasc/biopet/pipelines/gentrap/templates/pdf/lib.tex
View file @
8811baae
...
...
@@ -2,3 +2,5 @@
\label
{
lib:(((lib.name)))
}
((* include "lib
_
seqeval.tex" *))
\clearpage
((* include "lib
_
mapping.tex" *))
public/gentrap/src/main/resources/nl/lumc/sasc/biopet/pipelines/gentrap/templates/pdf/lib_mapping.tex
0 → 100644
View file @
8811baae
\subsection
{
Mapping
}
\label
{
sec:map
}
\subsubsection
{
Mapping statistics
}
Table~
\ref
{
tab:bamstat-((( lib.sample.name )))-((( lib.name ))))
}
shows the overview statistics of the
generated alignment file.
\indent
% number + percentage of reads mapped to genome
% number + percentage of properly paired reads
\begin{center}
\captionof
{
table
}{
Mapping Overview
}
\label
{
tab:bamstat-((( lib.sample.name )))-((( lib.name ))))
}
\setlength
{
\tabcolsep
}{
11pt
}
((* if lib.is
_
paired
_
end *))
\begin{tabular}
{
l r r r
}
\hline
\multirow
{
2
}{
*
}{
Parameter
}
&
\multicolumn
{
1
}{
c
}{
All Pairs
}
&
\multicolumn
{
1
}{
c
}{
First in Pairs
}
&
\multicolumn
{
1
}{
c
}{
Second in Pairs
}
\\
&
Value
&
Value
&
Value
\\
\hline
\hline
Total reads
&
((( lib.aln
_
metrics.PAIR.total
_
reads|nice
_
int )))
&
((( lib.aln
_
metrics.FIRST
_
OF
_
PAIR.total
_
reads|nice
_
int )))
&
((( lib.aln
_
metrics.SECOND
_
OF
_
PAIR.total
_
reads|nice
_
int )))
\\
Mean read length
&
((( lib.aln
_
metrics.PAIR.mean
_
read
_
length|nice
_
flt )))
&
((( lib.aln
_
metrics.FIRST
_
OF
_
PAIR.mean
_
read
_
length|nice
_
flt )))
&
((( lib.aln
_
metrics.SECOND
_
OF
_
PAIR.mean
_
read
_
length|nice
_
flt )))
\\
Strand balance
&
((( lib.aln
_
metrics.PAIR.strand
_
balance|nice
_
flt )))
&
((( lib.aln
_
metrics.FIRST
_
OF
_
PAIR.strand
_
balance|nice
_
flt )))
&
((( lib.aln
_
metrics.SECOND
_
OF
_
PAIR.strand
_
balance|nice
_
flt )))
\\
\%
Mapped to reference
&
((( lib.aln
_
metrics.PAIR.pct
_
pf
_
reads
_
aligned|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.FIRST
_
OF
_
PAIR.pct
_
pf
_
reads
_
aligned|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.SECOND
_
OF
_
PAIR.pct
_
pf
_
reads
_
aligned|float2nice
_
pct )))
\%
\\
\%
Mapped to reference (MAPQ >= 20)
&
((( lib.aln
_
metrics.PAIR.pct
_
pf
_
reads
_
aligned|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.FIRST
_
OF
_
PAIR.pct
_
pf
_
reads
_
aligned|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.SECOND
_
OF
_
PAIR.pct
_
pf
_
reads
_
aligned|float2nice
_
pct )))
\%
\\
Mismatch rate
&
((( lib.aln
_
metrics.PAIR.pf
_
mismatch
_
rate|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.FIRST
_
OF
_
PAIR.pf
_
mismatch
_
rate|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.SECOND
_
OF
_
PAIR.pf
_
mismatch
_
rate|float2nice
_
pct )))
\%
\\
Indel rate
&
((( lib.aln
_
metrics.PAIR.pf
_
indel
_
rate|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.FIRST
_
OF
_
PAIR.pf
_
indel
_
rate|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.SECOND
_
OF
_
PAIR.pf
_
indel
_
rate|float2nice
_
pct )))
\%
\\
Chimeras
&
((( lib.aln
_
metrics.PAIR.pct
_
chimeras|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.FIRST
_
OF
_
PAIR.pct
_
chimeras|float2nice
_
pct )))
\%
&
((( lib.aln
_
metrics.SECOND
_
OF
_
PAIR.pct
_
chimeras|float2nice
_
pct )))
\%
\\
\hline
((* else *))
\begin{tabular}
{
l r
}
\hline
\multirow
{
1
}{
*
}{
Parameter
}
&
\multicolumn
{
1
}{
c
}{
Value
}
\\
\hline
\hline
Total reads
&
((( lib.aln
_
metrics.UNPAIRED.total
_
reads|nice
_
int )))
\\
Mean read length
&
((( lib.aln
_
metrics.UNPAIRED.mean
_
read
_
length|nice
_
flt )))
\\
Strand balance
&
((( lib.aln
_
metrics.UNPAIRED.strand
_
balance|nice
_
flt )))
\\
\%
Mapped to reference
&
((( lib.aln
_
metrics.UNPAIRED.pct
_
pf
_
reads
_
aligned|float2nice
_
pct )))
\%
\\
\%
Mapped to reference (MAPQ >= 20)
&
((( lib.aln
_
metrics.UNPAIRED.pct
_
pf
_
reads
_
aligned|float2nice
_
pct )))
\%
\\
Mismatch rate
&
((( lib.aln
_
metrics.UNPAIRED.pf
_
mismatch
_
rate|float2nice
_
pct )))
\%
\\
Indel rate
&
((( lib.aln
_
metrics.UNPAIRED.pf
_
indel
_
rate|float2nice
_
pct )))
\%
\\
\hline
((* endif *))
\end{tabular}
\end{center}
((=
%((* if run.is_paired_end *))
%% inferred insert size distribution
%\subsection{Insert size distribution}
%
%This section contains a quick overview of the insert size distribution
%of the mapped reads.
%
%\indent
%
%There are three possible types of inserts the graph may denote:
%\begin{description}
% \item[\textit{inward}] \hfill \\
% Each read pair maps to opposite strands and point towards each other.
% \item[\textit{outward}] \hfill \\
% Each read pair maps to opposite strands and point away from each other.
% \item[\textit{same directions}] \hfill \\
% Both read pair map to the same strand.
%\end{description}
%
%\IfFileExists{((( vars['OUT_DIR'] )))/((( vars['SAMPLE'] ))).insertsizes.png}
%{
% \begin{figure}[h!]
% \centering
% \includegraphics[width=0.7\textwidth]{((( vars['OUT_DIR'] )))/((( vars['SAMPLE'] ))).insertsizes.png}
% \caption{Distribution of insert size length of paired-end reads mapped to opposite strands.}
% \end{figure}
%}
%{
% \IfFileExists{((( vars['OUT_DIR'] )))/((( vars['SAMPLE'] ))).f.insertsizes.png}
% {
% \begin{figure}[h!]
% \centering
% \includegraphics[width=0.7\textwidth]{((( vars['OUT_DIR'] )))/((( vars['SAMPLE'] ))).f.insertsizes.png}
% \caption{Distribution of insert size length of paired-end reads whose first read maps to the minus strand.}
% \end{figure}
% }{}
% \IfFileExists{((( vars['OUT_DIR'] )))/((( vars['SAMPLE'] ))).r.insertsizes.png}
% {
% \begin{figure}[h!]
% \centering
% \includegraphics[width=0.7\textwidth]{((( vars['OUT_DIR'] )))/((( vars['SAMPLE'] ))).r.insertsizes.png}
% \caption{Distribution of insert size length of paired-end reads whose first read maps to the plus strand.}
% \end{figure}
% }{}
%}
%((* endif *))
=))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment