Commit 31ea5d70 authored by Mathieu Giraud's avatar Mathieu Giraud

imgt-to-vdj.py: extract Result() from IMGT_VQUEST_Result()

parent 8877bab6
......@@ -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__()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment