Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcodonusage
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
libcodonusage
Commits
2a8b9218
Commit
2a8b9218
authored
1 year ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Added global R4 computation.
parent
9b4e17e3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libcodonusage/__init__.py
+1
-1
1 addition, 1 deletion
libcodonusage/__init__.py
libcodonusage/libcodonusage.py
+8
-1
8 additions, 1 deletion
libcodonusage/libcodonusage.py
with
9 additions
and
2 deletions
libcodonusage/__init__.py
+
1
−
1
View file @
2a8b9218
__copyright__
=
"
Copyright (C) 2022-2023 Blaise Li
"
__copyright__
=
"
Copyright (C) 2022-2023 Blaise Li
"
__licence__
=
"
GNU GPLv3
"
__licence__
=
"
GNU GPLv3
"
__version__
=
"
0.28.
0
"
__version__
=
"
0.28.
1
"
from
.libcodonusage
import
(
from
.libcodonusage
import
(
aa2colour
,
aa2colour
,
aa_usage
,
aa_usage
,
...
...
This diff is collapsed.
Click to expand it.
libcodonusage/libcodonusage.py
+
8
−
1
View file @
2a8b9218
...
@@ -667,6 +667,12 @@ We compute the global usage, as the sum of the counts for a given codon,
...
@@ -667,6 +667,12 @@ We compute the global usage, as the sum of the counts for a given codon,
across genes.
across genes.
"""
)
"""
)
global_usage
=
counts_for_global
.
sum
(
axis
=
0
)
global_usage
=
counts_for_global
.
sum
(
axis
=
0
)
if
return_more
:
# Same computation as for individual genes,
# but based on the total counts.
global_max_counts
=
global_usage
.
T
.
groupby
(
"
aa
"
).
max
().
T
global_r4
=
global_usage
.
div
(
global_max_counts
)
render_md
(
"
Then we sum over codons corresponding to the same amino-acid.
"
)
render_md
(
"
Then we sum over codons corresponding to the same amino-acid.
"
)
global_summed_by_aa
=
global_usage
.
groupby
(
level
=
0
).
sum
()
global_summed_by_aa
=
global_usage
.
groupby
(
level
=
0
).
sum
()
render_md
(
"""
render_md
(
"""
...
@@ -702,7 +708,8 @@ across genes) so that they are more comparable between codons.
...
@@ -702,7 +708,8 @@ across genes) so that they are more comparable between codons.
"
rscu
"
:
rscu
,
"
rscu
"
:
rscu
,
"
r4_table
"
:
r4_table
,
"
r4_table
"
:
r4_table
,
"
global_proportions
"
:
global_proportions
,
"
global_proportions
"
:
global_proportions
,
"
global_rscu
"
:
global_proportions
.
mul
(
degeneracy
)}
"
global_rscu
"
:
global_proportions
.
mul
(
degeneracy
),
"
global_r4
"
:
global_r4
}
return
standardized_codon_usage_biases
return
standardized_codon_usage_biases
...
...
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