Commit 87dbfd0d authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-a/update-repseq-vdj-for-mixcr' into 'dev'

Update repseq_vdj for mixcr

See merge request !495
parents dc8209bd d962a3e8
Pipeline #86738 passed with stages
in 6 minutes and 9 seconds
...@@ -92,6 +92,9 @@ class Result(VDJ_Formatter): ...@@ -92,6 +92,9 @@ class Result(VDJ_Formatter):
self.populate() self.populate()
def __contains__ (self, key):
return key in self.d
def __getitem__(self, key): def __getitem__(self, key):
return self.d[key] return self.d[key]
...@@ -155,16 +158,20 @@ class MiXCR_Result(Result): ...@@ -155,16 +158,20 @@ class MiXCR_Result(Result):
return None return None
def populate(self): def populate(self):
self.vdj[V] = [self['Best V hit']] self.vdj[V] = [self['bestVHit']]
if self['Best D hit']: if self['bestDHit']:
self.vdj[D] = [self['Best D hit']] self.vdj[D] = [self['bestDHit']]
self.vdj[J] = [self['Best J hit']] self.vdj[J] = [self['bestJHit']]
self.vdj[N1] = self['N. Seq. VDJunction'] if 'nSeqVDJunction' in self:
self.vdj[N2] = self['N. Seq. DJJunction'] self.vdj[N1] = self['nSeqVDJunction']
self.vdj[N] = self['N. Seq. VJJunction'] if 'nSeqDJJunction' in self:
self.vdj[N2] = self['nSeqDJJunction']
if 'nSeqVJJunction' in self:
self.vdj[N] = self['nSeqVJJunction']
self.vdj[JUNCTION] = self['AA. Seq. CDR3'] if 'aaSeqCDR3' in self:
self.vdj[JUNCTION] = self['aaSeqCDR3']
def header_mixcr_results(ff_mixcr): def header_mixcr_results(ff_mixcr):
...@@ -172,12 +179,12 @@ def header_mixcr_results(ff_mixcr): ...@@ -172,12 +179,12 @@ def header_mixcr_results(ff_mixcr):
f = open(ff_mixcr).__iter__() f = open(ff_mixcr).__iter__()
mixcr_first_line = f.next() mixcr_first_line = f.next()
globals()['mixcr_labels'] = mixcr_first_line.split('\t') globals()['mixcr_labels'] = mixcr_first_line.rstrip().split('\t')
while True: while True:
l = f.next() l = f.next().rstrip()
result = MiXCR_Result(l) result = MiXCR_Result(l)
yield result['Description R1'], result.to_vdj() yield result['descrsR1'], result.to_vdj()
......
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