This script enables Ninja-powered builds in CLion IDE by wrapping around CMake, which it uses. See my blog post for details.
This script is provided AS IS with no guarantees given or responsibilities taken by the author. This script relies on undocumented features of CLion IDE and may lead to instability of build and/or IDE. Use it on your own risk under WTFPL terms.
This file contains hidden or 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
#' Convert counts to transcripts per million (TPM). | |
#' | |
#' Convert a numeric matrix of features (rows) and conditions (columns) with | |
#' raw feature counts to transcripts per million. | |
#' | |
#' Lior Pachter. Models for transcript quantification from RNA-Seq. | |
#' arXiv:1104.3889v2 | |
#' | |
#' Wagner, et al. Measurement of mRNA abundance using RNA-seq data: | |
#' RPKM measure is inconsistent among samples. Theory Biosci. 24 July 2012. |
This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet
SPC q q
- quitSPC w /
- split window verticallySPC w
- - split window horizontallySPC 1
- switch to window 1SPC 2
- switch to window 2SPC w c
- delete current window
This file contains hidden or 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
\usepackage{fontspec} %加這個就可以設定字體 | |
\usepackage{xeCJK} %讓中英文字體分開設置 | |
\setCJKmainfont{微軟正黑體} %設定中文為系統上的字型,而英文不去更動,使用原TeX字型 | |
\XeTeXlinebreaklocale "zh" %這兩行一定要加,中文才能自動換行 | |
\XeTeXlinebreakskip = 0pt plus 1pt %這兩行一定要加,中文才能自動換行 | |
\defaultCJKfontfeatures{AutoFakeBold=6,AutoFakeSlant=.4} %以後不用再設定粗斜 | |
\newCJKfontfamily\Kai{標楷體} %定義指令\Kai則切換成標楷體 | |
\newCJKfontfamily\Hei{微軟正黑體} %定義指令\Hei則切換成正黑體 | |
\newCJKfontfamily\NewMing{新細明體} %定義指令\NewMing則切換成新細明體 |
This file contains hidden or 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/bash | |
set -euo pipefail | |
if [ $# -ne 1 -o x$1 == x-h -o x$1 == x--help ]; then | |
echo \ | |
"Usage: | |
samtools sort -O bam -T prefix ... | bambai BAMPATH | |
Read a sorted BAM file from standard input, write it to BAMPATH and | |
index it at the same time (creating BAMPATH.bai)." |
This depends on biom version >= 2.1.5, < 2.2.0 and vsearch >= 1.7.0.
Please note that all of this is highly experimental. I'm keeping these notes as I work with this approach. For published work, I still recommend using standard pipelines, such as those in QIIME 1.9.1.
$ biom --version
biom, version 2.1.5
$ vsearch --version
vsearch v1.7.0_osx_x86_64, 16.0GB RAM, 8 cores
This file contains hidden or 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 pysam import AlignmentFile | |
from pyfaidx import Fasta | |
def has_mismatch_in_interval(reference, bamfile, chrom, start, end): | |
""" | |
Return whether there is a mismatch in the interval (start, end) in any read mapping to the given chromosome. | |
reference -- a pyfaidx.Fasta object or something that behaves similarly | |
""" | |
for column in bamfile.pileup(chrom, start, end): |
This file contains hidden or 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 | |
""" | |
Running this script is (intended to be) equivalent to running the following Snakefile: | |
include: "pipeline.conf" # Should be an empty file | |
shell.prefix("set -euo pipefail;") | |
rule all: | |
input: |