Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew J. Oldach moldach

View GitHub Profile
@moldach
moldach / fastqc_wrapper_nohup.out
Created Sep 22, 2020
Error log from snakemake fastqc wrapper when using --use-singularity and --use-conda on HPC
View fastqc_wrapper_nohup.out
Workflow defines that rule get_vep_cache is eligible for caching between workflows (use the --cache argument to enable this).
Building DAG of jobs...
Creating conda environment https:/github.com/snakemake/snakemake-wrappers/raw/0.66.0/bio/vep/plugins/environment.yaml...
Downloading and installing remote packages.
CreateCondaEnvironmentException:
Could not create conda environment from /tmp/tmpisqd78u6.yaml:
Solving environment: ...working... failed
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
View survivor_comparison_matrix.tsv
Breakdancer CNVnator DeepVariant Delly GRIDSS Lumpy Manta MindTheGap NGSep Pindel Tardis
0 0 0 0 1 0 1 0 0 0 0
0 0 0 0 1 0 1 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 0 0 1 0 1 1 0 0 0 1
0 0 0 1 0 1 1 0 0 0 1
0 0 0 0 1 0 1 0 0 0 0
0 0 0 1 0 1 1 0 0 0 1
1 0 0 0 1 0 0 0 1 0 0
0 0 0 1 0 0 1 0 0 0 0
@moldach
moldach / Snakefile
Created May 22, 2020
Snakemake workflow
View Snakefile
'''
This is a snakemake for variant calling workflow
-------------------
# An example run of this workflow
Usage:
snakemake --profile slurm --jobs 20
@moldach
moldach / pyenv_3.5.0_ubuntu-20.04.log
Created May 20, 2020
pyenv install 3.5.0 failing for Ubuntu 20.04 LTS
View pyenv_3.5.0_ubuntu-20.04.log
This file has been truncated, but you can view the full file.
/tmp/python-build.20200520134504.60362 ~/projects/data/celegans
/tmp/python-build.20200520134504.60362/Python-3.5.0 /tmp/python-build.20200520134504.60362 ~/projects/data/celegans
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... linux
checking for --without-gcc... no
checking for gcc... gcc
@moldach
moldach / r_ubuntu.sh
Last active May 6, 2020 — forked from luispuerto/r_ubuntu.sh
Install R and RStudio on Ubuntu 19.10 with essential libraries for data science. Based on pachamaltese/r_ubuntu_17_10.sh (for Ubuntu 17.10). Note: You need to make sure the default library location - /usr/local/lib/R/site-packages - is writable .
View r_ubuntu.sh
!#/bin/bash
set -o nounset # To exit when your script tries to use undeclared variables.
set -o xtrace # To trace what gets exectued (debugging).
set -e # Abort script at first error, when a command exits with non-zero status (except in until or while loops, if-tests, list constructs)
set -o pipefail # Causes a pipeline to return the exit status of the last command in the pipe that returned a non-zero return value.
# Install multiple versions of python
# https://github.com/pyenv/pyenv
# https://github.com/pyenv/pyenv/wiki#suggested-build-environment
View gist:d184be424098e69f2dde3599b6cba83c
# remotes::install_github("wilkelab/ggtext")
library(tibble)
library(ggplot2)
library(dplyr)
data <- tribble(
~bactname, ~OTUname, ~name, ~value,
"Staphylococcaceae", "OTU1", "Staphylococcaceae (OTU1)", -0.5,
"Moraxella", "OTU2", "Moraxella (OTU2)", 0.5,
@moldach
moldach / qs package for saving ggplot objects
Last active Oct 29, 2019
Troubleshooting bench::mark with qs::qread()
View qs package for saving ggplot objects
library(bench)
library(qs)
library(sf)
library(cowplot)
# load ggplot
download.file("https://www.dropbox.com/s/ao0827vayr5u3vx/hawaii_agriculture_100m_basemap.rds?raw=1" , "hawaii_agriculture_100m_basemap.rds")
hawaii <- readRDS("hawaii_agriculture_100m_basemap.rds")
# bench mark saving
@moldach
moldach / import_QC_Koh
Created Oct 21, 2019
Troubleshooting QC for scRNAseq_clustering_comparison
View import_QC_Koh
---
title: "Import and QC of Koh data set (SRP073808)"
output: html_document
editor_options:
chunk_output_type: console
---
```{r load-packages}
suppressPackageStartupMessages({
library(MultiAssayExperiment)
@moldach
moldach / gist:552cc704ced328a0120394271404779f
Created Oct 2, 2019
Shapefiles and Raster of Relief do not match for Hawaii
View gist:552cc704ced328a0120394271404779f
### This method works for Switzerland and The USA (shown here, at the top) but not Hawaii (shown at the bottom)
library(sf)
library(raster)
library(dplyr)
library(ggplot2)
## USA
# download shapefile: https://catalog.data.gov/dataset/tiger-line-shapefile-2017-nation-u-s-current-state-and-equivalent-national
usa_geo <- read_sf("data/shapefiles/usa/tl_2017_us_state.shp")
@moldach
moldach / ez-extract
Created Sep 21, 2017
Function to easily uncompress a variety of formats in Linux - add this to .bashrc. then run it on file (e.g. extract file.zip)
View ez-extract
# Extracting various compression files made easy
extract() {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
You can’t perform that action at this time.