Skip to content

Commit

Permalink
Debugged issue where get_phenos_in_region function would fail when qu…
Browse files Browse the repository at this point in the history
…ery region is greater than 10Mb
  • Loading branch information
youngchanpark committed Sep 2, 2021
1 parent 6d1b3cf commit d8989f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions peakplotter/_interactive_manh.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,15 @@ def get_variants_in_region(chrom, start, end, server) -> pd.DataFrame:


def get_phenos_in_region(chrom, start, end, server) -> pd.DataFrame:
url = f'{server}/phenotype/region/homo_sapiens/{chrom}:{start}-{end}?feature_type=Variation'
json_data = _query(url)
if end - start > _ENSEMBL_MAX:
parts = _divide_query_parts(start, end)
json_data = list()
for (start, end) in parts:
url = f'{server}/phenotype/region/homo_sapiens/{chrom}:{start}-{end}?feature_type=Variation'
json_data.extend(_query(url))
else:
url = f'{server}/phenotype/region/homo_sapiens/{chrom}:{start}-{end}?feature_type=Variation'
json_data = _query(url)

pheno = _process_pheno_r(json_data)

Expand Down

0 comments on commit d8989f1

Please sign in to comment.