Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
binfpy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
opensource
binfpy
Commits
85897a23
Commit
85897a23
authored
Feb 23, 2017
by
Mikael Boden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
guide.py
parent
8625943a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
guide.py
guide.py
+5
-5
No files found.
guide.py
View file @
85897a23
...
...
@@ -169,7 +169,7 @@ class Alignment():
return
len
(
self
.
seqs
)
def
__getitem__
(
self
,
ndx
):
return
self
.
seqs
[
ndx
]
def
calcDistances
(
self
,
measure
,
a
=
1.0
):
def
calcDistances
(
self
,
measure
=
'fractional'
,
a
=
1.0
):
""" Calculate the evolutionary distance between all pairs of sequences
in this alignment, using the given measure. Measure can be one of
'fractional', 'poisson', 'gamma', 'jc' or 'k2p'. If 'gamma' or 'k2p' is
...
...
@@ -201,7 +201,7 @@ class Alignment():
L
+=
1
if
seqA
[
k
]
!=
seqB
[
k
]:
D
+=
1
p
=
float
(
D
)
/
L
p
=
D
/
L
# Now calculate the specified measure based on p
if
measure
==
'fractional'
:
dist
=
p
...
...
@@ -214,7 +214,7 @@ class Alignment():
symbolsPerLine
=
60
maxNameLength
=
self
.
namelen
+
1
mystring
=
u''
wholeRows
=
self
.
alignlen
/
symbolsPerLine
wholeRows
=
self
.
alignlen
/
/
symbolsPerLine
for
i
in
range
(
wholeRows
):
for
j
in
range
(
len
(
self
.
seqs
)):
mystring
+=
self
.
seqs
[
j
]
.
name
.
ljust
(
maxNameLength
)
+
u' '
...
...
@@ -235,7 +235,7 @@ class Alignment():
html
=
u''
.
ljust
(
self
.
namelen
)
+
u' '
for
i
in
range
(
self
.
alignlen
-
1
):
if
(
i
+
1
)
%
10
==
0
:
html
+=
str
(
i
/
10
+
1
)[
-
1
]
html
+=
str
(
i
/
/
10
+
1
)[
-
1
]
else
:
html
+=
' '
html
+=
u'
%
s
\n
'
%
(
self
.
alignlen
)
...
...
@@ -504,7 +504,7 @@ def readClustalString(string, alphabet):
continue
sections
=
line
.
split
()
name
,
seq
=
sections
[
0
:
2
]
if
seqs
.
has_key
(
name
)
:
if
name
in
seqs
:
seqs
[
name
]
+=
seq
else
:
seqs
[
name
]
=
seq
...
...
Write
Preview
Markdown
is supported
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