Skip to content

Instantly share code, notes, and snippets.

View blakesweeney's full-sized avatar

Blake Sweeney blakesweeney

View GitHub Profile
@blakesweeney
blakesweeney / RNAcentral_query.sql
Created January 29, 2020 10:38
Example SQL query for finding Bacterial entries
SELECT
precomputed.id
FROM rnc_rna_precomputed precomputed
JOIN rnc_taxonomy tax
ON
tax.id = precomputed.taxid
WHERE
tax.lineage LIKE 'cellular organisms; Bacteria; %'
AND precomputed.is_active = true -- exclude sequences without active cross-references
AND rna_type = 'rRNA'
@blakesweeney
blakesweeney / rnacentral_api.py
Last active January 30, 2020 11:35
Example of accessing RNAcentral data through our APIs
from pprint import pprint
import requests
# The metadata fields to fetch from the text search API
fields = [
'description',
'rna_type',
'has_secondary_structure',
'expert_db',
@blakesweeney
blakesweeney / alignment_server_access.py
Last active August 29, 2015 14:12
Programmatic Access to the Alignment Server
import time
import requests
FINISHED = set(['succeeded', 'failed'])
# Some large and slow requests may fail because of the retry limit in requests.
# Set the retry higher for these cases.
# 3 seconds is a pretty good wait most requests should be done in < 10 seconds.
def fetch(*args, **kwargs):
@blakesweeney
blakesweeney / gist:1759783
Created February 7, 2012 13:53
Alot crash from open quote
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.1/bin/alot", line 20, in <module>
main()
File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/alot/init.py", line 101, in main
args.colours,
File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/alot/ui.py", line 111, in __init__
self.mainloop.run()
File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/urwid-1.0.1-py2.7-macosx-10.4-i386.egg/urwid/main_loop.py", line 274, in run
self.screen.run_wrapper(self._run)
File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/urwid-1.0.1-py2.7-macosx-10.4-i386.egg/urwid/raw_display.py", line 237, in run_wrapper
@blakesweeney
blakesweeney / brew doctor
Created March 7, 2011 00:01
Can't find libgmp
Warning: Unbrewed dylibs were found in /usr/local/lib
You have unbrewed dylibs in /usr/local/lib. If you didn't put them there on purpose,
they could cause problems when building Homebrew formulae.
Unexpected dylibs (delete if they are no longer needed):
/usr/local/lib/libcdt.4.dylib
/usr/local/lib/libcgraph.5.dylib
/usr/local/lib/libgcc_s.1.dylib
/usr/local/lib/libgcc_s.10.4.dylib
/usr/local/lib/libgcc_s.10.5.dylib