Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python_one_week_4_biologists_solutions
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
hub-courses
python_one_week_4_biologists_solutions
Commits
f1d462b6
Commit
f1d462b6
authored
2 weeks ago
by
Bertrand NÉRON
Browse files
Options
Downloads
Patches
Plain Diff
remove useles float casting in gc_percent
parent
919f6144
No related branches found
No related tags found
No related merge requests found
Pipeline
#157788
passed
2 weeks ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/_static/code/gc_percent.py
+3
-1
3 additions, 1 deletion
source/_static/code/gc_percent.py
with
3 additions
and
1 deletion
source/_static/code/gc_percent.py
+
3
−
1
View file @
f1d462b6
def
gc_percent
(
seq
):
def
gc_percent
(
seq
):
"""
"""
Compute the ratio of GC in a DNA sequence
:param seq: The nucleic sequence to compute
:param seq: The nucleic sequence to compute
:type seq: string
:type seq: string
:return: the percent of GC in the sequence
:return: the percent of GC in the sequence
:rtype: float
:rtype: float
"""
"""
seq
=
seq
.
upper
()
seq
=
seq
.
upper
()
gc_pc
=
float
(
seq
.
count
(
'
G
'
)
+
seq
.
count
(
'
C
'
)
)
/
float
(
len
(
seq
)
)
gc_pc
=
seq
.
count
(
'
G
'
)
+
seq
.
count
(
'
C
'
)
/
len
(
seq
)
return
gc_pc
return
gc_pc
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