This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
from Bio import SeqIO | |
parser = argparse.ArgumentParser( | |
description="Split a multi entry fasta file into several files " | |
"with one entry") | |
parser.add_argument("input_file") | |
parser.add_argument("output_prefix") | |
args = parser.parse_args() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Search for all mp3 and ogg files in my music folder and use mplayer to play in random order | |
mplayer -shuffle -playlist $(find $MY_MUSIC_FOLDER -name "*ogg" -o -name "*mp3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# medline_search.py | |
# | |
# Small script to retrieve data of all publications of a given journal in | |
# a given time frame from MEDLINE | |
# | |
# 2014 - Konrad Förstner <[email protected]> | |
# | |
# To the extent possible under law, the author have dedicated all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main(){ | |
upgrade_and_install_packages | |
install_segemehl | |
install_reademption | |
} | |
upgrade_and_install_packages(){ | |
sudo apt-get update | |
sudo apt-get upgrade --assume-yes | |
sudo apt-get install --assume-yes \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
FUNCTION: Converts a CSV (tab delimited) file to an Excel xlsx file. | |
Copyright (c) 2016, Konrad Foerstner <[email protected]> | |
Permission to use, copy, modify, and/or distribute this software for | |
any purpose with or without fee is hereby granted, provided that the | |
above copyright notice and this permission notice appear in all | |
copies. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPEED=1.5 | |
for FILE in $@ | |
do | |
WAV_FILE=$(basename $FILE .mp4).wav | |
WAV_FILE_SPED_UP=$(basename $FILE .mp4)_spedup.wav | |
MP3_FILE=$(basename $FILE .mp4)_spedup.mp3 | |
ffmpeg -i $FILE -vn $WAV_FILE | |
sox $WAV_FILE $WAV_FILE_SPED_UP tempo $SPEED | |
lame $WAV_FILE_SPED_UP $MP3_FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Use this as a bookmarklet by saving it as a web browser bookmark. Then mark a piece of text in a page and click the bookmark. The marked text will be searched in Pubmed. | |
*/ | |
javascript:(function(){ | |
var selected_text = ''; | |
if (window.getSelection){ | |
selected_text = window.getSelection(); | |
} | |
else if (document.getSelection){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
base_seq = "ACGT" | |
seq = base_seq * int(int(sys.argv[1])/len(base_seq)) | |
spacer_length = 10000 | |
header = "@HD VN:1.0\n@SQ SN:Mock LN:%s" % (len(seq) + spacer_length) | |
cigar_string = "%sM" % (len(seq)) | |
genome_line = "62DJLAAXX_8:1:17056:1190 0 Mock 1 255 %s * 0 0 %s * NM:i:0 MD:Z:30 NH:i:1" % ( | |
cigar_string, seq) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I always forget how easy it is to download all genome files from | |
# Genbank. Sure you can get any other file type (e.g. all protein | |
# file = *faa) instead. | |
wget -c -r -A "*fna" ftp://ftp.ncbi.nih.gov/genomes/Bacteria/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
FUNCTION: A little example how to send messages to a OneSociaWeb server | |
(http://onesocialweb.org). Heavily inspired by Tyler | |
Gillies' ruby script with the same purpose. | |
Copyright (c) 2010, Konrad Foerstner <[email protected]> | |
Permission to use, copy, modify, and/or distribute this software for |