Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jacob-ogre's full-sized avatar

Jacob Malcom jacob-ogre

View GitHub Profile
@jacob-ogre
jacob-ogre / NUCmer_parallel.txt
Created June 17, 2014 01:43
NUCmer parallelization and --prefix
tl; dr: If parallelizing NUCmer by dividing a query into pieces, use the --prefix
flag to ensure separate mgap files are created rather than the single out.mgap.
### Fuller explanation ###
Trying to parallelize NUCmer alignment of assembly contigs to PacBio reads I ran
(repeatedly) into the error:
ERROR: Could not parse input from 'Query File'.
Please check the filename and format, or file a bug report
[
{
"args": null,
"command": "enter_visual_mode"
},
{
"args":
{
"action_args": null,
"action_command": null,
@jacob-ogre
jacob-ogre / jacob-ogre_ST2.sublime-keymap
Created June 26, 2013 17:56
Sublime Text: Custom keybindings, mostly Vintage (Vim)
[
// Working in some additional Vim or Vim-like bindings; using 'g' as <leader>
// because it's homerow and unused for most commands:
{ "keys": ["g", "t"], "command": "next_view", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["g", "r"], "command": "prev_view", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["g", "n"], "command": "focus_side_bar", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["g", "w"], "command": "focus_group", "args": { "group": 0 } },
{ "keys": ["g", "m"], "command": "find_under_expand", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["g", "s"], "command": "sftp_browse_server", "context": [{"key": "setting.command_mode"}] },
@jacob-ogre
jacob-ogre / number_of_columns.sh
Last active December 18, 2015 21:09
bash and awk: functions and aliases for counting columns in tab-, comma-, and space-delimited files. Goes nicely in .bashrc/.bash_profile.
function tab_ncol {
awk 'BEGIN {FS="\t"} ; END{print NF}' $1;
}
alias tncol='tab_ncol'
function comma_ncol {
awk 'BEGIN {FS=","} ; END{print NF}' $1;
}
alias cncol='comma_ncol'
@jacob-ogre
jacob-ogre / with_open_out.sublime-snippet
Created June 19, 2013 18:47
Python:Write file using with_open_as_out syntax
<snippet>
<content><![CDATA[
with open(${1:fil}, 'wb') as ${2:out}:
${3:code}
]]></content>
<tabTrigger>write</tabTrigger>
<scope>source.python</scope>
<description>WithOpenOut</description>
</snippet>
@jacob-ogre
jacob-ogre / Short_Docstring.sublime-snippet
Created June 14, 2013 23:49
Python: One-liner Python docstring Sublime Text snippet
<snippet>
<content><![CDATA[
"""${1:One-liner docstring}"""]]></content>
<tabTrigger>docs</tabTrigger>
<scope>source.python</scope>
<description>Short Docstring</description>
</snippet>
@jacob-ogre
jacob-ogre / Long_Docstring.sublime-snippet
Created June 14, 2013 23:47
Python: Long docstring
<snippet>
<content><![CDATA[
"""
${1:One-liner}
USAGE:
python ${2:file} ${3:args...}
ARGS:
${4:arg, explanation}
RETURNS:
@jacob-ogre
jacob-ogre / NerdTreeClose.py
Created June 12, 2013 21:47
Close the pseudo-NerdTree and return focus in Sublime Text 2
import sublime, sublime_plugin
class NerdTreeCloseCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.run_command("focus_group", {"group": 0} )
self.window.run_command("toggle_side_bar")
@jacob-ogre
jacob-ogre / NerdTree.py
Created June 12, 2013 21:46
NerdTree-like behavior for Sublime Text 2
import sublime, sublime_plugin
class NerdTreeCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.run_command("toggle_side_bar")
self.window.run_command("focus_side_bar")
new
split-window -h -p 50 -t 0
split-window -v -p 30 -t 1
# pane number display
set-window-option -g window-status-current-bg yellow
# keybindings
set-window-option -g mode-keys vi