Skip to content

Commit

Permalink
Add commands to Command Palette
Browse files Browse the repository at this point in the history
  • Loading branch information
bosborne committed Jan 19, 2017
1 parent e362658 commit 12f9b4a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
9 changes: 5 additions & 4 deletions BioPythonUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def run(self, edit):
print("Entrez count: {}".format(ids['Count']))
dialog_result = sublime.ok_cancel_dialog(
"Download {0} sequences? 'retmax': {1}".format(ids['Count'],
entrez_retmax), 'Download')
entrez_retmax),
'Download')

if dialog_result is True:
try:
Expand Down Expand Up @@ -168,7 +169,7 @@ def run(self):
self.result = False


# "Download Taxon"
# "Download Sequence by Taxon"
class DownloadSequenceByTaxonCommand(sublime_plugin.TextCommand):

def run(self, edit):
Expand Down Expand Up @@ -431,8 +432,8 @@ def run(self, edit):

seqin.close()
else:
# Assume it's plain sequence and use an incrementing number as
# an id
# Assume it's "plain" format and use an incrementing
# number as an id
seq_id = 1
for seq_str in re.split('^\s*\n', seq_str, 0, re.MULTILINE):
seq_str = re.sub("[^a-zA-Z]", "", seq_str)
Expand Down
1 change: 1 addition & 0 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{ "keys": ["ctrl+alt+super+t"], "command": "translate" },
{ "keys": ["ctrl+alt+super+g"], "command": "genbank_to_fasta" },
{ "keys": ["ctrl+alt+super+d"], "command": "download_sequence_by_id" },
{ "keys": ["ctrl+alt+super+s"], "command": "download_sequence_by_search" },
{ "keys": ["ctrl+alt+super+x"], "command": "download_taxon" },
{ "keys": ["ctrl+alt+super+b"], "command": "remote_blast" }
]
1 change: 1 addition & 0 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{ "keys": ["ctrl+alt+super+t"], "command": "translate" },
{ "keys": ["ctrl+alt+super+g"], "command": "genbank_to_fasta" },
{ "keys": ["ctrl+alt+super+d"], "command": "download_sequence_by_id" },
{ "keys": ["ctrl+alt+super+s"], "command": "download_sequence_by_search" },
{ "keys": ["ctrl+alt+super+x"], "command": "download_taxon" },
{ "keys": ["ctrl+alt+super+b"], "command": "remote_blast" }
]
1 change: 1 addition & 0 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{ "keys": ["ctrl+alt+super+t"], "command": "translate" },
{ "keys": ["ctrl+alt+super+g"], "command": "genbank_to_fasta" },
{ "keys": ["ctrl+alt+super+d"], "command": "download_sequence_by_id" },
{ "keys": ["ctrl+alt+super+s"], "command": "download_sequence_by_search" },
{ "keys": ["ctrl+alt+super+x"], "command": "download_taxon" },
{ "keys": ["ctrl+alt+super+b"], "command": "remote_blast" }
]
24 changes: 24 additions & 0 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,30 @@
}
},
{
"caption": "BioPythonUtils: Remote Blast",
"command": "remote_blast"
},
{
"caption": "BioPythonUtils: Genbank To Fasta",
"command": "genbank_to_fasta"
},
{
"caption": "BioPythonUtils: Translate",
"command": "translate"
},
{
"caption": "BioPythonUtils: Get Sequences by Search",
"command": "download_sequence_by_search"
},
{
"caption": "BioPythonUtils: Get Sequences by Taxon",
"command": "download_sequence_by_taxon"
},
{
"caption": "BioPythonUtils: Get Sequences by Id",
"command": "download_sequence_by_id"
},
{
"caption": "BioPythonUtils: Select Remote BLAST database",
"command": "select_blast_database"
},
Expand Down

0 comments on commit 12f9b4a

Please sign in to comment.