Example #1
0
 def transform_incoming(self, son, collection):
     for (key, value) in son.items():
         if isinstance(value, SeqRecord):
             son[key] = simplifySeqRecord(value)
         elif isinstance(value, dict):
             son[key] = self.transform_incoming(value, collection)
     return son
Example #2
0
File: mongo.py Project: hjanime/vdj
 def transform_incoming(self,son,collection):
     for (key,value) in son.items():
         if isinstance(value,SeqRecord):
             son[key] = simplifySeqRecord(value)
         elif isinstance(value,dict):
             son[key] = self.transform_incoming(value,collection)
     return son
Example #3
0
File: mongo.py Project: hjanime/vdj
def encode_chain(chain):
    document = simplifySeqRecord(chain)
    if hasattr(chain,'v'): document['v'] = chain.v
    if hasattr(chain,'d'): document['d'] = chain.d
    if hasattr(chain,'j'): document['j'] = chain.j
    if hasattr(chain,'junction_nt'): document['junction_nt'] = chain.junction_nt
    if hasattr(chain,'junction_aa'): document['junction_aa'] = chain.junction_aa
    if hasattr(chain,'num_mutations'): document['num_mutations'] = chain.num_mutations
    return document
Example #4
0
def encode_chain(chain):
    document = simplifySeqRecord(chain)
    if hasattr(chain, 'v'): document['v'] = chain.v
    if hasattr(chain, 'd'): document['d'] = chain.d
    if hasattr(chain, 'j'): document['j'] = chain.j
    if hasattr(chain, 'junction_nt'):
        document['junction_nt'] = chain.junction_nt
    if hasattr(chain, 'junction_aa'):
        document['junction_aa'] = chain.junction_aa
    if hasattr(chain, 'num_mutations'):
        document['num_mutations'] = chain.num_mutations
    return document