databio / bbconf

Configuration package for bedbase project
https://pypi.org/project/bbconf/
BSD 2-Clause "Simplified" License
1 stars 2 forks source link

bbconf search object #1

Closed joseverdezoto closed 4 years ago

joseverdezoto commented 4 years ago

Could you post an example of what the bbconf search response object looks like? I'm trying to figure out how to iterate through it to get the stats and file path. I tried running the updated version of bedstat but the bbconf package can't yet be installed. If I remember correctly from our last conversation, it was something like es[i]['bedfile_path'], es[i]['gc_content'], es[i]['genomic_partitions'], etc right?

stolarczyk commented 4 years ago

yes, that's exactly how it works. The object returned by the search method is a list of dicts:

In [10]: bbc.search_bedfiles(query={ 
    ...:   "bool": { 
    ...:     "must": [ 
    ...:       { 
    ...:         "term": { 
    ...:           "GC_content": 0.66
    ...:         } 
    ...:       } 
    ...:     ] 
    ...:   } 
    ...: })                                                                                                                                                                                               
Out[10]: 
[{'id': ['ews4'],
  'GC_content': [1],
  'number_of_regions': [3617972],
  'mean_absoulute_TSS_distance': [81320.55],
  'genomic_partitions': [{'partition': 'exon', 'Freq': 356117, 'Perc': 0.0984},
   {'partition': 'intergenic', 'Freq': 2348232, 'Perc': 0.649},
   {'partition': 'intron', 'Freq': 722438, 'Perc': 0.1997},
   {'partition': 'promoterCore', 'Freq': 38131, 'Perc': 0.0105},
   {'partition': 'promoterProx', 'Freq': 153054, 'Perc': 0.0423}],
  'md5sum': ['602728f05db6057b4183a0787e843f10'],
  'plots': [{'name': 'tssdist', 'caption': 'Region-TSS distance distribution'},
   {'name': 'chrombins', 'caption': 'Regions distribution over chromosomes'},
   {'name': 'gccontent', 'caption': 'GC content'},
   {'name': 'partitions',
    'caption': 'Regions distribution over genomic partitions'}],
  'bedfile_path': ['/Users/mstolarczyk/Desktop/bedmaker_output/ews4.bed.gz']}]
joseverdezoto commented 4 years ago

awesome, that's exactly what I needed. I'm going over the documentation to incorporate the bbconf functions but let me know when the package is ready for installation :)

joseverdezoto commented 4 years ago

@stolarczyk just noticed a super small typo in one of the keys of the search object : mean_absoulute_TSS_distance