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 / 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 / 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 / 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"}] },
[
{
"args": null,
"command": "enter_visual_mode"
},
{
"args":
{
"action_args": null,
"action_command": null,
@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