This file contains 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
#!/usr/bin/env python3 | |
import pysam | |
from collections import defaultdict | |
import subprocess | |
import click | |
from pathlib import Path | |
import pandas as pd | |
import numpy as np | |
from sys import stderr |
This file contains 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 fastq_downloader.helper import construct_gsm_dict, download_and_verify, rename_files_by_run, merge_files | |
from fastq_downloader.helper.construct_gsm_dict import infotsv_to_dict, parse_acc_type | |
from fastq_downloader.helper.download_and_verify import ( | |
download_and_verify__, | |
check_file, | |
) | |
from fastq_downloader.helper.rename_files_by_run import ( | |
write_filename_to_dict, | |
actual_rename, | |
) |
This file contains 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
#!python3 | |
import click | |
import random | |
def read_chrom_size(chrom_size): | |
chrom_size_dict = {} | |
with open(chrom_size) as f: | |
for line in f: | |
line = line.strip().split() |
This file contains 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
# save this script somewhere and invoke it in shell.nix shellHook | |
# it will read current r and radian path and write it to vscode | |
# workspace settings | |
# jq required | |
settings=.vscode/settings.json | |
mkdir -p .vscode | |
echo '{}' > $settings | |
rpath_exsits=$(cat $settings|jq '."r.rpath.linux"') | |
rterm_exsits=$(cat $settings|jq '."r.rterm.linux"') | |
not_exsist="null" |
This file contains 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
#!/usr/bin/env Rscript | |
suppressPackageStartupMessages({ | |
library(tidyverse) | |
}) | |
args <- commandArgs(trailingOnly = TRUE) | |
bed <- args[1] | |
distshift <- args[2] %>% as.numeric() | |
chromsize <- args[3] | |
# debug only |
This file contains 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
bedcolname<- c( | |
"seqnames", | |
"start", | |
"end", | |
"name", | |
"score", | |
"strand" | |
) |
This file contains 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
#!/usr/bin/env python3 | |
import httpx | |
from bs4 import BeautifulSoup as bs | |
from xml.etree import ElementTree as ET | |
import click | |
import re | |
# see https://blog.tpob.xyz/2021/10/14/%E6%9B%B4%E5%BF%AB%E8%8E%B7%E5%BE%97srr-accession/ | |
# for more information |
This file contains 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
readComputeMatrixResult<-function(dfPath,offset=6){ | |
library(rjson) | |
library(tidyverse) | |
df<-read_tsv(file=dfPath,col_names=F,col_types=cols(),skip=1) | |
metadata<-readLines(gzfile(dfPath),1)%>%str_remove("^@")%>%fromJSON(json_str=.) | |
dfSplited<-list() | |
for(i in 1:length(metadata$sample_labels)){ | |
dfSplited<-c( | |
dfSplited, |
This file contains 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
#!/bin/env python3 | |
## the reason why i use urllib is to minimize dependency requiremnts | |
## the reason i dont user serverchan (https://sc.ftqq.com/) is that i want a multiuser support | |
from urllib import request | |
import sys | |
import json | |
## Please Change xxxxxx to the value you have | |
CORPID="xxxxxx" | |
MSGSECRET="xxxxxx" |
This file contains 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
@namespace url(http://www.w3.org/1999/xhtml); | |
/*! | |
* custom-yahei-family.css | |
* https://n2o.io/go?page=custom.css | |
* | |
* Copyright 2018 Francis Zhao <francis@n2o.io> | |
* https://n2o.io/license | |
* | |
* Date: 2018-03-11T15:00+06:00 |