scout/adapter/mongo/variant.py
def variant(self, document_id, gene_panels=None, case_id=None):
        """Returns the specified variant.

           Arguments:
               document_id : A md5 key that represents the variant or "variant_id"
               gene_panels(List[GenePanel])
               case_id (str): case id (will search with "variant_id")

           Returns:
               variant_object(Variant): A odm variant object
        """
        query = {}
        if case_id:
            # search for a variant in a case
            query['case_id'] = case_id
            query['variant_id'] = document_id
        else:
            # search with a unique id
            query['_id'] = document_id

        variant_obj = self.variant_collection.find_one(query)
        if variant_obj:
            variant_obj = self.add_gene_info(variant_obj, gene_panels)
            if variant_obj['chromosome'] in ['X', 'Y']:
                ## TODO add the build here
                variant_obj['is_par'] = is_par(variant_obj['chromosome'],
                                               variant_obj['position'])
        return variant_obj
def variant(self, document_id, gene_panels=None, case_id=None):
        query = {}
        if case_id:
            # search for a variant in a case
            query['case_id'] = case_id
            query['variant_id'] = document_id
        else:
            # search with a unique id
            query['_id'] = document_id

        variant_obj = self.variant_collection.find_one(query)
        if variant_obj:
            variant_obj = self.add_gene_info(variant_obj, gene_panels)
            if variant_obj['chromosome'] in ['X', 'Y']:
                ## TODO add the build here
                variant_obj['is_par'] = is_par(variant_obj['chromosome'],
                                               variant_obj['position'])
        return variant_obj
def variant ( self , document_id , gene_panels = None , case_id = None ) : query = { } if case_id : # search for a variant in a case query [ 'case_id' ] = case_id query [ 'variant_id' ] = document_id else : # search with a unique id query [ '_id' ] = document_id variant_obj = self . variant_collection . find_one ( query ) if variant_obj : variant_obj = self . add_gene_info ( variant_obj , gene_panels ) if variant_obj [ 'chromosome' ] in [ 'X' , 'Y' ] : ## TODO add the build here variant_obj [ 'is_par' ] = is_par ( variant_obj [ 'chromosome' ] , variant_obj [ 'position' ] ) return variant_obj
Returns the specified variant.

           Arguments:
               document_id : A md5 key that represents the variant or "variant_id"
               gene_panels(List[GenePanel])
               case_id (str): case id (will search with "variant_id")

           Returns:
               variant_object(Variant): A odm variant object
Returns the specified variant .