Skip to content

Instantly share code, notes, and snippets.

View alienzj's full-sized avatar
🦀
MAGs lives matter

Jie Zhu alienzj

🦀
MAGs lives matter
View GitHub Profile
@arichardson
arichardson / CLion_Ninja.md
Last active January 25, 2024 15:23 — forked from nevkontakte/CLion_Ninja.md
Ninja support for CLion IDE

Ninja support for CLion IDE (working with newer versions of clion)

This script enables Ninja-powered builds in CLion IDE by wrapping around CMake, which it uses. See my blog post for details.

Disclaimer

This script is provided AS IS with no guarantees given or responsibilities taken by the author. This script relies on undocumented features of CLion IDE and may lead to instability of build and/or IDE. Use it on your own risk under WTFPL terms.

@hghwng
hghwng / .gitignore
Last active May 11, 2024 02:20
SciTools Understand for Arch Linux
pkg/
src/
understand-bin-*.pkg.*
Understand-*.tgz
.SRCINFO
#!/usr/bin/env python3
"""
Mask low-quality bases in a FASTQ file with 'N'.
Adjust cutoff_front and cutoff_back below to use
different thresholds (currently: 20 at 5' end,
0 at 3' end).
Usage:
python3 qualmask.py input.fastq.gz > output.fastq
@darencard
darencard / extract_fastq_bam.md
Last active July 14, 2023 06:19
Extract paired FASTQ reads from a BAM mapping file

Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.

Extracting paired FASTQ read data from a BAM mapping file

Sometimes FASTQ data is aligned to a reference and stored as a BAM file, instead of the normal FASTQ read files. This is okay, because it is possible to recreate raw FASTQ files based on the BAM file. The following outlines this process. The useful software samtools and bedtools are both required.

From each bam, we need to extract:

  1. reads that mapped properly as pairs
  2. reads that didn’t map properly as pairs (both didn’t map, or one didn’t map)
@ctb
ctb / README.md
Last active September 7, 2017 12:10

banded kraken - example usage

Prepare the database:

mkdir ecoli_many_sigs
cd ecoli_many_sigs
curl -O -L https://github.com/dib-lab/sourmash/raw/master/data/eschericia-sigs.tar.gz
tar xzf eschericia-sigs.tar.gz
cd ../
@kahlos
kahlos / matlab-silent-install.sh
Last active June 23, 2020 14:50
MATLAB silent install script
# Script to silently install MATLAB components, run as root if installing to /opt
# Requires: `license.lic`, `packages` list and `file-install-key` files
# Download license.lic and create file-install-key file from [MATLAB license centre](https://uk.mathworks.com/licensecenter/licenses)
# Download and extract latest [MATLAB installer](https://uk.mathworks.com/downloads/)
# Download packages `archive` files by running installer graphically first
# Make a package list, uncommenting lines from installer_input, `tail -87 installer_input.txt > packages`
# Check destination directories are correct below
# Destination, MATLAB installer and config files directory
@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@trinker
trinker / dumbellplot
Created April 16, 2017 17:27
Dumbell plot
dat <- data.frame(
freq = c(37, 88, 47, 89, 28, 68, 65, 98, 68, 86, 50, 87, 59, 82, 45, 65, 52, 32, 59, 47, 68, 78, 39, 31, 64, 68)
)
dat[["sector"]] <- rep(c("U.S. adults", "AAAS scientist"), nrow(dat)/2)
field <- c("Biomedical sciences", "Climate, energy, space sciences")
dat[["field"]] <- factor(rep(field, c(10, 16)), levels=field)
items <- c(
@hkmix
hkmix / pi_approx.cc
Last active April 29, 2017 01:19
Pi Day Challenge entry
#include <iostream>
#include <iomanip>
#include <random>
#include <string>
#include <thread>
#include <vector>
using std::size_t;
class Point {
snippet gg
ggplot(${1:data}, aes(${2:aes})) +
geom_${3:geom}()
snippet shiny
library(shiny)
ui <- fluidPage(
${1:ui}
)