In [1]:
1 + 1
Out[1]:
In [2]:
#import the synapse python API
import synapseclient
from synapseclient import Wiki, File, Project, Folder
%run 'synapse_demo_utils_functions.ipynb'
In [ ]:
#login using locally stored credentials
syn = synapseclient.login()
In [ ]:
myProj = Project(name='Cell Lines Analysis %s' % randomword(5))
myProj = syn.store(myProj)
print 'Created project with synapse id: %s' % myProj.id
In [5]:
#this project was created on synapse website
#myProj = 'synXXX'
#myProj = syn.get(myProj)
In [6]:
projWiki = Wiki(title='Data Summary', owner = myProj )
In [7]:
markdown = '''
* Cell growth look normally distributed
* There is evidence of inverse growth between these two cell lines
'''
projWiki['markdown'] = markdown
projWiki = syn.store(projWiki)
In [ ]:
results_folder = Folder(name='results', parent=myProj)
results_folder = syn.store(results_folder)
raw_data_file = File("data/cell_lines_raw_data.csv", parent=results_folder)
raw_data_file = syn.store(raw_data_file)
In [ ]:
plot1 = File("images/plot_1.png", parent=results_folder)
plot1 = syn.store(plot1)
In [10]:
syn.onweb(myProj)
In [ ]:
used_data = [raw_data_file]
code = ['https://github.com/Sage-Bionetworks/synapseTutorials']
plot2 = File("images/plot_2.png", parent=results_folder)
plot2 = syn.store(plot2, used=used_data, executed=code)
In [14]:
wiki = syn.getWiki(myProj)
md = """
#Cell line analysis
* Cell growth look normally distributed
* There is evidence of inverse growth between these two cell lines
${{image?synapseId={plot1_id}&align=None&scale=50}}
${{image?synapseId={plot2_id}&align=None&scale=50}}
"""
wiki['markdown'] = md.format(plot1_id=plot1.id, plot2_id=plot2.id)
wiki = syn.store(wiki)
In [13]:
syn.onweb(myProj)
In [20]:
syn.delete(myProj)