Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
# SE | |
cat SE.MATS.ReadsOnTargetAndJunctionCounts.txt | awk -F"\t" '{if($5=="+") print $5 $4 ":" $6 "-" $7 "," $5 $4 ":" $8 "-" $9 "," $5 $4 ":" $10 "-" $11; else print $5 $4 ":" $6 "-" $7 "," $5 $4 ":" $10 "-" $11 "," $5 $4 ":" $8 "-" $9;}' | tail -n +2 > se.txt | |
# MXE | |
cat MXE.MATS.ReadsOnTargetAndJunctionCounts.txt | awk -F"\t" '{if($5=="+") print $5 $4 ":" $6 "-" $7 "," $5 $4 ":" $10 "-" $11 "," $5 $4 ":" $12 "-" $13; else print $5 $4 ":" $6 "-" $7 "," $5 $4 ":" $12 "-" $13 "," $5 $4 ":" $10 "-" $11 }' | tail -n +2 > mxe.txt |
# Old versions of GNU libc can create problems for running binaries on linux. | |
# In general GNU libc is backward compatible but in no way is | |
# "forward" compatible. This means when creating binaries for applications, | |
# like python with pyinstaller, you need to use the oldest version of GNU libc | |
# as possible. To check the version, use the following command: | |
ldd --version |
#!/bin/bash | |
######################################### | |
# Installing python and necessary packages | |
# locally. This script will install python | |
# into the ~/local/bin directory and install | |
# numpy + scipy | |
######################################### | |
# installing python 2.7.3 |
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# PATH variable will need to be updated with $HOME/local/bin and the | |
# LD_LIBRARY_PATH variable will need $HOME/local/lib | |
# exit on error | |
set -e |
# if get recieve.denyCurrentBranch error try to pull from | |
# the repository instead of pushing. Alternatively just | |
# switch to a tmp branch. | |
# Permanently going back to previous commit | |
git reset --hard 123abc | |
# undo adding a file to be staged for commit | |
git reset myfile |
import pandas as pd | |
import numpy as np | |
# read df from delimited file | |
df = pd.read_csv('filename.txt', sep='\t') | |
# force printing out of dataframe | |
print df.to_string() | |
# apply a function to column/row |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
# run command on certain files in a directory | |
for file in ./myDir/*.abc | |
do | |
cmd [options] $file > output.txt | |
done | |
# run command using integer ranges | |
for i in {1..5} | |
do | |
echo "Welcome $i times" |
UCSC's track hubs allow multiple wig files to be displayed in a single custom track. Thus possibly overlaying multiple types of data or displaying strand specific read depth. Individual sub-tracks within a custom track can then be toggled on/off.
The official documentation of UCSC's track hubs can be found at http://genome.ucsc.edu/goldenPath/help/hgTrackHubHelp.html.
# sum a column | |
cat your_file.txt | awk '{sum+=$5} END {print sum}' | |
# use specific delimiters | |
cat your_file.txt | awk -F" " '{OFS="\t";}{print $1, $2-1, $3-1, $5}' | |
# grab certain lines in a file | |
cat your_file.txt | awk 'FNR==10' |