This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Users/Rad/anaconda/bin/python | |
# (c) 2013 Ryan Boehning | |
'''A Python implementation of the Smith-Waterman algorithm for local alignment | |
of nucleotide sequences. | |
''' | |
import argparse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
class SuppressAllOutput (object): | |
def __enter__(self): | |
sys.stderr.flush() | |
self.old_stderr = sys.stderr | |
sys.stderr = open('/dev/null', 'a+', 0) | |
sys.stdout.flush() | |
self.old_stdout = sys.stdout | |
sys.stdout = open('/dev/null', 'a+', 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Color the node labels in a Dendroscope tree. | |
### IMPORTS | |
require 'test/unit/assertions' | |
require 'optparse' | |
require 'pp' | |
require 'csv' | |
require 'ostruct' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Bio import SeqIO | |
handle = open("example.fasta", "rU") | |
record_dict = SeqIO.to_dict (SeqIO.parse (handle, "fasta")) | |
handle.close() | |
# you now have dict where the keys are the sequence IDs, e.g. record_dict["gi:12345678"] | |
# you can index in other ways with the "key_function". | |
# for example, if you wanted to index by the description of the sequence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# download sequences from db by id | |
### IMPORTS | |
require 'bio' | |
require 'ostruct' | |
require 'timeout' | |
require 'pp' | |
require 'test/unit/assertions' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Bio import SeqIO | |
handle = open("example.fasta", "rU") | |
record_dict = SeqIO.to_dict (SeqIO.parse (handle, "fasta")) | |
handle.close() | |
# you now have dict where the keys are the sequence IDs, e.g. record_dict["gi:12345678"] | |
# you can index in other ways with the "key_function". | |
# for example, if you wanted to index by the description of the sequence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Check alignment for gaps or ambiguous characters and possibly fix them. | |
### IMPORTS | |
require 'bio' | |
require 'test/unit/assertions' | |
require 'optparse' | |
require 'pp' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Reduce a sequence to solely the SNP sites. | |
### IMPORTS | |
require 'test/unit/assertions' | |
require 'optparse' | |
require 'pp' | |
require 'ostruct' | |
require 'date' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from os import path, system | |
# for each file | |
for infile in sys.argv[1:]: | |
# extract filename components | |
base, ext = path.splitext (infile) | |
new_name = base + ".png" | |
print "Converting %s to %s ..." % (infile, new_name) | |
system ("sips -s format png \"%s\" --out \"%s\"" % (infile, new_name)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__docformat__ = 'restructuredtext en' | |
### IMPORTS ### | |
import exceptions | |
import tempfile | |
import os | |
import sys | |
import shutil |