Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lingling Jin (lij313)
BINF200-W2022
Commits
12ce4521
Commit
12ce4521
authored
Jan 28, 2022
by
Lingling Jin (lij313)
Browse files
update ex14
parent
ec08bfe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
python-examples/ex14.py
View file @
12ce4521
...
...
@@ -9,7 +9,7 @@ SeqLength = len(DNASeq)
print
(
"Sequence Length:"
,
SeqLength
)
BaseList
=
list
(
set
(
DNASeq
))
BaseList
=
list
(
set
(
DNASeq
))
for
Base
in
BaseList
:
Percent
=
100
*
DNASeq
.
count
(
Base
)
/
SeqLength
print
(
"%s: %4.1f%%"
%
(
Base
,
Percent
)
)
python-examples/ex14_1.py
0 → 100644
View file @
12ce4521
#!/usr/bin/env python
## Revision of "compositioncalc2.py" from Ch 9 of Haddock & Dunn
## Converted from Python 2 to Python 3
## Make output of program more like that of "dnacalc.py"
DNASeq
=
"ATGTCTCATTCAAAGCA"
print
(
'Sequence:'
,
DNASeq
)
SeqLength
=
len
(
DNASeq
)
print
(
"Sequence Length:"
,
SeqLength
)
BaseList
=
set
(
DNASeq
)
for
Base
in
BaseList
:
Percent
=
100
*
DNASeq
.
count
(
Base
)
/
SeqLength
print
(
"%s: %4.1f%%"
%
(
Base
,
Percent
)
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment