Skip to content

Instantly share code, notes, and snippets.

@fo40225
fo40225 / VEP.sh
Last active January 12, 2024 07:16
run Variant Effect Predictor
# ubuntu
sudo apt install -y build-essential unzip parallel curl git zlib1g-dev libbz2-dev liblzma-dev libncurses5-dev libperl-dev libgsl-dev
sudo cpan DBI Try::Tiny LWP::Simple Set::IntervalTree PerlIO::gzip
# windows ActivePerl 5.24 https://downloads.activestate.com/ActivePerl/releases/5.24.3.2404/ActivePerl-5.24.3.2404-MSWin32-x64-404865.exe
# ppm install Set-IntervalTree
# https://www.activestate.com/blog/goodbye-ppm-hello-state-tool
# http://strawberryperl.com/download/5.32.0.1/strawberry-perl-5.32.0.1-64bit.msi
cpan Set::IntervalTree
@fo40225
fo40225 / tf_var.txt
Last active September 7, 2023 23:52
some environment variables of tensorflow
# 1.12.0 prevent VRAM occupied
export TF_FORCE_GPU_ALLOW_GROWTH="true"
# <1.12
from keras import backend as K
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config)
@fo40225
fo40225 / annovar.sh
Last active August 22, 2023 21:25
annovar + intervar
wget http://www.openbioinformatics.org/annovar/download/0wgxR2rIVP/annovar.latest.tar.gz
tar axvf annovar.latest.tar.gz
cd annovar
perl annotate_variation.pl --downdb --webfrom annovar --buildver hg19 refGene humandb/
perl annotate_variation.pl --downdb --webfrom annovar --buildver hg19 refGeneWithVer humandb/
#perl annotate_variation.pl --downdb --webfrom ucsc --buildver hg19 refGene humandb/
#perl annotate_variation.pl --buildver hg19 --downdb seq humandb/hg19_seq
#perl retrieve_seq_from_fasta.pl humandb/hg19_refGene.txt -seqdir humandb/hg19_seq -format refGene -outfile humandb/hg19_refGeneMrna.fa
perl annotate_variation.pl --downdb --webfrom annovar --buildver hg19 1000g2015aug humandb/
@fo40225
fo40225 / ubuntu1804cuda10.sh
Last active August 22, 2023 19:18
install cuda 10 on ubuntu 18.04
# echo "blacklist nouveau" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf > /dev/null
# echo "options nouveau modeset=0" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf > /dev/null
# sudo update-initramfs -u
sudo apt update
sudo apt -y install build-essential
sudo apt update
sudo apt -y install linux-headers-$(uname -r)
@fo40225
fo40225 / rgi.sh
Created November 21, 2022 07:23
run rgi (Resistance Gene Identifier)
pip install biopython==1.78
sudo apt install -y prodigal
# PATH need contain diamond, blast, kma, samtools, bamtools, bedtools2
git clone https://github.com/arpcard/rgi.git -b 6.0.1
cd rgi
# app/Diamond.py
@fo40225
fo40225 / run.sh
Last active November 2, 2022 07:21
Use kraken2, KronaTools to analysis DNA NGS metagenomics
cd ~
git clone https://github.com/DerrickWood/kraken2.git -b v2.1.2
cd kraken2/
./install_kraken2.sh bin
~/kraken2/bin/kraken2-build --download-taxonomy --protein --db db_protein
#~/kraken2/bin/kraken2-build --download-library human --protein --db db_protein
~/kraken2/bin/kraken2-build --download-library archaea --protein --db db_protein
~/kraken2/bin/kraken2-build --download-library bacteria --protein --db db_protein
@fo40225
fo40225 / tmpfs.log
Created August 24, 2019 04:15
linux tmpfs test 9980xe DDR4-2666 quad channel
user@ubuntu:/dev/shm$ ~/fio/fio --loops=5 --size=1g --runtime=10 --stonewall --direct=0 --group_reporting \
--name=SeqQ32T1read --bs=128k --iodepth=32 --rw=read \
--name=SeqQ32T1write --bs=128k --iodepth=32 --rw=write \
--name=4kQ8T8read --bs=4k --iodepth=8 --numjobs=8 --rw=randread \
--name=4kQ8T8write --bs=4k --iodepth=8 --numjobs=8 --rw=randwrite \
--name=4kQ32T1read --bs=4k --iodepth=32 --rw=randread \
--name=4kQ32T1write --bs=4k --iodepth=32 --rw=randwrite \
--name=4kQ1T1read --bs=4k --iodepth=1 --rw=randread \
--name=4kQ1T1write --bs=4k --iodepth=1 --rw=randwrite
SeqQ32T1read: (g=0): rw=read, bs=(R) 128KiB-128KiB, (W) 128KiB-128KiB, (T) 128KiB-128KiB, ioengine=psync, iodepth=32
@fo40225
fo40225 / fio.sh
Last active June 24, 2022 16:12
run fio as CrystalDiskMark
# CrystalDiskMark 8 NVMe
fio --loops=5 --size=1g --runtime=5 --time_based=1 --stonewall --direct=1 --group_reporting \
--name=SeqQ8T1read --bs=1048576 --iodepth=8 --rw=read \
--name=SeqQ8T1write --bs=1048576 --iodepth=8 --rw=write \
--name=Seq128kQ32T1read --bs=131072 --iodepth=32 --rw=read \
--name=Seq128kQ32T1write --bs=131072 --iodepth=32 --rw=write \
--name=4kQ32T16read --bs=4096 --iodepth=32 --numjobs=16 --rw=randread \
--name=4kQ32T16write --bs=4096 --iodepth=32 --numjobs=16 --rw=randwrite \
--name=4kQ1T1read --bs=4096 --iodepth=1 --rw=randread \
--name=4kQ1T1write --bs=4096 --iodepth=1 --rw=randwrite
@fo40225
fo40225 / CNVnator.sh
Last active May 25, 2022 12:14
run CNVnator
# https://root.cern/install/dependencies/
sudo apt install -y libxpm-dev libxft-dev libxext-dev python-dev
git clone https://github.com/root-project/root.git -b v6-18-04
mkdir root_build root_install && cd root_build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../root_install ../root
cmake --build . --config Release -v -- install -j$(nproc)
source ../root_install/bin/thisroot.sh
wget https://bitbucket.org/MDukhan/yeppp/downloads/yeppp-1.0.0.tar.bz2
@fo40225
fo40225 / twii-pbr.py
Created May 16, 2022 13:06
證交所股淨比
import re
import urllib.request
import pandas as pd
from io import BytesIO
from zipfile import ZipFile
from IPython.display import display
import matplotlib.pyplot as plt
import numpy as np
datas = pd.DataFrame(columns=[