Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Github addictive user

pwwang

🏠
Github addictive user
View GitHub Profile
@pwwang
pwwang / poetry-editable.fish
Last active May 3, 2022
Install local python package in editable mode managed by poetry
View poetry-editable.fish
# Defined in - @ line 0
function poetry-editable --description "Do 'pip install -e' for poetry project"
echo "= RUN poetry build"
poetry build
set ver (poetry version -s)
cd dist/
tar zxvf *-$ver.tar.gz
cd ..
mv setup.py setup.py.bak
@pwwang
pwwang / whichpy.fish
Last active May 3, 2022
Check where the python library is and what version it is, in fish
View whichpy.fish
# Defined in - @ line 0
function whichpy --description "Print python package information"
python -c "try:
im = __import__('importlib.metadata', fromlist=['metadata'])
except ImportError:
im = __import__('importlib_metadata')
pkg = '$argv[1]'
import sys, requests, json
from datetime import datetime
@pwwang
pwwang / sift4g_annotator
Created Jun 11, 2020
Wrapper script for SIFT4G_Annotator
View sift4g_annotator
#!/usr/bin/env python
#
# Wrapper script for SIFT4G_annotator
#
#
# Program Parameters
#
import os
import subprocess
@pwwang
pwwang / Makefile
Created Sep 28, 2019
A proxy Makefile to subdirectory's Makefile
View Makefile
# get all targets from subdirectory
SUBDIR := subdir
TARGETS := $(shell make -C $(SUBDIR) -rpn | sed -n -e "/^$$/ { n ; /^[^ .\#%][^ ]\*:/ { s/:.\*$$// ; p ; } ; }" )
# default target
all:
# pass all targets to subdirectory
%:
@pwwang
pwwang / vcf2maf.pl
Created Sep 24, 2018
vcf2maf.pl with logs
View vcf2maf.pl
#!/usr/bin/env perl
# vcf2maf - Convert a VCF into a MAF by mapping each variant to only one of all possible gene isoforms
use strict;
use warnings;
use IO::File;
use Getopt::Long qw( GetOptions );
use Pod::Usage qw( pod2usage );
use File::Path qw( mkpath );
View jlab.py
#!/usr/bin/env python
from __future__ import print_function
import yaml, sys
from os import path, makedirs, listdir, remove
from time import sleep
from shutil import copy2
from pyppl import commands, utils
from subprocess import list2cmdline
commands._desc = 'A set of utilities for JupyterLab.'
@pwwang
pwwang / cloudSettings
Last active Apr 9, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-04-09T18:01:08.444Z","extensionVersion":"v3.4.3"}
@pwwang
pwwang / __fish_move_last.fish
Last active Jul 5, 2018
Fish cd with symbolic path kept.
View __fish_move_last.fish
# for prevd and nextd, cd -
function __fish_move_last -d "Move the last element of a directory history from src to dest"
set -l src $argv[1]
set -l dest $argv[2]
set -l size_src (count $$src)
if test $size_src = 0
# Cannot make this step
View Add_Open_Command_Window_Here_as_Administrator.reg
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; http://www.sevenforums.com
; Tutorial: http://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
@pwwang
pwwang / qst
Last active Jul 12, 2017
qstat with full job name
View qst
#!/usr/bin/env python
from subprocess import check_output
from re import search
cmd = ['qstat', '-xml']
# get the xml output
output = check_output (cmd)
keys = [] # the feature names
vals = [] # the jobs including all features
job = [] # the features