Skip to content

Instantly share code, notes, and snippets.

View nimezhu's full-sized avatar

Zhu Xiaopeng nimezhu

View GitHub Profile
@nimezhu
nimezhu / REAME.md
Last active March 10, 2023 15:21
simple example for gonum matrix operation.
@nimezhu
nimezhu / Caddyfile
Created December 21, 2021 18:58 — forked from ryanburnette/Caddyfile
Caddy v2.1 CORS whitelist
(cors) {
@origin{args.0} header Origin {args.0}
header @origin{args.0} Access-Control-Allow-Origin "{args.0}"
}
myawesomewebsite.com {
root * /srv/public/
file_server
header Access-Control-Allow-Methods "POST, GET, OPTIONS"
header Access-Control-Allow-Headers "*"
import cors https://member.myawesomewebsite.com
@nimezhu
nimezhu / plotCausalGraph.py
Created May 6, 2014 23:00
plot directed graph (python matplotlib)
#!/usr/bin/python
# programmer : zhuxp
# usage:
import sys
from getopt import getopt
import networkx as nx
import matplotlib.pyplot as plt
def show_help():
print >>sys.stderr,"\n\nplotCausalGraph.py: drawing causal graph from LiNGAM output equation matrix B"
print >>sys.stderr,"Library Dependence: networkx , matplotlib\n\n"
@nimezhu
nimezhu / README.md
Last active September 28, 2020 08:06
A simple example using tabix C library in GO language.

A simple example to link tabix C library into GO language.

  1. download tabix C source code
  2. make dynamic libtabix.so.1 [ or make to get libtabix.a]
  3. cp libtabix.so.1 to your LD_LIBRARY_PATH [ or use the static version libtabix.a ]
  4. mv query_tabix_example.go query_tabix.go query_tabix_example_static.go into tabix directory which contains example.gtf.gz and example.gtf.gz.tbi and libtabix.a
  5. go run query_tabix_example.go [ or go run query_tabix_example_static.go ]
  6. go run query_tabix.go [file.bed] [file.gz]
  7. query_tabix_bed6.go are designed for query motifs and coordinates translate to query region.
@nimezhu
nimezhu / README.md
Last active May 28, 2020 15:35
omero docker compose

OMERO-NB-Index

source env.sh
docke-compose up

need to create public user

create read-only public group

@nimezhu
nimezhu / index.html
Last active March 11, 2020 14:59
Welcome file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome file</title>
<link rel="stylesheet" href="https://stackedit.io/style.css" />
</head>
@nimezhu
nimezhu / index.html
Last active October 3, 2019 11:16
NB Dispatch Programmable Test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>NB-Dispatch-Programmable</title>
<script src="https://vis.nucleome.org/static/lib/nb-dispatch.min.js"></script>
</head>
@nimezhu
nimezhu / cnb.user.js
Last active April 5, 2018 13:37
Nucleome Browser Plugin
// ==UserScript==
// @name Nucleome Browser Plugin
// @namespace http://genome.compbio.cs.cmu.edu:8080
// @version 0.0.4
// @description link nucleme browser with other genome browsers such as UCSC Genome Browser and WASHU Genome Browser. Works with NBrowser 'Browser Manager' Panel.
// @author xiaopeng.zhu(nimezhu@gmail.com)
// @include http://genome.ucsc.edu/cgi-bin/hgTracks*
// @include http://epigenomegateway.wustl.edu/browser/*
// @grant none
// @require https://d3js.org/d3.v5.min.js
gistup
@nimezhu
nimezhu / fs.go
Created September 21, 2017 19:34
package fs
//watch a directory rursively.
import (
"fmt"
"log"
"os"
"path/filepath"