Skip to content

Instantly share code, notes, and snippets.

View gregcaporaso's full-sized avatar
🌱

Greg Caporaso gregcaporaso

🌱
View GitHub Profile
@gregcaporaso
gregcaporaso / Lecture10.ipynb
Last active December 11, 2015 20:39
IPython Notebooks to support Greg Caporaso's Spring 2013 Bioinformatics I class at Northern Arizona University: http://caporaso.us/teaching/courses/bio299_spring_2013/index.html This work is licensed under the Creative Commons Attribution 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/us/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gregcaporaso
gregcaporaso / query_pubmed.py
Last active December 14, 2015 13:39
This is some really ancient code of mine that I'm reviving to generate some data for a figure.
#!/usr/bin/python
from urllib import urlopen
from time import sleep
from sys import argv
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2013, Greg Caporaso"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
@gregcaporaso
gregcaporaso / trim_mirna_adapters.py
Last active December 14, 2015 15:49
A very quick-and-dirty, untested script to see if it'll be possible to analyze miRNA sequence data in [QIIME](www.qiime.org). Just need this code to perform some initial sequence processing. THIS SCRIPT IS UNTESTED - DO NOT USE FOR ANYTHING IMPORTANT!!!
#!/usr/bin/env python
# File created on 07 Mar 2013
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.6.0-dev"
__maintainer__ = "Greg Caporaso"
@gregcaporaso
gregcaporaso / template_cl_interface.py
Last active December 15, 2015 03:49
A template that can be used as I work on QIIME issue #774: https://github.com/qiime/qiime/issues/774
#!/usr/bin/env python
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2013, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.6.0-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
@gregcaporaso
gregcaporaso / bad_otu_table.txt
Created March 20, 2013 15:34
An example of an OTU table that gives an annoying biom-format error.
#OTU ID s1 s2 s3
1 1 1
2 1 1 1
3 1 1 1
@gregcaporaso
gregcaporaso / biom_subsampled_replicates.py
Last active December 15, 2015 04:59
A quick script to generate a table of samples derived by subsampling each sample of a larger BIOM table c times to n sequences per sample.
#!/usr/bin/env python
# File created on 20 Mar 2013
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.6.0-dev"
__maintainer__ = "Greg Caporaso"
@gregcaporaso
gregcaporaso / otu_table.biom
Last active December 15, 2015 18:59
biom-format issue #120 example files
{"rows": [{"id": "0", "metadata": {"taxonomy": ["Root", "k__Bacteria", "p__Firmicutes", "c__Bacilli", "o__Bacillales", "f__Staphylococcaceae"]}}, {"id": "1", "metadata": {"taxonomy": ["Root", "k__Bacteria", "p__Firmicutes", "c__Clostridia", "o__Clostridiales", "f__Lachnospiraceae"]}}, {"id": "2", "metadata": {"taxonomy": ["Root", "k__Bacteria", "p__Bacteroidetes", "c__Bacteroidia", "o__Bacteroidales", "f__"]}}, {"id": "3", "metadata": {"taxonomy": ["Root", "k__Bacteria", "p__Bacteroidetes", "c__Bacteroidia", "o__Bacteroidales", "f__"]}}, {"id": "4", "metadata": {"taxonomy": ["Root", "k__Bacteria", "p__Firmicutes", "c__Clostridia", "o__Clostridiales", "f__Lachnospiraceae"]}}, {"id": "5", "metadata": {"taxonomy": ["Root", "k__Bacteria", "p__Bacteroidetes", "c__Bacteroidia", "o__Bacteroidales", "f__"]}}, {"id": "6", "metadata": {"taxonomy": ["Root", "k__Bacteria", "p__Firmicutes", "c__Clostridia", "o__Clostridiales", "f__Lachnospiraceae"]}}, {"id": "7", "metadata": {"taxonomy": ["Root", "k__Bacteria", "p__Firmic
@gregcaporaso
gregcaporaso / README.md
Last active December 15, 2015 20:58
Experimental wrappers for usearch 6.1. None of this is tested - just playing.

Closed-reference OTU picking:

usearch61 -usearch_global seqs.fna -db refseqs.fasta -id 0.97 -uc usearch_global.uc -strand both

De novo OTU picking:

@gregcaporaso
gregcaporaso / clean_nifH_tax.py
Created May 7, 2013 19:23
A single-use script for cleaning up taxonomy strings from a nifH database generated by Gady and Buckley (2012) and exported by the authors from ARB. This is being use to hack together a 13_5 release of a nifH database for use with PrimerProspector and QIIME. The database reference is: PLoS One. 2012;7(7):e42149. doi: 10.1371/journal.pone.0042149…
#!/usr/bin/env python
# File created on 07 May 2013
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.6.0-dev"
__maintainer__ = "Greg Caporaso"
@gregcaporaso
gregcaporaso / generate_sample_ids.py
Created May 29, 2013 20:26
Generate sample ids for the office surface succession project.
#!/usr/bin/env python
# File created on 29 May 2013
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.6.0-dev"
__maintainer__ = "Greg Caporaso"