Skip to content

bioShaun/omsTricks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 

Repository files navigation

omsTricks

Simple solutions for some frequently met bioinformatics & programming problems.


Contents

Bioinformatics

[back to top]

Data Format

Methods for convertion between common bioinformatics data format.

gtf -> GenePred

Download gtfToGenePred from UCSC

gtfToGenePred \
    -genePredExt \
    -ignoreGroupsWithoutExons \
    your.gtf \
    /dev/stdout | \
    awk 'BEGIN { OFS="\t"} {print $12, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}' > your.GenePred

gff3 -> gtf

gffread input.gff3 -F -O -E -T -o- > output.gtf

Programming

[back to top]

Python

Get beijing time when your server timezone is UTC

import maya

time_now = maya.now().datetime(to_timezone='Asia/Shanghai')

Convert string representation of list to list in Python

import ast
x = u'[ "A","B","C" , " D"]'
x = ast.literal_eval(x)

Bash

Split string to list

#!/bin/bash
  
str="hello,world,i,like,you,babalala" 
arr=(${str//,/ }) 
for i in ${arr[@]} 
do 
    echo $i 
done

Emacs

Useful shortcuts

M-%    ;; replace
M-g g  ;; go-to line
M-;    ;; comment

Rectangle Commands

C-x r k ;; Kill a rectangle

About

Simple command line for bioinformatics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published