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
88cea0dd
Commit
88cea0dd
authored
7 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
More documentation.
parent
a872a0e1
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
+6
-2
6 additions, 2 deletions
libhts/libhts.py
with
6 additions
and
2 deletions
libhts/libhts.py
+
6
−
2
View file @
88cea0dd
...
...
@@ -105,10 +105,14 @@ def do_deseq2(cond_names, conditions, counts_data,
def
median_ratio_to_pseudo_ref_size_factors
(
counts_data
):
"""
Adapted from DESeq paper (doi:10.1186/gb-2010-11-10-r106)
"""
"""
Adapted from DESeq paper (doi:10.1186/gb-2010-11-10-r106)
All libraries are used to define a pseudo-reference, which has
the geometric mean across libraries for a given gene in *counts_data*.
For a given library, the median across genes of the ratios to the
pseudo-reference is used as size factor.
"""
# Add pseudo-count to compute the geometric mean, then remove it
#pseudo_ref = (counts_data + 1).apply(gmean, axis=1) - 1
# Ignore lines with zeroes instead:
# Ignore lines with zeroes instead
(may be bad for IP: many zeroes expected)
:
pseudo_ref
=
(
counts_data
[
counts_data
.
prod
(
axis
=
1
)
>
0
]).
apply
(
gmean
,
axis
=
1
)
def
median_ratio_to_pseudo_ref
(
col
):
return
(
col
/
pseudo_ref
).
median
()
...
...
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