Exemple #1
0
 def get(self, rs_id):
     """
     Get all SNPs by rs-ID short info
     """
     all_args = pagination_parser.parse_args()
     filters = self.release_service.get_filters_by_rs_id(rs_id) + \
         self.release_service.get_filters_by_fdr(default_fdr_tr(int(self.used_release.version)))
     result = self.paginate(all_args, extra_filters=filters)
     return {
         'results': result,
         'total': self.items_count(extra_filters=filters)
     }
Exemple #2
0
            def get(self, gene_id):
                """
                Get all SNPs by eqtl target gene encode id short info
                """
                all_args = pagination_parser.parse_args()
                gene = self.release_service.get_gene_by_id(gene_id)
                if gene is None:
                    return {'results': [], 'gene': None, 'total': 0}
                gene.locus_start, gene.locus_end = self.release_service.get_gene_locus(
                    gene)
                filters = self.release_service.get_filters_by_eqtl_gene(gene) + \
                    self.release_service.get_filters_by_fdr(default_fdr_tr(int(self.used_release.version)))
                result = self.paginate(all_args, extra_filters=filters)

                return {
                    'results': result,
                    'gene': gene,
                    'total': self.items_count(extra_filters=filters)
                }