This is a terse document covering the anatomy of a package built for the pacman package manager.
The following example commands can mostly run verbatim to manually create a
| max(-x,-y) = -min(x,y) | |
| min(-x,-y) = -max(x,y) | |
| abs(x) = abs(-x) | |
| abs(x) = max(x,-x) = -min(x,-x) | |
| abs(x*a) = if (a >= 0) abs(x)*a | |
| (a < 0) -abs(x)*a | |
| // basically any commutative operation | |
| min(x,y) + max(x,y) = x + y |
| def splitDataFrameList(df,target_column,separator): | |
| ''' df = dataframe to split, | |
| target_column = the column containing the values to split | |
| separator = the symbol used to perform the split | |
| returns: a dataframe with each entry for the target column separated, with each element moved into a new row. | |
| The values in the other columns are duplicated across the newly divided rows. | |
| ''' | |
| def splitListToRows(row,row_accumulator,target_column,separator): | |
| split_row = row[target_column].split(separator) |
| #!/usr/bin/env bash | |
| # sra-paired.sh | |
| # Kamil Slowikowski | |
| # April 23, 2014 | |
| # | |
| # Check if an SRA file contains paired-end sequencing data. | |
| # | |
| # See documentation for the SRA Toolkit: | |
| # http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=toolkit_doc&f=fastq-dump |
Title: Tmux project sessions
Date: 2014-12-24 17:00
Tags: Tmux, learn-X-in-Y-minutes
Author: K. Y. Ng
This is a tutorial for setting up Tmux for saving terminal project sessions.
Tmux helps you emulate several shell sessions within the same terminal
window.
| QTabBar, | |
| QTabBar::tab | |
| { | |
| font-family: "Noto Sans"; | |
| font-size: 11px; | |
| height: 16px; | |
| padding: 2px; | |
| border: 0px; | |
| border-bottom: 3px solid palette(dark); | |
| background-color: palette(dark); |
| #!/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: |
| 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 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| #!/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)." |