Skip to content

Instantly share code, notes, and snippets.

View klprint's full-sized avatar

Kevin klprint

View GitHub Profile
@klprint
klprint / TMHMM_parser.py
Last active December 14, 2016 12:20
This script parses TMHMM short output to a full-length topology output.
#################################################################
######################## TMHMM Parser ###########################
#################################################################
# Created by: Kevin Leiss
# Last Updated: 14.12.2016
#
# License: Feel free to use the script, but please refer to me if
# you used it for publication.
#
@klprint
klprint / check_file.py
Created September 30, 2016 08:59
This python function checks whether a file exists. If not, the function waits for a user specified time and checks again. As soon as the file appears, a reaction can be specified. A log is written while the function runs to inform the user about the current status.
def check_output(file, interval_time, logfile_path):
import os
import time
status = os.path.isfile(file)
while status is not True:
f_log = open(logfile_path, 'a')
f_log.write(time.asctime() + '\t' + 'Still running\n')
@klprint
klprint / FastGrep.py
Created August 9, 2016 10:39
Searches in files with the same extension for sequences being provided by a fasta file. The script picks 15-16 base-pairs in the middle of each sequence in the fasta file and uses grep to find the number of occurrences.
import subprocess
import glob
# Functions
def read_multifasta(file_path):
is_entry = False
fasta_dict = {}
sequence = []
@klprint
klprint / ChangeChmod.txt
Created August 1, 2016 08:18
Change chmod for folder & all subfolders
# Sets chmod 755 for folder and all subfolders
find /opt/lampp/htdocs -type d -exec chmod 755 {} \;
# Sets chmod 655 for all files in this folder & subfolder
find /opt/lampp/htdocs -type f -exec chmod 644 {} \;
@klprint
klprint / gist:5b10ff18c91f26d890631a8780faffe1
Created August 1, 2016 07:12 — forked from fajrif/gist:1265203
git clone specific tag
git clone <repo-address>
git tag -l
git checkout <tag-name>
git branch -D master
git checkout -b master