Skip to content

Instantly share code, notes, and snippets.

View ctokheim's full-sized avatar

Collin Tokheim ctokheim

  • Dana-Farber Cancer Institute
  • Boston, MA
View GitHub Profile
@ctokheim
ctokheim / slurm_cheat_sheet.md
Last active July 8, 2022 07:13
A cheat sheet for the SLURM job scheduler

SLURM

Slurm is a job scheduler for computer clusters. This document is based on this tutorial. A useful guide showing the relationships between SGE and SLURM is available here.

Gathering information

Two commands may be useful:

  • sinfo provides information about the resouces of the cluster.
# Using -np flag just prints out what the planned execution is
snakemake -np mapped_reads/A.bam
# create a new environment with a file specifying the required packages
# -c bioconda adds a channel for bioinformatic packages
conda create -n myenv_name -c bioconda --file requirements.txt
@ctokheim
ctokheim / figure_1.png
Created March 9, 2016 16:34 — forked from daler/LICENSE
Plot chromosome ideograms along with other genomic data
figure_1.png

Some useful colors

  • niobium - turqouise-like
  • smudge - pale green
  • wheat - tan

Display biological unit

To display the biological unit for the PDB structure, the split_state command is used.

@ctokheim
ctokheim / refexp.r
Last active August 29, 2015 14:23 — forked from emhart/refexp.r
library(lme4)
library(ggplot2)
#create some levels
levs <- as.factor(c("l1","l2","l3","l4","l5"))
#set the factor means
f_means <- c(6,16,2,10,13)
# set individual as a factor
@ctokheim
ctokheim / sam_bam_tricks.sh
Created March 13, 2015 20:09
SAM/BAM tricks
#########################################
# Convert Sam to Bam with a header:
# -b output bam
# -S input sam
#########################################
samtools view -bS sample.sam > sample.bam
#########################################
# convert Sam to Bam without a header
# -b output bam
@ctokheim
ctokheim / perl_oneliners.sh
Created January 30, 2015 19:31
Perl tricks
# remove \r from file
cat myfile.txt | perl -p -e 's/\r//g' > output.txt
@ctokheim
ctokheim / vim_tricks.md
Last active November 30, 2015 20:51
VIM tricks

Install VIM Locally

Go to VIM website and download VIM:

$ wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
$ tar xjf vim-7.4.tar.bz2
$ cd vim74
$ mkdir -p ~/local
$ ./configure --prefix=/home/username/local
@ctokheim
ctokheim / matlab_tricks.md
Last active August 29, 2015 14:10
Matlab tricks

Command Line Running

The following line will run the function and then drop into the interactive matlab shell when finished.

matlab -nodisplay -nojvm -nosplash -nodesktop -r "MyFunc('param1')"

However if you don't want to drop into the matlab shell, then you need to add an exit statement to the end of the command.