Skip to content

Instantly share code, notes, and snippets.

$ export CC=clang
$ export CXX=clang
$ export FFLAGS=-ff2c
$ git clone https://github.com/numpy/numpy.git
$ cd numpy
$ python3 setup.py build
$ python3 setup.py install
@ccwang002
ccwang002 / python indentation case
Created December 13, 2012 14:40
sample case to show that sometimes it is tricky to determine the indentation of python code automatically.
if a==b:
with open('f.txt') as f:
# do something
# do something
@ccwang002
ccwang002 / get_human_3UTR.r
Last active December 19, 2015 15:48
Retreive all human(hg19) 3' UTR sequences and their correspondent gene names thru R/Bioconductor
# Code here is adapted from
# http://gettinggeneticsdone.blogspot.tw/2011/04/using-rstats-bioconductor-to-get.html
# If Bioconductor or the required packages (e.g., BSgenome) are not installed,
# One should first run the following code section "Installation"
source("http://www.bioconductor.org/biocLite.R")
# === Installation ===
# --- known gene ---
# biocLite('TxDb.Hsapiens.UCSC.hg19.knownGene')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ccwang002
ccwang002 / NTU_B02new_sexratio.raw.txt
Last active December 20, 2015 22:39
Demo usage of Python, R exchange data through file I/O using IPython and `rpy2.
# 本資料由 PaiChiou (基隆金城武) 於 2013.08.08 分享
# 文章代碼(AID): #1I0eeAVU (NTU) [ptt.cc] [分享] B02級男女比例表
# 文章網址: http://www.ptt.cc/bbs/NTU/M.1375898122.A.7DE.html
# 資料簡述:
# 台灣大學 B02級(2013.09入學) 新生男女比例表
#
# TODO:
# * 性別比按院系作圖
# * 人數按院系作圖
# * 聯誼人數配對問題
@ccwang002
ccwang002 / 0Intro to Next Bio.md
Last active December 21, 2015 07:38
這邊記錄了一些 Next Bio 架構討論、設計,各種 concern 種種雜項。歡迎各種討論。

Introduction to Next Bio

Your next, and hoped the last, bio python library.

NextBiopy 中的 Next 有兩種涵意:第一,它想分析次世代定序技術(Next Generation Sequencing)的資料,此類資料龐大,在以往缺乏統一且有效的方式來讀取相關檔案;第二,Python 有一專門處理生物相關的套件 Biopython,但歷史久遠有許多包伏下,面對未來大資料的分析往往效能表現不理想,且 API 設計複雜,故希望藉次世界定序為出發點,逐一改善 Biopython 其他功能的效能表現與設計。

平常生資研究者往往專注在分析結果上,往往缺乏一個完整的時間改善分析流程與使用工具,以及與同仁交流技術的場所。藉由本次 Sprint 互相認識以及經驗分享,並對於 NextBiopy 架構如何設計才能更滿足多數研究者的需求。

NextBiopy 相較本次其他專案而言,為較初期的專案,加上研究者可能較缺乏開源協同開發的經驗,大部份的 issue 為解決跨版本、跨平台、CI、底層架構設計等問題。故本專案會藉由這次 Sprint 來讓參加者了解開源專案所需的基礎技術與建設。

# same as Mynt, which requires PyYAML
from yaml import load_all
with open('this_file.md') as f:
# "---" is used to separate mutliple YAML entries,
# so the loader returns a generator
yaml_gen = load_all(f.read(), Loader=Loader)
description = next(yaml_gen) # get first entry only
print(description) # description should be a dict
@ccwang002
ccwang002 / 0_Readme.md
Last active December 31, 2015 05:49
2013.12 貝氏應用統計期末報告,附錄程式碼

Readme

這些程式碼包含:

  • 資料前處理
  • 繪圖
  • Bayesian linear regression model 計算

三大部份的程式碼,以下將分別列述。 由於原始資料需經過一定處理轉換才能使用,但細節較多且複雜,另獨立列述。