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
| import json | |
| ## First we'll create a terms-of-use object that refers to the participant | |
| ## team for the challenge, which in this case has ID 3328713. The termsOfUse | |
| ## contains the HTML that will be displayed in a panel of the registration | |
| ## wizard. | |
| ## http://rest.synapse.org/org/sagebionetworks/repo/model/AccessRequirement.html | |
| tou = { | |
| 'accessType': 'PARTICIPATE', | |
| 'concreteType': 'org.sagebionetworks.repo.model.TermsOfUseAccessRequirement', |
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
| ## SMC-DNA challenges are configured by entries in the table smc-dna-config, | |
| ## which lives in the MutationCallingChallengeStaging project, here: | |
| ## https://www.synapse.org/#!Synapse:syn4686078 | |
| ## To add a new sample: | |
| ## create new evaluation queue (one for each of SNV, SV and possibly indel) | |
| evaluation_snv = syn.store(Evaluation( | |
| name="synthetic.challenge.set6.snv", |
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
| ##========================================================== | |
| ## Tables Pipeline Example | |
| ## | |
| ## An example of using Synapse tables to store raw data and | |
| ## intermediate steps to extract features for downstream | |
| ## analysis | |
| ##========================================================== | |
| import synapseclient | |
| from synapseclient import Activity | |
| from synapseclient import Entity, Project, Folder, 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
| library(plyr) | |
| library(synapseClient) | |
| synapseLogin('chris.bare') | |
| ## Q1a = 3317421, Q1b = 3317433, Q2 = 3317446 | |
| ## https://www.synapse.org/#!Synapse:syn2762531/wiki/72477 | |
| ## metrics in the query may need to change for different questions | |
| eid = '3317421' |
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
| #!/usr/bin/env python | |
| """ | |
| Recursively upload a directory structure to a Synapse project (synapse.org). | |
| Examples:: | |
| synapse_upload_directory_tree <PROJECT ID> -user <EMAIL> --pass <PASS> --top <TOP DIRECTORY> | |
| synapse_upload_directory_tree syn3207152 --user [email protected] --pass XXXXXX --top brains | |
| synapse_upload_directory_tree syn3207152 --user [email protected] |
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
| import synapseclient | |
| syn = synapseclient.Synapse() | |
| syn.login() | |
| ## create the entity | |
| e = syn.store(File("http://google.com/", name="google", parent="syn3361147", synapseStore=False)) | |
| ## should work, but doesn't | |
| ## e = syn.store(File("http://google.com/testing1", name="google", parent="syn3361147"), synapseStore=False) |
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
| import synapseclient | |
| from synapseclient.exceptions import SynapseError | |
| team_id = "3325290" | |
| approved_participant_ids = ["377358", "3321663"] | |
| syn = synapseclient.Synapse() | |
| ## log in using cached API key. |
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
| from itertools import izip | |
| import argparse | |
| import os | |
| import re | |
| import sys | |
| import synapseclient | |
| import synapseclient.utils as utils | |
| from synapseclient import Project, File, Folder, Activity | |
| from synapseclient import Schema, Column, Table, Row, RowSet, as_table_columns | |
| import pandas as pd |
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
| import synapseclient | |
| syn = synapseclient.Synapse() | |
| syn.login() | |
| # ID for challenge participants team | |
| team_id = ?? | |
| results = list(syn._GET_paginated('/teamMembers/{id}'.format(id=team_id))) | |
| print "Number of participants:", len(results) |
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
| ################################################################ | |
| ## get submissions and metadata for Synthetic challenge 4 | |
| ################################################################ | |
| import synapseclient | |
| from synapseclient import Activity | |
| from synapseclient import Entity, Project, Folder, File | |
| from synapseclient import Evaluation, Submission, SubmissionStatus | |
| import os | |
| import pandas as pd |