Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
Mirrors
mutalyzer
Commits
753bf600
Commit
753bf600
authored
10 years ago
by
Jeroen F.J. Laros
Committed by
Vermaat
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Updated documentation.
parent
57c55d0f
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
mutalyzer/describe.py
+15
-12
15 additions, 12 deletions
mutalyzer/describe.py
mutalyzer/variant.py
+36
-56
36 additions, 56 deletions
mutalyzer/variant.py
with
51 additions
and
68 deletions
mutalyzer/describe.py
+
15
−
12
View file @
753bf600
...
@@ -31,6 +31,15 @@ def printpos(s, start, end, fill=0):
...
@@ -31,6 +31,15 @@ def printpos(s, start, end, fill=0):
def
var_to_rawvar
(
s1
,
s2
,
var
,
seq_list
=
[],
container
=
DNAVar
,
def
var_to_rawvar
(
s1
,
s2
,
var
,
seq_list
=
[],
container
=
DNAVar
,
weight_position
=
1
):
weight_position
=
1
):
"""
"""
Convert a variant from the extractor module to one of the RawVar
subclasses.
:arg unicode s1: Reference sequence.
:arg unicode s2: Sample sequence.
:arg str var: Variant from the extractor module.
:arg str seq_list: Container for an inserted sequence.
:arg str container: Destination container.
:arg str weight_position: Weight of a position.
"""
"""
# Unknown.
# Unknown.
if
s1
==
'
?
'
or
s2
==
'
?
'
:
if
s1
==
'
?
'
or
s2
==
'
?
'
:
...
@@ -131,13 +140,10 @@ def describe_dna(s1, s2):
...
@@ -131,13 +140,10 @@ def describe_dna(s1, s2):
"""
"""
Give an allele description of the change from {s1} to {s2}.
Give an allele description of the change from {s1} to {s2}.
:arg s1: Sequence 1.
:arg unicode s1: Sequence 1.
:type s1: unicode
:arg unicode s2: Sequence 2.
:arg s2: Sequence 2.
:type s2: unicode
:returns: A list of RawVar objects, representing the allele.
:returns list(RawVar): A list of RawVar objects, representing the allele.
:rtype: list(RawVar)
"""
"""
description
=
Allele
()
description
=
Allele
()
in_transposition
=
0
in_transposition
=
0
...
@@ -190,13 +196,10 @@ def describe_protein(s1, s2):
...
@@ -190,13 +196,10 @@ def describe_protein(s1, s2):
"""
"""
Give an allele description of the change from {s1} to {s2}.
Give an allele description of the change from {s1} to {s2}.
:arg s1: Sequence 1.
:arg unicode s1: Sequence 1.
:type s1: unicode
:arg unicode s2: Sequence 2.
:arg s2: Sequence 2.
:type s2: unicode
:returns: A list of RawVar objects, representing the allele.
:returns list(RawVar): A list of RawVar objects, representing the allele.
:rtype: list(RawVar)
"""
"""
description
=
Allele
()
description
=
Allele
()
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/variant.py
+
36
−
56
View file @
753bf600
"""
"""
Models for the description extractor.
"""
"""
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
...
@@ -71,14 +72,12 @@ class ISeq(object):
...
@@ -71,14 +72,12 @@ class ISeq(object):
def
__init__
(
self
,
sequence
=
''
,
start
=
0
,
end
=
0
,
reverse
=
False
,
def
__init__
(
self
,
sequence
=
''
,
start
=
0
,
end
=
0
,
reverse
=
False
,
weight_position
=
1
):
weight_position
=
1
):
"""
"""
:arg sequence: Literal inserted sequence.
Initialise the class with the appropriate values.
:type sequence: unicode
:arg start: Start position for a transposed sequence.
:arg unicode sequence: Literal inserted sequence.
:type start: int
:arg int start: Start position for a transposed sequence.
:arg end: End position for a transposed sequence.
:arg int end: End position for a transposed sequence.
:type end: int
:arg bool reverse: Inverted transposed sequence.
:arg reverse: Inverted transposed sequence.
:type reverse: bool
"""
"""
self
.
sequence
=
sequence
self
.
sequence
=
sequence
self
.
start
=
start
self
.
start
=
start
...
@@ -130,30 +129,18 @@ class DNAVar(object):
...
@@ -130,30 +129,18 @@ class DNAVar(object):
"""
"""
Initialise the class with the appropriate values.
Initialise the class with the appropriate values.
:arg start: Start position.
:arg int start: Start position.
:type start: int
:arg int start_offset:
:arg start_offset:
:arg int end: End position.
:type start_offset: int
:arg int end_offset:
:arg end: End position.
:arg int sample_start: Start position.
:type end: int
:arg int sample_start_offset:
:arg end_offset:
:arg int sample_end: End position.
:type end_offset: int
:arg int sample_end_offset:
:arg sample_start: Start position.
:arg unicode type: Variant type.
:type sample_start: int
:arg unicode deleted: Deleted part of the reference sequence.
:arg sample_start_offset:
:arg ISeqList inserted: Inserted part.
:type sample_start_offset: int
:arg int shift: Amount of freedom.
:arg sample_end: End position.
:type sample_end: int
:arg sample_end_offset:
:type sample_end_offset: int
:arg type: Variant type.
:type type: unicode
:arg deleted: Deleted part of the reference sequence.
:type deleted: unicode
:arg inserted: Inserted part.
:type inserted: object
:arg shift: Amount of freedom.
:type shift: int
"""
"""
# TODO: Will this container be used for all variants, or only genomic?
# TODO: Will this container be used for all variants, or only genomic?
# start_offset and end_offset may be never used.
# start_offset and end_offset may be never used.
...
@@ -176,8 +163,8 @@ class DNAVar(object):
...
@@ -176,8 +163,8 @@ class DNAVar(object):
"""
"""
Give the HGVS description of the raw variant stored in this class.
Give the HGVS description of the raw variant stored in this class.
:returns: The HGVS description of the raw variant stored in
this class.
:returns
unicode
: The HGVS description of the raw variant stored in
:rtype: unicode
this class.
"""
"""
if
self
.
type
==
'
unknown
'
:
if
self
.
type
==
'
unknown
'
:
return
'
?
'
return
'
?
'
...
@@ -215,31 +202,24 @@ class DNAVar(object):
...
@@ -215,31 +202,24 @@ class DNAVar(object):
class
ProteinVar
(
object
):
class
ProteinVar
(
object
):
"""
"""
Container for a protein variant.
Container for a protein variant.
"""
"""
#NOTE: This is experimental code. It is not used at the moment.
def
__init__
(
self
,
start
=
0
,
end
=
0
,
sample_start
=
0
,
sample_end
=
0
,
def
__init__
(
self
,
start
=
0
,
end
=
0
,
sample_start
=
0
,
sample_end
=
0
,
type
=
'
none
'
,
deleted
=
ISeqList
([
ISeq
()]),
type
=
'
none
'
,
deleted
=
ISeqList
([
ISeq
()]),
inserted
=
ISeqList
([
ISeq
()]),
shift
=
0
,
term
=
0
):
inserted
=
ISeqList
([
ISeq
()]),
shift
=
0
,
term
=
0
):
"""
"""
Initialise the class with the appropriate values.
Initialise the class with the appropriate values.
:arg start: Start position.
:arg int start: Start position.
:type start: int
:arg int end: End position.
:arg end: End position.
:arg int sample_start: Start position.
:type end: int
:arg int sample_end: End position.
:arg sample_start: Start position.
:arg unicode type: Variant type.
:type sample_start: int
:arg unicode deleted: Deleted part of the reference sequence.
:arg sample_end: End position.
:arg ISeqList inserted: Inserted part.
:type sample_end: int
:arg int shift: Amount of freedom.
:arg type: Variant type.
:arg int term: Number of positions until stop codon.
:type type: unicode
:arg deleted: Deleted part of the reference sequence.
:type deleted: unicode
:arg inserted: Inserted part.
:type inserted: object
:arg shift: Amount of freedom.
:type shift: int
:arg term:
:type term:
"""
"""
self
.
start
=
start
self
.
start
=
start
self
.
end
=
end
self
.
end
=
end
...
@@ -257,10 +237,10 @@ class ProteinVar(object):
...
@@ -257,10 +237,10 @@ class ProteinVar(object):
Give the HGVS description of the raw variant stored in this class.
Give the HGVS description of the raw variant stored in this class.
Note that this function relies on the absence of values to make the
Note that this function relies on the absence of values to make the
correct description.
Also see the comment in the class definition
.
correct description.
The method used in the DNAVar is better
.
:returns: The HGVS description of the raw variant stored in
this class.
:returns
unicode
: The HGVS description of the raw variant stored in
:rtype: unicode
this class.
"""
"""
if
self
.
type
==
'
unknown
'
:
if
self
.
type
==
'
unknown
'
:
return
'
?
'
return
'
?
'
...
@@ -278,7 +258,7 @@ class ProteinVar(object):
...
@@ -278,7 +258,7 @@ class ProteinVar(object):
description
+=
'
{}
'
.
format
(
self
.
start
)
description
+=
'
{}
'
.
format
(
self
.
start
)
if
self
.
end
:
if
self
.
end
:
description
+=
'
_{}{}
'
.
format
(
seq3
(
self
.
end_aa
),
self
.
end
)
description
+=
'
_{}{}
'
.
format
(
seq3
(
self
.
end_aa
),
self
.
end
)
if
self
.
type
not
in
[
'
subst
'
,
'
stop
'
,
'
ext
'
,
'
fs
'
]
:
# fs is not a type
if
self
.
type
not
in
(
'
subst
'
,
'
stop
'
,
'
ext
'
,
'
fs
'
)
:
# fs is not a type
description
+=
self
.
type
description
+=
self
.
type
if
self
.
inserted
:
if
self
.
inserted
:
description
+=
'
{}
'
.
format
(
seq3
(
self
.
inserted
))
description
+=
'
{}
'
.
format
(
seq3
(
self
.
inserted
))
...
...
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