Skip to content

Instantly share code, notes, and snippets.

View gregcaporaso's full-sized avatar
🌱

Greg Caporaso gregcaporaso

🌱
View GitHub Profile
@gregcaporaso
gregcaporaso / README.md
Last active December 18, 2015 10:39
Hack for converting TGEN SNP pipeline output into files that can be converted to BIOM format for analysis with QIIME.

This is all UNTESTED CODE!!

Description

This software allows users to convert TGEN SNP tables to legacy-formatted QIIME OTU tables, which can then be converted into BIOM tables with convert_biom.py (from the biom-format package). This was quickly hacked together, so is untested, but intended to be useful in figuring out if making these tables available in BIOM format will support useful analyses.

Install

@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"
@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 / 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 / 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 / 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 / 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 / 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 / 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 / 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"