Tuesday 26 April 2016

Extract Genomic Features From an TxDb Object

Extract genomic features from an TxDb object

R Plot Package plotly

Pie Charts in R

Java Genomics Toolkit

java-genomics-toolkit

Visualise BigWig Files in a Genome Browser

Tutorial: Visualizing Chip-Seq Data Using Ucsc [Bigwig]

Ubuntu 16.04 Set Up Menu Bar in Terminal and Open New Terminal as Tab

Cited from Missing menus on fresh boots or restarts on ubuntu sessions

mkdir -p .config/autostart

gedit .config/autostart/menus.desktop

and copy the following into this file.

"""
[Desktop Entry]
Type=Application
Exec=initctl restart unity-panel-service
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=menus
Comment=Show me the menus
X-GNOME-Autostart-Delay=
"""

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Open Gnome Terminal in New Tab in Ubuntu 15.04

Monday 25 April 2016

The Differences Between "<-" and "="

Cited from Difference between assignment operators in R

To reduce ambiguity, we should use either <- or = as assignment operator, and only use = as named-parameter specifier for functions.

In conclusion, for better readability of R code, I suggest that we only use <- for assignment and = for specifying named parameters.

Friday 15 April 2016

Inferring Direct DNA Binding From ChIP-seq

Inferring Direct DNA Binding From ChIP-seq

Position Weight Matrix (PWM)

Position Weight Matrix Wiki

Position Weight Matrix Tutorial

Position Weight Matrix From Sequence Alignment

MEME Suite

MEME Online Suite

Individual Tools in MEME Suite Explained

Latex Beamer Display "Sections"

Sections and subsections

Tissue Specficity and Shannon entropy

Promoter features related to tissue specificity as measured by Shannon entropy

Mini-tutorial on Shannon Entropy

Dave Tang's Journal Club Wiki

Dave Tang's Journal Club Wiki

Single-Cell Omics and Chromatin Topology

Genom Biology: Single-Cell Omics

Genome Biology: The three dimensional organization of the nucleus

LaTeX Figures Side by Side

LaTeX figures side by side

Wednesday 13 April 2016

Monday 11 April 2016

Non-standard Evaluation in R (Meta-programming)

Cited from Non-standard evaluation

substitute() looks at a function argument and instead of seeing the value, it sees the code used to compute the value. substitute() returns an expression.

substitute() works because function arguments are represented by a special type of object called a promise. A promise captures the expression needed to compute the value and the environment in which to compute it.

substitute() is often paired with deparse(). That function takes the result of substitute(), an expression, and turns it into a character vector.

One important feature of deparse() to be aware of when programming is that it can return multiple strings if the input is too long.

eval() takes an expression and evaluates it in the specified environment.

quote(). It captures an unevaluated expression like substitute(), but doesn’t do any of the advanced transformations that can make substitute() confusing. quote() always returns its input as is.

So if you only provide one argument, it will evaluate the expression in the current environment. This makes eval(quote(x)) exactly equivalent to x, regardless of what x is.

eval()’s second argument need not be limited to an environment: it can also be a list or a data frame.

=====================================
Cited from Tips on non-standard evaluation in R

In fact, eval(expr, envir, enclos) basically follows the following logic to evaluate a quoted expression:
  1. If envir is an environment, then evaluate expr in envir by looking for symbols all the way along envir and its parent environments until found.
  2. If envir is a list, then evaluate expr given the symbols defined in the list; Whenever a symbol is not found in the list, the function will go to enclos environment to find along the chain until found.
  3. If a symbol is not found until the empty environment (the only environment having no parent) is reached, an error occurs. 
=====================================
Non standard evaluation from another function in R
 





Thursday 7 April 2016

Tab "\t" in Bash

Cited from Bash Join Command


$'\t' for the tab character, not just -t \t. Bash does not interpret \t unless in $' ' quotes.
join -t $'\t' ...

Saturday 2 April 2016

What does "canonical" mean in biology?

Most likely, "canonical" in biology means "consensus".

Cited from Canonical sequence

"A canonical sequence is a sequence of DNA, RNA, or amino acids that reflects the most common choice of base or amino acid at each position."