Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
31ea5d70
Commit
31ea5d70
authored
Nov 10, 2016
by
Mathieu Giraud
Browse files
imgt-to-vdj.py: extract Result() from IMGT_VQUEST_Result()
parent
8877bab6
Changes
1
Hide whitespace changes
Inline
Side-by-side
algo/tests/imgt-to-vdj.py
View file @
31ea5d70
...
...
@@ -31,26 +31,32 @@ def parse_gene_and_allele_to_vdj(s):
return
'(%s)'
%
','
.
join
(
genes
)
class
IMGT_VQUEST_Result
():
'''Stores a IMGT/V-QUEST result'''
class
Result
():
'''Stores a tabulated result'''
def
__init__
(
self
,
l
):
self
.
d
=
{}
if
'No result'
in
l
:
self
.
result
=
False
return
self
.
result
=
True
self
.
result
=
self
.
parse
(
l
)
for
i
,
data
in
enumerate
(
l
.
split
(
'
\t
'
)):
self
.
d
[
vquest_
labels
[
i
]]
=
data
self
.
d
[
self
.
labels
[
i
]]
=
data
def
__getitem__
(
self
,
key
):
return
self
.
d
[
key
]
def
__str__
(
self
):
return
str
(
self
.
d
)
class
IMGT_VQUEST_Result
(
Result
):
'''Stores a IMGT/V-QUEST result'''
def
parse
(
self
,
l
):
self
.
labels
=
vquest_labels
return
(
'No result'
not
in
l
)
def
to_vdj
(
self
):
if
not
self
.
result
:
...
...
@@ -65,9 +71,6 @@ class IMGT_VQUEST_Result():
return
s
def
__str__
(
self
):
return
str
(
self
.
d
)
def
header_vquest_results
(
ff_fasta
,
ff_vquest
):
f_fasta
=
open
(
ff_fasta
).
__iter__
()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment