In [4]:
!encode explore
In [5]:
object_count()
In [83]:
n = 4
In [7]:
s = 'string!'
In [8]:
# This is a list of numbers.
x = [4, 6, 8]
# This is a list of strings.
x = ['string!', 'string!', 'string!']
In [9]:
d = {'use me': 'to find me'}
# Use key to find value.
d['use me']
Out[9]:
Three Examples
In [84]:
o = {'first_level': {'second_level': {'third_level': 'nested_value'}}}
print(json.dumps(o, indent=4))
In [11]:
o = {'list_of_objects': [{'thing': 'value_of_thing1'},
{'thing': 'value_of_thing2'},
{'thing': ['multiple', 'values', 'of', 'thing3',
['including', 'this', 'sublist']]}]}
print(json.dumps(o, indent=4))
In [12]:
!encode get ENCGM330VHI
Three tools in particular for C.R.U.(D.):
In [23]:
keypairs = !cat keypairs_template.json
print(json.dumps(json.loads(keypairs[0]), indent=4, sort_keys=True))
Example for genetic modification
In [176]:
!encode explore --field GeneticModification.properties
In [101]:
!encode explore --field GeneticModification.required
In [102]:
!encode explore --field GeneticModification.properties.category.enum
In [35]:
!encode explore --field GeneticModification.properties.purpose.enum
In [36]:
!encode explore --field GeneticModification.properties.method.enum
In [81]:
!python ENCODE_import_data.py prez/create_object.xlsx --key test --update
In [73]:
!encode explore --field GeneticModification.dependencies
In [85]:
!python ENCODE_import_data.py prez/create_object1.xlsx --key test --update
In [90]:
!encode explore --field GeneticModification.properties.lab.type
In [88]:
!encode explore --field GeneticModification.properties.aliases.type
In [100]:
!python ENCODE_import_data.py prez/reagents_list.xlsx --key test
In [104]:
!python ENCODE_import_data.py --help
In [112]:
!python ENCODE_import_data.py prez/create_object1.xlsx --key bad_test --update
Response code = {"description": "This server could not verify that you are authorized to access the document you requested."}
In [108]:
!python ENCODE_import_data.py prez/create_object_err_1.xlsx --key test --update
"errors": [{"description": "Additional properties are not allowed ('catgory' was unexpected)"}]
In [109]:
!python ENCODE_import_data.py prez/create_object_err_2.xlsx --key test --update
"errors": [{"description": "'blending' is not one of ['bombardment', 'CRISPR', 'microinjection', 'mutagen treatment', 'RNAi', 'site-specific recombination', 'stable transfection', 'TALEN', 'transduction', 'transient transfection']"}]
In [123]:
!python ENCODE_patch_set.py --key test --accession TSTGM949276 --field award --data /awards/UM1HG009411/ --update
In [129]:
!python ENCODE_get_fields.py --key test --infile TSTGM949276 --field award,status
In [165]:
data = !python ENCODE_get_fields.py --key test --infile TSTGM949276 --allfields
pd.read_table(StringIO('\n'.join(data))).dropna(axis=1)
Out[165]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [162]:
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
import numpy as np
import json
import os
import pandas as pd
import requests
import seaborn as sns
from io import StringIO
from jupyterthemes import jtplot
jtplot.style()
In [172]:
count_by_object = [
('Library', 25297),
('Experiment', 14348),
('Document', 9894),
('QualityMetric', 124128),
('File', 353847),
('AnalysisStepRun', 113789),
('SamtoolsFlagstatsQualityMetric', 72999),
('Biosample', 11453),
('Replicate', 25936),
('ChipSeqFilterQualityMetric', 19074)
]
def object_count():
df = pd.DataFrame(count_by_object)
df = df.rename(columns={0: 'name', 1: 'value'})
sns.barplot(y='name', x='value', data=df)
ax = sns.plt.gca()
ax.set(ylabel='', xlabel='')
sns.despine(bottom=True)
In [ ]:
In [ ]:
In [ ]: