Skip to content

Instantly share code, notes, and snippets.

View jluebeck's full-sized avatar

Jens Luebeck jluebeck

View GitHub Profile
@jluebeck
jluebeck / unmap_bam.sh
Last active July 16, 2020 16:53
Unmap a bam file, supplied as a command line argument
#!/bin/bash
#requires samtools (1.3 or greater recommended)
#assumes you can use 6 threads for sorting! Change -@6 if needed.
#takes as input a single file (as argument)
#outputs 4 fastqs, r1 ("_1.fq"), r2 ("_2.fq"), ambiguous reads - both or neither r1 and r2 (_ambiguous.fq), single ended reads (_SE.fq)
@jluebeck
jluebeck / union_bed.sh
Created July 16, 2020 16:55
Using bedtools, create a new bed file which is the union of multiple bed files. Takes as input a file containing a list of bed files.
#!/bin/bash
cat $1 | while read f;
do
cat $f >> fullbed.bed
done
sort -k1,1 -k2,2n fullbed.bed > fullbed.sorted.bed
rm fullbed.bed
bedtools merge -i fullbed.sorted.bed > merged_bed_union.bed
@jluebeck
jluebeck / istat_overlap_karyogram_plot.py
Last active September 28, 2023 18:12
istat_overlap_karyogram_plot.py
#!/usr/bin/env python
'''
REQUIREMENTS:
'AA_DATA_REPO' environment variable: https://github.com/AmpliconSuite/AmpliconSuite-pipeline
'CV_SRC' (cycleviz) environent variable: https://github.com/AmpliconSuite/CycleViz
matplotlib
numpy
intervaltree