Commit 519923a0 authored by Blaise Li's avatar Blaise Li
Browse files

Unset use of LaTeX, fix read type examination.

parent 53b52ea7
......@@ -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":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment