Skip to content

Instantly share code, notes, and snippets.

View jairideout's full-sized avatar

Jai Ram Rideout jairideout

View GitHub Profile
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
import os
import os.path
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jairideout
jairideout / scikit-bio-fasta-io-performance-testing.ipynb
Last active August 29, 2015 14:07
scikit-bio performance testing: FASTA I/O rewrite
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jairideout
jairideout / strip_mapping_file_fields.py
Created October 16, 2013 15:25
Script to remove double quotes and leading/trailing whitespace from a QIIME metadata mapping file. Requires that QIIME 1.7.0 is installed.
#!/usr/bin/env python
__author__ = "Jai Ram Rideout"
__copyright__ = "Copyright 2013, The QIIME project"
__credits__ = ["Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.7.0"
__maintainer__ = "Jai Ram Rideout"
__email__ = "jai.rideout@gmail.com"
@jairideout
jairideout / scarf2fastq
Created October 15, 2013 16:58
Converts a SCARF file into a FASTQ file. This is based on Maq's fq_all2std.py's implementation (http://maq.sourceforge.net/) but does not attempt to modify the quality scores (they are copied over to the output FASTQ file).
#!/usr/bin/env python
import sys
if len(sys.argv) != 3:
sys.stderr.write("Usage: scarf2fastq.py <input SCARF filepath> "
"<output FASTQ filepath>\n")
sys.exit(1)
scarf_fp, fastq_fp = sys.argv[1:]
@jairideout
jairideout / img1.png
Last active December 10, 2015 00:18
Proof-of-concept for overlaying and toggling taxa summary plots that are generated by QIIME. This code assumes the two taxa summary plots (named img1.png and img2.png) and the overlib.js library are in the current directory with the file. To run, open the file in a web browser. Hit the "toggle" button to switch between the first and second image…
img1.png
@jairideout
jairideout / dfa.r
Created November 28, 2012 17:52
Script to run stepwise linear discriminant function analysis (DFA) on a classic QIIME OTU table.
# Runs a stepwise linear DFA on a classic QIIME OTU table and mapping file.
#
# usage:
# R --slave --args --source_dir $QIIME_HOME/qiime/support_files/R/ -i otu_table.txt -m Fasting_Map.txt -c Treatment -o dfa < dfa.r
#
# print help string:
# R --slave --args -h --source_dir $QIIME_HOME/qiime/support_files/R/ < dfa.r
#
# Requires command-line param --source_dir pointing to QIIME R source dir