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
@alienzj
alienzj / saxpy.cpp
Created August 29, 2017 14:42 — forked from scchan/saxpy.cpp
hcc saxpy example
#include <random>
#include <algorithm>
#include <iostream>
#include <cmath>
// header file for the hc API
#include <hcc/hc.hpp>
#define N (1024 * 500)
@alienzj
alienzj / README.md
Created September 7, 2017 12:10 — forked from ctb/README.md

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 ../
@alienzj
alienzj / matlab-silent-install.sh
Created November 2, 2017 00:24 — forked from kahlos/matlab-silent-install.sh
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
@alienzj
alienzj / konsole-with-palette-colours.css
Created November 22, 2017 12:32 — forked from codemedic/konsole-with-palette-colours.css
CSS for KDE Konsole minimal, lighter, dark tabs
QTabBar,
QTabBar::tab
{
font-family: "Noto Sans";
font-size: 11px;
height: 16px;
padding: 2px;
border: 0px;
border-bottom: 3px solid palette(dark);
background-color: palette(dark);
@alienzj
alienzj / reads_length_dist.sh
Created November 28, 2017 06:16 — forked from l-modolo/reads_length_dist.sh
compute reads length distribution from a fastq file
#!/bin/sh
# compute reads length distribution from a fastq file
awk 'NR%4 == 2 {lengths[length($0)]++} END {for (l in lengths) {print l, lengths[l]}}' file.fastq
@alienzj
alienzj / extract_fastq_bam.md
Created April 28, 2018 10:03 — forked from darencard/extract_fastq_bam.md
Extract paired FASTQ reads from a BAM mapping file

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)

For #1, the following command will work. This was taken from this webpage.

@alienzj
alienzj / custom_iterator.cpp
Created April 29, 2018 08:45 — forked from jeetsukumaran/custom_iterator.cpp
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
@alienzj
alienzj / memusg
Created June 19, 2018 10:00 — forked from netj/memusg
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
#pragma once
#include <boost/noncopyable.hpp>
#include <boost/beast/websocket.hpp>
#include <boost/beast/websocket/ssl.hpp>
struct websocket_stream : boost::noncopyable
@alienzj
alienzj / spacemacs-cheshe.md
Created December 21, 2018 07:28 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers