Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libhts
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blaise LI
libhts
Commits
519923a0
Commit
519923a0
authored
5 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Unset use of LaTeX, fix read type examination.
parent
53b52ea7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libhts/libhts.py
+25
-13
25 additions, 13 deletions
libhts/libhts.py
with
25 additions
and
13 deletions
libhts/libhts.py
+
25
−
13
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
"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment