Skip to content

Instantly share code, notes, and snippets.

View claczny's full-sized avatar

Cedric Laczny claczny

View GitHub Profile
@claczny
claczny / installing_singularity_on_macbook_pro_m1_pro.md
Last active July 29, 2023 19:25
This Gist describes the steps needed to install Singularity in a Parallels-Desktop-and-vagrant-managed arm64-compatible virtual machine on a MacBook Pro with an M1 Pro chip.

I wanted to install Singularity on my M1 Pro (Ventura 13.1). As this chip is arm64 based, it turned out rather tricky. Some resources that I consulted although none of them presented a self-contained solution are below. I hadn't tried the solution via UTM as I had access to a Parallels Desktop license and did not necessarily want to have yet-another-tool installed.

@claczny
claczny / gist:4a1e25ae465039a5d76c11018afe4466
Created November 15, 2017 11:12
Fetch CSV hittable for NCBI online BLAST results
http://blast.ncbi.nlm.nih.gov/Blast.cgi?RESULTS_FILE=on&RID=REPLACE-BY-YOUR-RID&FORMAT_TYPE=CSV&FORMAT_OBJECT=Alignment&ALIGNMENT_VIEW=Tabular&CMD=Get
@claczny
claczny / gist:8ed853e209d64941907195fea8aa289e
Created September 14, 2017 07:13
Error message when installing lotus v.1.57
doneCompiling sdm..
make: Entering directory '/home/cedric/apps/software/lotus_pipeline_1.57/sdm_src'
g++ -O3 -std=c++0x -D__USE_XOPEN2K8 -c -o Demultipl.o Demultipl.cpp
g++ -O3 -std=c++0x -D__USE_XOPEN2K8 -c -o containers.o containers.cpp
g++ -O3 -std=c++0x -D__USE_XOPEN2K8 -c -o IO.o IO.cpp
g++ -O3 -std=c++0x -D__USE_XOPEN2K8 -c -o InputStream.o InputStream.cpp
g++ -O3 -std=c++0x -D__USE_XOPEN2K8 -c -o DNAconsts.o DNAconsts.cpp
g++ -O3 -std=c++0x -D__USE_XOPEN2K8 Demultipl.o containers.o IO.o InputStream.o DNAconsts.o -lz -o sdm
make: Leaving directory '/home/cedric/apps/software/lotus_pipeline_1.57/sdm_src'
Installing sdm:
@claczny
claczny / adonis_output.txt
Last active April 7, 2019 17:27
Example using PERMANOVA with single and multiple covariates (a.k.a., independent variables).
Call:
adonis(formula = GPfr_phylum_bray ~ SampleType, data = sampledf)
Permutation: free
Number of permutations: 999
Terms added sequentially (first to last)
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
SampleType 8 8.2618 1.03272 5.81 0.7322 0.001 ***
@claczny
claczny / skeleton.mk
Created August 25, 2017 12:11
Skeleton of a Makefile
SHELL = /bin/bash
DDIR = data
RDIR = results
SDIR = src
SAMPLES = S1 S2 S3
DOUBLED_SAMPLES = $(foreach sample, $(SAMPLES), $(sample)/$(sample))
####################
@claczny
claczny / gist:3366f6b29680e0c357d2068e09b09f6e
Last active August 9, 2017 10:00
Reformat stdout from `sourmash compare`
grep -E "^[0-9]*-" -A1 compare.abundtrim.dist.txt | tr -d "\n" | sed 's/]/]\n/g' | tr -s " " "\t" | sed 's/\[\t//' | sed 's/\]//'
@claczny
claczny / Makefile.amplicon_minion.benitez-paez_sanz
Created June 10, 2017 04:53
Makefile for downloading full-length amplicon sequencing MinION data from Benitez-Paez & Sanz: http://biorxiv.org/content/early/2017/06/08/117143
SHELL = /bin/bash
DDIR = orig_data
RDIR = results
PORETOOLS_BIN = . venv/bin/activate; poretools
PULLSEQ_BIN = ml vizbins_little_helpers; pullseq
MIN_LENGTH ?= 1000
@claczny
claczny / fuzzymatch_titles.py
Created January 6, 2017 15:45
Python code to fuzzy match two files (A and B) of titles to find missing titles in B, i.e., multiplications in A. Not very efficient, but does the job.
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
from collections import Counter
A_title_file = "/tmp/A_titles.txt"
B_title_file = "/tmp/B_titles.txt"
# Open the files and get the titles
A_titles = []
with open(A_title_file) as f:
@claczny
claczny / fit_and_plot_normal_mixtures.R
Created September 6, 2016 11:08
Fit and plot the fitted components of a multi-modal distribution assuming normal distributions as the components.
library(ggplot2)
library(plyr)
library(mixtools)
###
# GLOBAL THEME AND GLOBAL AESTHETICS
###
old <- theme_set(theme_bw() +
theme(text = element_text(size=12),
axis.title = element_text(size = 14, face="bold"),
@claczny
claczny / compute_coverage.mk
Created September 5, 2016 08:22
A Makefile to compute the average genome coverage, coverage distribution, and other things from an input BAM-file. N.B. Secondary expansion (.SECONDEXPANSION) is used to create and populate a dedicated directory per sample.
SHELL=/bin/bash
SAMPLE?=<YOUR_SAMPLE>
DOUBLED_SAMPLE = $(SAMPLE)/$(SAMPLE)
RDIR?=results
DDIR?=data
#####
# BEAUTY TARGETS