Skip to content

Instantly share code, notes, and snippets.

View romagnolid's full-sized avatar

Dario Romagnoli romagnolid

  • Prato, Italy
View GitHub Profile
@tgirke
tgirke / _Nvim-R-Tmux.md
Last active October 13, 2023 05:29
Nvim-R-Tmux: An Integrated Working Environment for R

Nvim-R-Tmux: Neovim-based IDE for R

!!! This Gist tutorial is deprecated. Its new version is available here !!!

This is some red text.

  • Author: Thomas Girke
  • Last update: 18-Nov-2020

@dyndna
dyndna / merge_bams_add_RG_CO_in_bam_header.md
Created January 28, 2016 23:36
Merge bam files using samtools merge, add @rg and @co tags in merged header file.

merge bams file and add @RG and @CO

Let's say you have two bam files from two different runs you need to merge.

  1. bam1_batch1.bam
  2. bam1_batch2.bam

Using samtools view -H <bamfile>, get @RG information for each of two bams. I usually get ID, DT and PL info. from bam header and then add SM (sample tag) tag using following script. You can run this script before samtools merge command in your PBS script.

@jwinder
jwinder / sonic-pi-tutorial.md
Last active September 22, 2023 20:12
Sonic Pi in-app tutorials concatenated - last synced 27-08-2023 - https://sonic-pi.net/tutorial.html - https://github.com/samaaron/sonic-pi - All credit & thanks to Sam Aaron!

1 Welcome to Sonic Pi

Welcome friend :-)

Welcome to Sonic Pi. Hopefully you're as excited to get started making your own sounds as I am to show you. It's going to be a really fun ride where you'll learn all about music, synthesis, programming, composition, performance and more.

@lestoni
lestoni / gist:8c74da455cce3d36eb68
Last active April 12, 2024 18:15
vim folding cheatsheet

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.
@digitaljhelms
digitaljhelms / gist:4287848
Last active April 23, 2024 21:43
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@nathanhaigh
nathanhaigh / deinterleave_fastq.sh
Last active January 22, 2024 15:25
deinterleave FASTQ files
#!/bin/bash
# Usage: deinterleave_fastq.sh < interleaved.fastq f.fastq r.fastq [compress]
#
# Deinterleaves a FASTQ file of paired reads into two FASTQ
# files specified on the command line. Optionally GZip compresses the output
# FASTQ files using pigz if the 3rd command line argument is the word "compress"
#
# Can deinterleave 100 million paired reads (200 million total
# reads; a 43Gbyte file), in memory (/dev/shm), in 4m15s (255s)
#
@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ngcrawford
ngcrawford / addReadGroup2BAMs.py
Created April 17, 2012 16:29
Script to add a @rg tags to SAM or BAM alignments
import os
import sys
import glob
import pysam
import argparse
import multiprocessing
def get_args():
'''Parse sys.argv'''
parser = argparse.ArgumentParser()