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
| ## | |
| ## A script to add permission on a synapse entity | |
| ## for a whole bunch of emails | |
| ############################################################ | |
| import synapseclient | |
| import re, sys | |
| import requests | |
| import json | |
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
| ## Example code for getting gene information from NCBI | |
| ## using EUTILS. | |
| ## To install dependencies: | |
| ## pip install lxml | |
| ## pip install requests | |
| ############################################################ | |
| import requests | |
| from lxml import etree as ET | |
| import re |
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 __future__ import print_function | |
| from __future__ import unicode_literals | |
| import synapseclient | |
| import re | |
| import sys | |
| ## make sure we really want to delete stuff | |
| not_kidding = len(sys.argv) > 1 and sys.argv[1] == '--not-kidding' | |
| if not not_kidding: |
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
| ## | |
| ## Try out support for external file handles in Synapse | |
| ###################################################################### | |
| import synapseclient | |
| from synapseclient.entity import File, Project, Folder | |
| syn = synapseclient.Synapse() | |
| syn.login() | |
| ## create a sandbox project | |
| project = Project('Uniquely named temporary project') |
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 argparse | |
| import os | |
| import shutil | |
| import sys | |
| import synapseclient | |
| from synapseclient import Activity | |
| import synapseclient.version_check as version_check | |
| import signal | |
| import json |
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 filecmp | |
| import os | |
| import random | |
| import synapseclient | |
| from synapseclient import Activity, File, Folder, Project | |
| import uuid | |
| ## create synapse object and log in | |
| syn = synapseclient.Synapse() | |
| syn.login() |
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
| ## Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx | |
| ## where x is any hexadecimal digit and y is one of 8, 9, A, or B | |
| ## e.g., f47ac10b-58cc-4372-a567-0e02b2c3d479 | |
| uuid <- function(uppercase=FALSE) { | |
| hex_digits <- c(as.character(0:9), letters[1:6]) | |
| hex_digits <- if (uppercase) toupper(hex_digits) else hex_digits | |
| y_digits <- hex_digits[9:12] |
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 __future__ import print_function | |
| from IPython.core.magic import (Magics, magics_class, line_magic) | |
| @magics_class | |
| class SynapseMagics(Magics): | |
| """ | |
| IPython magic for Synapse. In an interactive IPython session, you can | |
| conveniently import the key Synapse objects and log in. | |
| To log in as your default user (according to your ~/.synapseCache/.session 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
| ## | |
| ## Collect statistics for auditing Synapse usage and governance | |
| ###################################################################### | |
| import synapseclient | |
| from synapseclient.utils import id_of | |
| from datetime import datetime as Datetime | |
| import re, sys | |
| import requests | |
| ROOT = 'syn4489' |
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 numpy as np | |
| import random | |
| import uuid | |
| import synapseclient | |
| from synapseclient import File, Folder, Project | |
| from synapseclient import Evaluation, Submission, SubmissionStatus | |
| def read_matrix(filepath): |