Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Blaise LI
libhts
Commits
519923a0
Commit
519923a0
authored
Jul 09, 2019
by
Blaise Li
Browse files
Unset use of LaTeX, fix read type examination.
parent
53b52ea7
Changes
1
Hide whitespace changes
Inline
Side-by-side
libhts/libhts.py
View file @
519923a0
...
...
@@ -20,18 +20,19 @@ from scipy.stats.stats import pearsonr, linregress
from
scipy.stats.mstats
import
gmean
import
matplotlib
as
mpl
import
matplotlib.pyplot
as
plt
# TODO: set this at the "correct" place
# https://stackoverflow.com/a/42768093/1878788
from
matplotlib.backends.backend_pgf
import
FigureCanvasPgf
mpl
.
backend_bases
.
register_backend
(
'pdf'
,
FigureCanvasPgf
)
TEX_PARAMS
=
{
"text.usetex"
:
True
,
# use LaTeX to write all text
"pgf.rcfonts"
:
False
,
# Ignore Matplotlibrc
"pgf.texsystem"
:
"lualatex"
,
# hoping to avoid memory issues
"pgf.preamble"
:
[
r
'\usepackage{color}'
# xcolor for colours
]
}
mpl
.
rcParams
.
update
(
TEX_PARAMS
)
#
from matplotlib.backends.backend_pgf import FigureCanvasPgf
#
mpl.backend_bases.register_backend('pdf', FigureCanvasPgf)
#
TEX_PARAMS = {
#
"text.usetex": True, # use LaTeX to write all text
#
"pgf.rcfonts": False, # Ignore Matplotlibrc
#
"pgf.texsystem": "lualatex", # hoping to avoid memory issues
#
"pgf.preamble": [
#
r'\usepackage{color}' # xcolor for colours
#
]
#
}
#
mpl.rcParams.update(TEX_PARAMS)
import
seaborn
as
sns
# from rpy2.robjects import r, pandas2ri, Formula, StrVector
# as_df = r("as.data.frame")
...
...
@@ -275,11 +276,22 @@ def aligner2min_mapq(aligner, wildcards):
What minimal MAPQ value should a read have to be considered uniquely mapped?
See <https://sequencing.qcfail.com/articles/mapq-values-are-really-useful-but-their-implementation-is-a-mess/>.
"""
mapping_type
=
None
try
:
mapping_type
=
wildcards
.
mapping_type
except
AttributeError
:
mapping_type
=
wildcards
.
mapped_type
if
mapping_type
.
startswith
(
"unique_"
):
pass
if
mapping_type
is
None
:
try
:
mapping_type
=
wildcards
.
mapped_type
except
AttributeError
:
pass
if
mapping_type
is
None
:
try
:
mapping_type
=
wildcards
.
read_type
except
AttributeError
:
pass
if
mapping_type
is
None
or
mapping_type
.
startswith
(
"unique_"
):
if
aligner
==
"hisat2"
:
return
"-Q 60"
elif
aligner
==
"bowtie2"
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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