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
--- | |
title: "AMP-AD Semi-Annual Report" | |
author: "Kenneth Daily" | |
date: "`r format(Sys.time(), '%B %d, %Y')`" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = FALSE, | |
message = 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
library(synapseClient) | |
synapseLogin() | |
table_id <- "syn7871084" | |
fileview_df <- synTableQuery(sprintf('select * from %s', table_id))@values | |
fastq2bam <- fileview_df %>% | |
filter(fileFormat %in% c("fastq", "bam")) %>% # keep fastq and bam | |
# group for cases where there are multiple files per file format | |
group_by(sample_id_biorepository, |
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
class Counter(object): | |
value = 0 | |
def mergeSort(myList): | |
if len(myList) > 1: | |
depth.value += 1 | |
mid = (len(myList) + 1) // 2 | |
left = myList[:mid] | |
right = myList[mid:] |
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
"""Linked list. | |
""" | |
from collections.abc import Sequence | |
import logging | |
logging.basicConfig() | |
logger = logging.getLogger(__name__) | |
logger.setLevel(level=logging.INFO) |
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
"""Bootstrap the components of a project to be used with the GENIE framework. | |
""" | |
import synapseclient | |
import genie | |
import pandas | |
import random | |
import tempfile |
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 using Synapse pre-signed URLs to download directly. | |
This only uses the Synapse Python client to perform the POST operation to get | |
the pre-signed URLs and generate signed headers. The `requests` library is used | |
to fetch the file. | |
""" | |
import synapseclient | |
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
"""Script to remove all artifacts of submissionf for a center. | |
""" | |
import logging | |
import synapseclient | |
import genie.config | |
logging.basicConfig() | |
logger = logging.getLogger(__name__) |

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(tidyr) | |
library(dplyr) | |
library(readr) | |
library(synapser) | |
synLogin() | |
id <- 'syn19034850' | |
obj <- synGet(id) | |
d <- readr::read_csv(obj$path) |
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
# Uses https://gist.github.com/kdaily/fea5b0f72fac1264048e39e6c4d04647#file-query_to_json-py | |
query_to_json.py "select assay,Level,CellLine,DataType from syn18486863" > /tmp/syn18486863_file_annotations.json | |
# uses ajv-cli - https://github.com/jessedc/ajv-cli | |
ajv validate -s file_annotations_file_schema.json -r file_annotation.json -d /tmp/syn18486863_file_annotations.json --errors=line |
NewerOlder