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
| # test param: | |
| token="cnv" | |
| iclr_appsession="688128634" | |
| wgs_appsession="686817159" | |
| echo "USAGE:" | |
| echo "get_bam_url_iclr <bssh_profile_name> <bssh_iclr_appsession_id>, e.g. get_bam_url_iclr cnv 688128634" | |
| echo "get_bam_url_wgs <bssh_profile_name> <bssh_wgs_appsession_id>, e.g. get_bam_url_wgs cnv 686817159" | |
| get_bam_url_iclr() { |
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 pandas as pd | |
| import subprocess | |
| import numpy as np | |
| import sys | |
| def interval_divider(bai_path, bam_path=None, N=123): | |
| # get reference length and formal contig name | |
| x = subprocess.check_output("samtools idxstats " + bai_path[:-4], shell=True) | |
| ref_df = pd.DataFrame([a.split('\t') for a in x.decode().rstrip().split("\n")]).rename(columns={0: "chr", 1: "length"}) |
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 igv_remote as ir | |
| import keyboard | |
| import numpy as np | |
| import pandas as pd | |
| cohort = "BRCA" | |
| print("cohort: {}".format(cohort)) | |
| # generate localhost http format | |
| def format(uuid): | |
| return("http://localhost:5000/" + uuid + ".bam") |
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
| #' better display and logging backend | |
| #' | |
| #' @param expr expression to evalutate | |
| #' @param tag_width The width of display box of the message tag | |
| #' @param path where the message goes, default to `stdout()` | |
| #' @param save_conditions if `TRUE`, all conditions will be saved to a list | |
| #' @param quiet if `TRUE`, all messages (error excluded) will be suppressed | |
| #' @examples | |
| #' test_function <- function(){ |
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(dplyr) | |
| # generate a raw dataframe for all chosen N, p, p1, p2 | |
| df_root = expand.grid(N = c(20, 50, 100), | |
| p = seq(from = 0.1, to = 0.9, by = 0.1), | |
| p1 = seq(from = 0.1, to = 0.9, by = 0.1), | |
| p2 = seq(from = 0.1, to = 0.9, by = 0.1)) | |
| # number of replicates for | |
| nsim <- 200 |
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(dplyr) | |
| # generate a raw dataframe for all chosen N, p, p1, p2 | |
| df_root = expand.grid(N = c(20, 50, 100), | |
| p = seq(from = 0.1, to = 0.9, by = 0.1), | |
| p1 = seq(from = 0.1, to = 0.9, by = 0.1), | |
| p2 = seq(from = 0.1, to = 0.9, by = 0.1)) | |
| # number of replicates for | |
| nsim <- 200 |
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(readr) | |
| library(dplyr) | |
| reader_raw <- read_tsv("RMBase_hg19_all_mod_RBP_reader.txt", comment = "#", skip = 1, col_names = coln, na = "") | |
| coln <- c("chromosome", "modStart", "modEnd", "modId", "score", "strand", "modName", "modType", | |
| "supportNum", "supportList", "pubmedIds", "geneName", "geneType", "region", "sequence", | |
| "RBPname", "clipExpNum", "clipExplist", "RBPtype") |
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
| # loop around different ranks | |
| rank_universe <- 2:8 | |
| coph <- vector("list", length(rank_universe)) | |
| cls <- vector("list", length(rank_universe)) | |
| # the short version | |
| sm_short <- filter_site_and_genes(sm, reader_sites$modId) | |
| # set the parallel prarams | |
| .assign_metagene <- function(m){ |
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(methods) | |
| library(readr) | |
| library(Matrix) | |
| library(foreach) | |
| library(iterators) | |
| library(doParallel) | |
| library(dplyr) | |
| # this a universal script for doparallel | |
| # never forget to stop the clusters in the end fo main scripts. |
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
| ## ---------- params set ------------- | |
| # define core nums to use when use foreach | |
| no_cores <- 10 | |
| # relative importance(higher = more on prior info) | |
| alpha = 0.5 | |
| ## ----------- load dataset -------------- | |
| # load dataset and assign variables | |
| W <- readRDS("string_ppi.rds") |
NewerOlder