Skip to content

Instantly share code, notes, and snippets.

View konrad's full-sized avatar

Konrad Förstner konrad

View GitHub Profile
@konrad
konrad / reademption_install.sh
Created July 30, 2014 21:03
READemption installation script
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 \
@konrad
konrad / medline_search.py
Last active August 29, 2015 14:09
Small script to retrieve data of all publications of a given journal in a given time frame from MEDLINE
#!/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 <konrad.foerster@uni-wuerzburg.de>
#
# To the extent possible under law, the author have dedicated all
@konrad
konrad / explore_music.sh
Last active August 29, 2015 14:13
Explore my music folder
# 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")
@konrad
konrad / split_fasta.py
Last active October 19, 2016 07:50
Split a multi entry fasta file into several files with on entry
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()
@konrad
konrad / get_bosc_tweets.py
Last active May 6, 2016 19:50
An example how to get all tweets containing a hashtag (here #BOSC2015) and storing each tweets as JSON string.
from TwitterSearch import *
import json
try:
tso = TwitterSearchOrder()
tso.set_keywords(['#BOSC2015'])
# Please replace with your credentials
ts = TwitterSearch(
consumer_key='REPLACE_ME',
consumer_secret='REPLACE_ME',

Keybase proof

I hereby claim:

  • I am konrad on github.
  • I am konradfoerstner (https://keybase.io/konradfoerstner) on keybase.
  • I have a public key whose fingerprint is 1D28 0E83 48EF 71FB 2975 8C68 C170 F2F8 3E02 D9A1

To claim this, I am signing this object:

# Problem: You have a NCBI GEO accession and would like to get the URL of the SRA file that contains the sequencing data.
# The sed command that removes the last characer of the string is essential as there is a invisible character that messes up the
# downstream steps otherwise.
GEO_ACCESSION="GSM1655353" # set you GEO accession here
SRA_FTP_URL=$(curl "http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=${GEO_ACCESSION}&targ=self&form=text&view=brief" 2>/dev/null | grep ftp-trace.ncbi.nlm.nih.gov | cut -c 32-| sed 's/.$//')
FTP_SUB_FOLDER=$(ncftpls ${SRA_FTP_URL}/)
SRA_FILE=$(ncftpls ${SRA_FTP_URL}/${FTP_SUB_FOLDER}/)
echo $GEO_ACCESSION ${SRA_FTP_URL}/${FTP_SUB_FOLDER}/${SRA_FILE}
@konrad
konrad / zika_PMID_search.txt
Created May 26, 2016 15:09
Pubmed IDs of publications that are the results of the search "zika virus[Mesh terms] OR zika fever[Mesh terms]"
27203499
27203498
27187993
27147017
27115821
27111981
27111968
27082204
27078543
27048000
@konrad
konrad / Dockerfile
Last active August 3, 2016 18:24
Dockerfile for testing "The Lair"
FROM ubuntu:16.04
RUN apt-get update && apt-get dist-upgrade -y
RUN apt-get install -y curl wget git ruby python3 sra-toolkit snakemake libssl-dev libcurl4-openssl-dev libxml2-dev
WORKDIR /root
RUN wget https://github.com/pachterlab/kallisto/releases/download/v0.43.0/kallisto_linux-v0.43.0.tar.gz && \
tar xzf kallisto_linux-v0.43.0.tar.gz && \
mv kallisto_linux-v0.43.0/kallisto /usr/bin/ && \
rm -rf kallisto_linux-v0.43.0 kallisto_linux-v0.43.0.tar.gz

Keybase proof

I hereby claim:

  • I am konrad on github.
  • I am konradfoerstner (https://keybase.io/konradfoerstner) on keybase.
  • I have a public key whose fingerprint is 5801 2301 E981 C65D E0DB C0A1 41E6 AF4E DF9D B3D3

To claim this, I am signing this object: