| Command | Meaning |
|---|---|
echo -en "\rSomeText" |
Return carriage to the beginning of the line (-e and \r), write "SomeText" at that point in time. Do not output a new line at the end of the statement (-n). Useful for dynamic terminal messages. |
find . -exec touch -am {} \; |
Update the access and modified times for all files in this current directory and all subdirectories. Useful for keeping files around when set to expire after a given amount of time. |
find . -name 'foo-exclude-me' -prune -o -name 'foo*' -print |
Find all files with foo*, ignoring foo-exlude-me |
| #!/bin/bash | |
| set -euo pipefail | |
| MY_FILE="$1" | |
| declare -ax ARRAY=($(<"${MYFILE}")) |
| #!/usr/bin/env python3 | |
| """Translate Ensembl codes into gene names""" | |
| import sys | |
| if sys.version_info.major is not 3 and sys.version_info.minor < 5: | |
| sys.exit("Please use Python 3.5 or higher for this program") | |
| import argparse |
| #!/usr/bin/env Rscript | |
| args <- commandArgs(trailingOnly = TRUE) | |
| msg <- "Please pass 'bitbucket' or 'github' to choose where we install Seurat from" | |
| if (length(x = args) != 1) { | |
| stop(msg) | |
| } |
I hereby claim:
- I am mojaveazure on github.
- I am mojaveazure (https://keybase.io/mojaveazure) on keybase.
- I have a public key ASB4Z0EBpYA3cVTGJWx8Ndx3OSvgxPqondPxy1_0TbMOwgo
To claim this, I am signing this object:
| #!/usr/bin/env python3 | |
| """Generate an H5AD file from the PBMC3k dataset""" | |
| import os | |
| import sys | |
| import time | |
| import shutil | |
| import urllib | |
| import logging |
Setting up RStudio Server on the Windows Subsystem for Linux (WSL) is an excellent way for R developers to use and interact with R on Linux while running Windows. While not perfect, it provides a nearly seamless way for Windows users to consume Linux-only packages, and for developers to test on both Windows and Linux at the same time. Moreover, the same benefits of running RStudio server, such as leaving jobs running in the background, apply to RStudio Server on WSL. These are my notes for successfully setting up and using RStudio Server on WSL
The first thing that needs to happen in enabling the WSL and installing a Linux distro. To install the WSL, open PowerShell as an administrator and run
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart| #!/usr/bin/env Rscript | |
| #' Minimal R version | |
| #' | |
| #' Find the lowest accepted R version for a package and all of its dependencies | |
| #' | |
| #' @param package Name of CRAN package | |
| #' | |
| #' @return A \code{\link[base]{numeric_version}} with the lowest possible R | |
| #' version to install \code{package} and all of its dependencies |
| FROM rocker/r-ver:4.2.2 | |
| RUN apt-get update && apt-get upgrade -y | |
| RUN Rscript -e "\ | |
| install.packages('remotes'); \ | |
| remotes::install_version('Matrix', '1.5.1'); \ | |
| install.packages('SeuratObject', repos = 'https://cloud.r-project.org')" | |
| RUN Rscript -e "print(packageVersion('Matrix'))" |
| FROM rocker/r-base:latest | |
| RUN apt-get update && \ | |
| apt-get install -y ca-certificates lsb-release curl cmake git | |
| RUN curl -O https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | |
| RUN apt-get install -yV ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | |
| RUN apt-get update && apt-get install -y libarrow-dev | |
| RUN Rscript -e "\ | |
| ncores <- as.integer(system2('grep', c('-c', 'processor', '/proc/cpuinfo'), stdout = TRUE)); \ |