<commit_before>#!/usr/bin/env python

__author__ = 'shafferm'

"""
merge_biom_tables.py

Takes two biom tables and merges them.  Assumes that samples are all the same and observations are all different.
"""

import argparse
import sys

from biom import load_table


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("-1", "--table1", help="First biom table")
    parser.add_argument("-2", "--table2", help="Second biom table")
    parser.add_argument("-o", "--output", help="Output biom table")
    args = parser.parse_args()

    table1 = load_table(args.table1)
    table2 = load_table(args.table2)

    # check that samples are the same
    if table1.ids() != table2.ids():
        print "biom tables have different sample names"
        sys.exit()
<commit_msg>Changed checking sample names to be the same to casting to sets and seeing if sets of sample names are identical.<commit_after>#!/usr/bin/env python

__author__ = 'shafferm'

"""
merge_biom_tables.py

Takes two biom tables and merges them.  Assumes that samples are all the same and observations are all different.
"""

import argparse
import sys

from biom import load_table


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("-1", "--table1", help="First biom table")
    parser.add_argument("-2", "--table2", help="Second biom table")
    parser.add_argument("-o", "--output", help="Output biom table")
    args = parser.parse_args()

    table1 = load_table(args.table1)
    table2 = load_table(args.table2)

    # check that samples are the same
    if set(table1.ids()) != set(table2.ids()):
        print "biom tables have different sample names"
        sys.exit()

{'fraction_non_alphanumeric': 0.12026066350710901, 'fraction_numerical': 0.011848341232227487, 'mean_word_length': 3.665745856353591, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7109134', 'n_tokens_mistral': 520, 'n_tokens_neox': 503, 'n_words': 168}