Skip to content

Instantly share code, notes, and snippets.

@zachcp
zachcp / gb_to_biosql.py
Created February 26, 2012 23:03
Upload a Genbank File to a local Mysql BioSQL database
#!/usr/bin/env python
"""Load a genbankfile into BioSQL
You will need to adjust the database parameters and have a BioSQL database set
up. See:
http://biopython.org/wiki/BioSQL
adapted from bchapmanns github script
https://github.com/chapmanb/bcbb > gff > Scripts > gff > gff_to_biosql.py
@zachcp
zachcp / batch_gb_to_BioSQL.py
Created February 27, 2012 00:10
batch upload of genbankfiles to BioSQL database
#!/usr/bin/env python
"""Load multiple genbankfiles into BioSQL
You will need to adjust the database parameters and have a BioSQL database set
up. See: http://biopython.org/wiki/BioSQL
adapted from bchapmanns github script
https://github.com/chapmanb/bcbb > gff > Scripts > gff > gff_to_biosql.py
and from single upload script:
@zachcp
zachcp / index.html
Last active December 9, 2015 22:49
d3 soil map
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/d3.geo.projection.v0.min.js"></script>
<script src="http://d3js.org/topojson.v0.min.js"></script>
<style type="text/css">
@zachcp
zachcp / README.md
Last active December 10, 2015 06:28 — forked from mbostock/.block

A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.

@zachcp
zachcp / README.md
Created January 4, 2013 18:26 — forked from jczaplew/README.md

States will adjust in size relative to the width of the container div, which allows SVG elements to be appropriately sized regardless of device size or screen resolution, making it a good way to integrate D3 and Bootstrap.

Click "Open in a new window", change the size of your browser window, and the states will scale with it. *Will not work in the standard bl.ocks.org view

Please let me know if there is a better/native way to do this!

@zachcp
zachcp / index.html
Last active December 10, 2015 23:59
Soil Animation Looping Issue
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<head>
<style>
.states {
fill: #ccc;
stroke: #fff;
}
@zachcp
zachcp / README
Created January 22, 2013 04:27 — forked from mattbaker/README
This example expects to have d3.min.js and d3.layout.min.js in the same directory as pie.js and pie_serv.js.
Run with node pie_serv.js
<!DOCTYPE>
<html>
<head>
<script src="http://chmille4.github.com/Scribl/js/Scribl.1.0.min.js"></script>
<script src="http://chmille4.github.com/Scribl/js/genbankData.js"></script>
<link rel="stylesheet" id="themeCSS" href="http://chmille4.github.com/Scribl/css/iThing.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script src="http://static.tumblr.com/fcdode8/Giymeu17u/jquery.mousewheel.min.js"></script>
<script src="http://static.tumblr.com/fcdode8/WVbmeu18t/jqallrangesliders-min.js"></script>
@zachcp
zachcp / NP_Groups.csv
Created September 30, 2013 02:59
Groups Investigating Natural Product Biosynthesis
Last Name First Name Institution Latitude Longitude Webpage Twitter ORCID
Brady Sean F. The Rockefeller University 40.7626 -73.9555 http://lab.rockefeller.edu/brady/
Challis Gregory The University of Warwick 52.3821 -1.5624 http://www2.warwick.ac.uk/fac/sci/chemistry/research/challis
Clardy John Harvard University 42.3581 -71.0636 http://clardy.med.harvard.edu/
Fishbach Michael UCSF 37.7633 122.4585 http://www.fischbachgroup.org/michaelfischbach
Jensen Paul The Scripps Institute of Oceanography 32.866353 -117.25218 http://scrippsscholars.ucsd.edu/pjensen
Khosla Chaitan Stanford University 37.43 -122.17 http://www.stanford.edu/group/khosla/Home.html
Magarvey Nathan McMaster University 43.2633 -79.9189 http://iidr.mcmaster.ca/investigators/nathan-magarvey.html
Marahiel Mohammed Philipps-Universität Marburg 50.8108 8.7736 http://www.uni-marburg.de/fb15/ag-marahiel
O'Conner Sarah The John Innes Centre 52.6283 1.2967 http://www.jic.ac.uk/staff/sarah-oconnor/ SOC_at_JIC
@zachcp
zachcp / fasta histograms
Created November 26, 2013 16:44
Quick Histograms of Fasta File lengths Using biopython+pandas
import glob
from Bio import SeqIO
import pandas as pd
files = glob.glob('./*fasta')
def get_size_frequencies(fasta):
with open(fasta, 'r') as f:
lengths = [len(rec.seq) for rec in SeqIO.parse(f,'fasta')]
lengths = pd.Series(lengths)