Skip to content
Snippets Groups Projects
Commit 519923a0 authored by Blaise Li's avatar Blaise Li
Browse files

Unset use of LaTeX, fix read type examination.

parent 53b52ea7
No related branches found
No related tags found
No related merge requests found
...@@ -20,18 +20,19 @@ from scipy.stats.stats import pearsonr, linregress ...@@ -20,18 +20,19 @@ from scipy.stats.stats import pearsonr, linregress
from scipy.stats.mstats import gmean from scipy.stats.mstats import gmean
import matplotlib as mpl import matplotlib as mpl
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
# TODO: set this at the "correct" place
# https://stackoverflow.com/a/42768093/1878788 # https://stackoverflow.com/a/42768093/1878788
from matplotlib.backends.backend_pgf import FigureCanvasPgf #from matplotlib.backends.backend_pgf import FigureCanvasPgf
mpl.backend_bases.register_backend('pdf', FigureCanvasPgf) #mpl.backend_bases.register_backend('pdf', FigureCanvasPgf)
TEX_PARAMS = { #TEX_PARAMS = {
"text.usetex": True, # use LaTeX to write all text # "text.usetex": True, # use LaTeX to write all text
"pgf.rcfonts": False, # Ignore Matplotlibrc # "pgf.rcfonts": False, # Ignore Matplotlibrc
"pgf.texsystem": "lualatex", # hoping to avoid memory issues # "pgf.texsystem": "lualatex", # hoping to avoid memory issues
"pgf.preamble": [ # "pgf.preamble": [
r'\usepackage{color}' # xcolor for colours # r'\usepackage{color}' # xcolor for colours
] # ]
} #}
mpl.rcParams.update(TEX_PARAMS) #mpl.rcParams.update(TEX_PARAMS)
import seaborn as sns import seaborn as sns
# from rpy2.robjects import r, pandas2ri, Formula, StrVector # from rpy2.robjects import r, pandas2ri, Formula, StrVector
# as_df = r("as.data.frame") # as_df = r("as.data.frame")
...@@ -275,11 +276,22 @@ def aligner2min_mapq(aligner, wildcards): ...@@ -275,11 +276,22 @@ def aligner2min_mapq(aligner, wildcards):
What minimal MAPQ value should a read have to be considered uniquely mapped? 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/>. See <https://sequencing.qcfail.com/articles/mapq-values-are-really-useful-but-their-implementation-is-a-mess/>.
""" """
mapping_type = None
try: try:
mapping_type = wildcards.mapping_type mapping_type = wildcards.mapping_type
except AttributeError: except AttributeError:
pass
if mapping_type is None:
try:
mapping_type = wildcards.mapped_type mapping_type = wildcards.mapped_type
if mapping_type.startswith("unique_"): 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": if aligner == "hisat2":
return "-Q 60" return "-Q 60"
elif aligner == "bowtie2": elif aligner == "bowtie2":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment