Skip to content

Instantly share code, notes, and snippets.

View fortune9's full-sized avatar

Zhenguo Zhang fortune9

View GitHub Profile
@fortune9
fortune9 / bioresource.md
Last active September 16, 2023 03:10
Biological resources

Data

Papers

  • Molecular and spatial signatures of mouse brain aging at single-cell resolution
  • Recurrent repeat expansions in human cancer genomes. Nature 613, 96–102 (2023)
  • species: human
@fortune9
fortune9 / plotshape.r
Created October 27, 2022 04:49 — forked from infotroph/plotshape.r
Compute dimensions of the largest fixed-aspect ggplot that fits inside the given maximum height and width.
# The problem: Plotting from R to PNG requires that you specify x and y
# dimensions, which therefore also fixes the aspect ratio of
# the whole image. In most of my plots, I want a fixed *panel* aspect ratio,
# but the overall dimensions of the full *plot* still depend on the dimensions
# of other plot elements: axes, legends, titles, etc.
# In a facetted ggplot, this gets even trickier: "OK, three panels, each
# with aspect ratio of 1.5, that adds up to... wait, will every panel
# have its own y-axis, or just the leftmost one?"
# ggplot apparently computes absolute dimensions for everything EXCEPT

When R is started, it reads a series of files to initialize the computing environment.

Config files to read

The files are read in the following order:

  1. .Renviron: hosting environment variables in the format <var>=<value>. R searches the first .Renviron file in the following order: (i) Sys.getenv("R_ENVIRON_USER"), (ii) ./.Renviron, and (iii) ~/.Renviron. Once the first .Renviron is found, others will be ignored.
@fortune9
fortune9 / rmarkdown_tips.Rmd
Last active June 2, 2021 01:04
Tips in Rmarkdown
---
title: "A summary of Rmarkdown tips"
---
## Math mode
1. Add space in the expression, use '\~'. For example:
```{r}
$This~is~an~expression~in~math~mode$
@fortune9
fortune9 / nextflow.Rmd
Last active February 15, 2023 03:38
Learning Notes on NextFlow
---
title: "Notes on NextFlow"
author: "Zhenguo Zhang"
date: "`r format(Sys.time(), '%B %d, %Y')`"
output:
github_document:
toc: true
html_document:
toc: yes
toc_float: true
@fortune9
fortune9 / firstGist.md
Created October 3, 2020 23:16
First gist

The first gist in my github

This is simply a file to start my github gist journey. This is a markdown file and you can view it in text editor, github, or convert to different formats using pandoc.

We are all set, let's go.

@fortune9
fortune9 / simple_args_parsing.sh
Created July 3, 2019 18:58 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@fortune9
fortune9 / gist:227f0ce61334257dcace9e01edf4cd8d
Created August 15, 2018 00:46 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: