Created
March 6, 2018 15:22
-
-
Save cplaisier/ecdc5c3a09559bc484d460f38a9ffd2d to your computer and use it in GitHub Desktop.
Loading the TFBSDB JSON file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Loading JSON file | |
| # https://www.safaribooksonline.com/library/view/python-cookbook-3rd/9781449357337/ch06s02.html | |
| # Example: | |
| # import json | |
| # | |
| # # Reading data back | |
| # with open('data.json', 'r') as f: | |
| # data = json.load(f) | |
| import json | |
| # Reading data back | |
| with open('tfbsDb_plus_and_minus_5000_entrez.json', 'r') as f: | |
| tfbsDb = json.load(f) | |
| # Sample of keys in tfbsDb | |
| print(tfbsDb.keys()[0:5]) | |
| # Sample of values | |
| print(tfbsDb[tfbsDb.keys()[0]][0:5]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment