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(httr2) | |
library(dplyr) | |
library(purrr) | |
library(tibble) | |
library(dplyr) | |
##use this table to find your bert_grouped_disease_id | |
get_disease_map <- function(url = "http://txgnn.org/txgnn_data_v2/node_name_dict.json"){ | |
id_map <- jsonlite::read_json(url) | |
dis_map <- id_map$disease %>% |
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 | |
import pandas as pd | |
# Constants for the views | |
FILE_VIEW_ID = "syn16858331" | |
PROJECT_VIEW_ID = "syn52677631" | |
def main(): | |
syn = synapseclient.Synapse() | |
syn.login('YourUsername', 'YourPassword', rememberMe=True) |
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
## prjna612365 | |
for i in SRR11635884 SRR11635885 SRR11635886 SRR11635887 SRR11635888 SRR11635889 SRR11635890 SRR11635891 SRR11635892 SRR11635893 SRR11635894 SRR11635895 SRR11635896 SRR11635897 SRR11635898 SRR11635899 SRR11635900 SRR11635901 SRR11635902 SRR11635903 SRR11635904 SRR11635905 SRR11635906 SRR11635907 SRR11635908 SRR11635909 SRR11635910 SRR11635911 SRR11635912 SRR11635913 SRR11635914 SRR11635915 SRR11635916 SRR11635917 SRR11635918 SRR11635919 SRR11635920 SRR11635921 SRR11635922 SRR11635923 SRR11635924 SRR11635925 SRR11635926 SRR11635927 SRR11635928 SRR11635929 SRR11635930 SRR11635931 SRR11635932 SRR11635933 SRR11635934 SRR11635935 SRR11635936 SRR11635937 SRR11635938 SRR11635939 SRR11635940 SRR11635941 SRR11635942 SRR11635943 SRR11635944 SRR11635945 SRR11635946 SRR11635947 SRR11635948 SRR11635949 SRR11635950 SRR11635951 SRR11635952 SRR11635953 SRR11635954 SRR11635955 SRR11635956 SRR11635957 SRR11635958 SRR11635959 SRR11635960 SRR11635961 SRR11635962 SRR11635963 SRR11635964 SRR11635965 SRR11635966 SRR |
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(googlesheets4) | |
gs4_auth() | |
convert_colname_to_camelcase <- function(ss_url) { | |
# Read the sheet | |
ss_data <- range_read(ss_url, n_max = 0) | |
colnames(ss_data)[colnames(ss_data)!="Component"] <- sapply(colnames(ss_data)[colnames(ss_data)!="Component"], stringr::str_replace, "_", " ") | |
# Convert column names to camelCase |
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(ggplot2) | |
library(synapser) | |
library(lubridate) | |
library(tidyverse) | |
##datetime in unix time, integer | |
after_date <- 1704067200L | |
synLogin() |
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(synapser) | |
library(googledrive) | |
library(googlesheets4) | |
library(tidyverse) | |
library(jsonlite) | |
gs4_auth() | |
synLogin() | |
goog_dir <- 'https://drive.google.com/drive/u/1/folders/1yblPMk-kgMj5KJi7P0AFOobZ9vkl6Nkk' | |
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(googlesheets4) | |
library(nfportalutils) | |
submit_gs_to_api <- function(sheet_id, | |
schema_url) { | |
# Retrieve the Google Sheets document | |
sheet <- googlesheets4::gs4_get(sheet_id) | |
# Extract the workbook name and remove '.manifest' and split it on the underscore ("_") | |
workbook_name <- sheet$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(googlesheets4) | |
gs4_auth() | |
convert_colname_to_camelcase <- function(ss_url) { | |
# Read the sheet | |
ss_data <- range_read(ss_url, n_max = 0) | |
colnames(ss_data)[colnames(ss_data)!="Component"] <- sapply(colnames(ss_data)[colnames(ss_data)!="Component"], stringr::str_replace, "_", "") | |
# Convert column names to camelCase |
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(synapser) | |
library(tidyverse) | |
synLogin() | |
rename_columns <- function(data_frame, column_name_mapping) { | |
# Renaming the columns using dplyr | |
data_frame <- data_frame %>% | |
rename(!!!column_name_mapping) | |
# Return the modified data frame |
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(synapser) | |
library(dplyr) | |
synLogin() | |
##query for files for manifest | |
query <- "SELECT id, specimenID, readPair FROM syn51907744 where fileFormat = 'fastq'" | |
key <- "readPair" | |
value <- "id" | |
res <- synTableQuery(query, includeRowIdAndRowVersion = F)$asDataFrame() |
NewerOlder