tb-host-dashboard/global.R

29 lines
1.2 KiB
R

library(dplyr)
library(DT)
library(ggplot2)
library(grid) # for the info box
library(plotly)
library(NGLVieweR)
library(httr)
library(readr)
library(RCurl)
# make shiny non-stupid
#options(shiny.launch.browser = FALSE) # i am a big girl and can tie my own laces
#options(shiny.port = 8000) # don't change the port every time
#options(shiny.host = '0.0.0.0') # This means "listen to all addresses on all interfaces"
options(DT.options = list(scrollX = TRUE))
# An "application token" is required here. I generated this one like this:
# curl -H "Content-Type: application/json" -d '{"name":"r-data"}' -u <username>:<password> https://git.tunstall.in/api/v1/users/sethp/tokens
# Gitea access token
access_token = read_lines("~/secret-token")
gene_url = "https://git.tunstall.in/api/v1/repos/tanu/fellowship_dcdf/raw/tb_data_fc/data_dashboard/list_unique_missense_genes.csv"
missense_gene_url = "https://git.tunstall.in/api/v1/repos/tanu/fellowship_dcdf/raw/tb_data_fc/data_dashboard/missense_genes_params.csv"
alphafold_url = "https://alphafold.ebi.ac.uk/files/"
genes=read_csv(paste0(gene_url,"?token=",access_token))
unique_missense_genes = read_delim(paste0(missense_gene_url,"?token=",access_token))