Blog

  • Make the figure caption bold or customize by…

    le voir Make the figure caption bold or customize by Caption package.

    http://tex.stackexchange.com/questions/3276/caption-is-bold-can-i-have-part-of-it-not-bold?rq=1

    http://tex.stackexchange.com/questions/32459/figure-how-to-have-figure-1-5-in-bold

  • Recommended popular LaTeX packages 1 9 Essential packages…

    Recommended/popular LaTeX packages.

    1. 9 Essential packages.
    http://www.howtotex.com/packages/9-essential-latex-packages-everyone-should-use/

    2. 10+ packages.
    http://blog.analogmachine.org/2011/05/16/top-10-latex-packages/

    3. Discussion in TeX StackExchange forum.
    http://tex.stackexchange.com/questions/553/what-packages-do-people-load-by-default-in-latex

  • Figure out LaTeX symbol commands by drawing the…

    Figure out LaTeX symbol commands by drawing the symbol.

    http://ebiquity.umbc.edu/blogger/2009/07/12/detexify-draw-symbol-get-latex-command-tex-sketch/

  • Remove an erroneous revision Let’s suppose revision 3…

    Remove an erroneous revision

    Let’s suppose revision 3 introduced an error, then

    hg backout -r 3
    

    will remove the errors introduced in the revision.

  • Redo the last substitute or command by in…

    Redo the last substitute or command by : in Vim

    @:
    

    For more repeats, it can be done by

    @@
    
  • Find files and show the content recursively in…

    Find files and show the content recursively in unix.

    find . -name "readme" -exec head {} \;
    
    find . -name "readme" | xargs head
    
  • Multiple histograms in a plot using ggplot2 ggplot…

    Multiple histograms in a plot using ggplot2.

    ggplot(test.melt, aes(x = value, fill = sample)) + geom_histogram(alpha = 0.3, position = 'identity', aes(y = ..density..)) + geom_density(alpha = 0.3, position = 'identity')
    

    Be careful. The default value for the

    position

    parameter is different the histogram and density plot. So set the parameter explicitly.

    Identity: overlap the two histograms.
    stack: stack the two histograms on top of another.
    For more options, check Position adjustments in
    http://docs.ggplot2.org/current/index.html

    Default parameters of histogram and density.

    geom_histogram(mapping = NULL, data = NULL, stat = "bin", position = "stack", ...)
    
    stat_density(mapping = NULL, data = NULL, geom = "area", position = "stack", adjust = 1,
      kernel = "gaussian", trim = FALSE, na.rm = FALSE, ...)
    
    geom_density(mapping = NULL, data = NULL, stat = "density", position = "identity",
      na.rm = FALSE, ...)
    
  • To change two vertically split windows to horizontally…

    To change two vertically split windows to horizontally split

    Ctrl-W t Ctrl-W K
    Horizontally to vertically:

    Ctrl-W t Ctrl-W H
    Explanations:

    Ctrl-W t makes the first (topleft) window current
    Ctrl-W K moves the current window to full-width at the very top
    Ctrl-W H moves the current window to full-height at far left

    http://stackoverflow.com/questions/1269603/to-switch-from-vertical-split-to-horizontal-split-fast-in-vim

  • Find duplicate or unique records in unix sort…

    Find duplicate or unique records in unix

    sort is essential because uniq find successive identical lines.
    Unique records

    cat data.txt | sort | uniq
    

    Duplicate records

    cat data.txt | sort | uniq -d
    
  • Using gff format in IGV 1 Do not…

    Using gff format in IGV.

    1. Do not omit the first line, especially for GFF 3.
    As IGV supports both of GFF ver 2 and GFF ver 3, the file needs to be distinguished.
    Do not miss the first line

    ##gff-version    3
    

    2. Make sure tab is used to separate fields.
    Even for the first line, there must be a tab between gff-version and 3.
    No space.

    Here are the specifications.

    GFF version 2
    http://www.sanger.ac.uk/resources/software/gff/spec.html

    GFF version 3
    http://www.sequenceontology.org/gff3.shtml