Skip to content

Instantly share code, notes, and snippets.


Bedtools Cheatsheet


Tools Description
flank Create new intervals from the flanks of existing intervals.
slop Adjust the size of intervals.
shift Adjust the position of intervals.
subtract Remove intervals based on overlaps b/w two files.
ilevantis /
Created Oct 13, 2017
parse the txt output of hmmsearch (hmmer3)
#!/usr/bin/env python3
import re
from ast import literal_eval
import numpy as np
def parse_val(s):
return literal_eval(s)
ilevantis / EvolDir-RSSifier.php
Created Feb 27, 2016
Turn EvolDir categories into RSS feeds
View EvolDir-RSSifier.php
header('Content-Type: application/rss+xml; charset=UTF-8');
$list_name = htmlspecialchars($_GET['lname']);
$list_url = ''.$list_name.'/';
$month_num = array (
"Jan" => 1,
"Feb" => 2,
ilevantis / useful_cmds
Last active Aug 29, 2015
Useful shell commands
View useful_cmds
## Delete files not matching "*.tex" :
find . -maxdepth 1 -type f ! -iname "*.tex" -delete
ilevantis / mfasta-sfasta awk command
Last active Aug 29, 2015
Split a multi fasta from uniprot into sensibly named indidvual entry fasta files
View mfasta-sfasta awk command
awk 'BEGIN{ FS = "|"}/>/{FS = "|"; filename = substr($3,1,12) }{print $0 > "<output-dir-path>" filename ".fa"}' <multi-fasta-2bsplit>
ilevantis / Mixcloud RSSifier
Last active Mar 30, 2020
Turn mixcloud streams into an RSS feed e.g. for<mixcloudstream>/playlists/<streamplaylist-if-there-is-one>/ go to<mixcloudstream>&lname=<streamplaylist-if-there-is-one> to get an RSS feed of the stream or the playlist from the stream
View Mixcloud RSSifier
header('Content-Type: application/rss+xml; charset=UTF-8');
// suck in the query string variables
$feed_name = htmlspecialchars($_GET['fname']);
$list_name = htmlspecialchars($_GET['lname']);
// compose the api urls + other stuff depending on presence of playlist
if(isset($_GET['lname'])) {
$json_url = ''.$feed_name.'/playlists/'.$list_name.'/cloudcasts/';
You can’t perform that action at this time.