Skip to content

Instantly share code, notes, and snippets.

View Tabea-K's full-sized avatar

Tabea Kischka Tabea-K

  • Münster, Germany
View GitHub Profile
@Tabea-K
Tabea-K / bash_cheatsheet.md
Last active July 9, 2020 08:14
BASH commands
author date title
Tabea Kischka
2018-06-26
BASH Cheatsheet

BASH Cheatsheet

check for file on remote

# to list files that already exist on the server
@Tabea-K
Tabea-K / screen_how_to.md
Last active March 29, 2019 08:17
how to use the screen command

Screen how to

commands that are run from a bash shell, not within the screen session:

to start a "named" screen session, run

screen -mS "my_cool_name"

to start a "named" screen session that also contains the current working directory (or another variable) in the name

@Tabea-K
Tabea-K / ucscGene2bed12.py
Last active May 16, 2018 12:18
This script is used to conver a "gene" UCSC file into BED12 file
#!/usr/bin/env python
"""
A script that converts a UCSC gene format into BED12 format
Author: Tabea Kischka
Example for UCSC gene format:
594 NM_058167 chr1 - 1253911 1273854 1255202 1267992 7 1253911,1256044,1256991,1257207,1263345,1267861,1273665, 1255487,1256125,1257130,1257310,1263386,1267992,1273854, 0UBE2J2 cmpl cmpl 0,0,2,1,2,0,-1,
"""
import sys
@Tabea-K
Tabea-K / get_5utr.awk
Created November 8, 2016 10:29
Get the 5'UTR regions from a UCSC RefSeq file. Or any other gene file in similar format from UCSC. It skips all lines of genes that do not contain any CDs. It prints out a BED file
awk '{if ($5!=$7 && $6 != $8){print $0}}' data/hg38_refGene.txt | awk '{if ($4=="+"){print $3"\t"$5"\t"$7"\t"$2"\t"0"\t"$4} else if ($4=="-"){print $3"\t"$8"\t"$6"\t"$2"\t"0"\t"$4}}'
@Tabea-K
Tabea-K / bare_logging_argparse_example.py
Last active July 2, 2018 11:21
This script is an example for using argparse and logging module in one script!
#!/usr/bin/env python
# File created by Tabea Kischka at Mon Aug 1 2016
import sys
import os
import argparse
import logging
@Tabea-K
Tabea-K / sortbed.sh
Created June 9, 2016 09:16
Sorts a BED file karyotypically. After sorting, it checks if the input and output files have the same content.
#!/usr/bin/env bash
#
# Sorts a BED file karyotypically
# File created by Tabea Kischka at Thu Jun 9 11:15:44 CEST 2016
INFILE="$1"
OUTFILE="$2"
@Tabea-K
Tabea-K / csv2macdown.py
Created June 1, 2016 12:23
Converts a file in csv format into markdown (rather macdown) format.
#!/usr/bin/env python
"""
Turns tab delimited data to macdown table format.
Needs the csvtoolkit to be installed.
"""
import sys
import os
import tempfile
import argparse
@Tabea-K
Tabea-K / find_broken_symlinks.sh
Last active June 1, 2016 12:28
Prints a list of all broken symlinks in the current dir and its subdirs
@Tabea-K
Tabea-K / change_screen_window_title.sh
Last active June 1, 2016 12:27
Changes the title of a screen window
echo -e '\033k'"Super_title_includes_directory_${PWD}"'\033\\'
@Tabea-K
Tabea-K / fasta_order_genome_karyotypically.py
Last active May 16, 2018 12:22
Orders a multi fasta genome file by chromosome name in karyotypic order. I.e., after chr1 follows chr2, and not chr10.
#!/usr/local/bin/python
# File created by Tabea Kischka at Thu May 19 15:24:59 CEST 2016
# This script orders the sequence in a multi fasta file by the chromosome name in
# karyotypic oder, and not lexicographically.
# I.e., it creates this order: chr1, chr2, chr10, ...
# instead of the order chr1, chr10, chr2
import sys