This file contains 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 python | |
from argparse import ArgumentParser | |
from numpy import array | |
from biom import load_table, Table | |
__author__ = "Adam Robbins-Pianka" | |
__copyright__ = "Copyright 2013" | |
__credits__ = ["Adam Robbins-Pianka"] |
This file contains 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 python | |
from sys import argv | |
from skbio.parse.sequences.fasta import parse_fasta | |
def calculate_gc_content(input_fasta): | |
gc = 0 | |
total_length = 0 |
This file contains 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 python | |
from amgut.lib.human_survey_supp import ( | |
question_map, responses_map, key_map, question_group, group_order, | |
supplemental_map, question_type) | |
from amgut.lib.locale_data.american_gut import _HUMAN_SURVEY | |
from amgut.lib.data_access.sql_connection import SQLConnectionHandler | |
conn = SQLConnectionHandler() |
This file contains 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 python | |
from datetime import datetime | |
from os.path import join | |
import click | |
from data_access_connections import data_access_factory | |
from enums import ServerConfig, DataAccessType | |
from qiita_db.study import StudyPerson |
This file contains 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 python | |
from datetime import datetime | |
from data_access_connections import data_access_factory | |
from enums import ServerConfig, DataAccessType | |
from amgut import db_conn | |
data_access = data_access_factory(ServerConfig.data_access_type, |
This file contains 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 python | |
import binascii | |
import os | |
from amgut import db_conn | |
def iter_old_surveys(): | |
sql = """select * from ag_human_survey""" |
This file contains 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 python | |
from sys import argv | |
prefixes = ['k__', 'p__', 'c__', 'o__', 'f__', 'g__', 's__'] | |
with open(argv[1], 'U') as input_f, open(argv[2], 'w') as output_f: | |
for line in input_f: | |
otu_id, tax, p = line.strip().split('\t') | |
tax = '; '.join([''.join(x) for x in zip(prefixes, tax.split(';'))]) |
This file contains 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 python | |
from sys import argv | |
with open(argv[1], 'U') as input_f, open(argv[2], 'w') as output_f: | |
for line in input_f: | |
# Write comment/header line(s) to output file unmodified | |
if line.startswith('#'): | |
output_f.write(line) | |
continue |