<commit_before>#!/usr/bin/env python
from __future__ import division

__author__ = "<NAME>"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "GPL"
__version__ = "1.5.0-dev"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"

from os.path import basename, join
from cogent.util.misc import create_dir
from qiime.parse import parse_taxa_summary_table
from qiime.util import (parse_command_line_parameters, get_options_lookup,
                        make_option)

from taxcompare.compare_taxa_summaries import (add_filename_suffix,
        comparison_modes, compare_taxa_summaries, correlation_types,
        parse_sample_id_map)

options_lookup = get_options_lookup()

script_info = {}
script_info['brief_description'] = "Compares taxa summary files"
script_info['script_description'] = """
This script compares two taxa summary files by computing the correlation
coefficient between pairs of samples. This is useful, for example, if you want
to compare the taxonomic composition of mock communities that were assigned
using different taxonomy assigners in order to see if they are correlated or
not. Another example use-case is to compare the taxonomic composition of
several mock community replicate samples to a single expected, or known, sample
community.

This script is also useful for sorting and filling taxa summary files so that
each sample has the same taxa listed in the same order (with missing taxa
reporting an abundance of zero). The sorted and filled taxa summary files can
then be passed to a script, such as plot_taxa_summary.py, to visually compare
the differences using the same taxa coloring scheme.
"""
script_info['script_usage'] = []
script_info['script_usage'].append(("Paired sample comparison",
"Compare all samples that have matching sample IDs between the two input taxa "
"summary files using the pearson correlation coefficient.",
"%prog -i ts_rdp_0.60.txt,ts_rdp_0.80.txt -m paired -o taxa_comp"))
script_info['script_usage'].append(("Paired sample comparison with sample ID "
"map", "Compare all samples that have sample ID mappings in the sample ID "
"map.", "%prog -i ts_rdp_0.60.txt,ts_rdp_0.80.txt -m paired -o taxa_comp"))
script_info['script_usage'].append(("Expected sample comparison",
"Compare all samples in the first taxa summary file to a taxa summary file "<commit_msg>Added another script usage example.<commit_after>#!/usr/bin/env python
from __future__ import division

__author__ = "<NAME>"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "GPL"
__version__ = "1.5.0-dev"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"

from os.path import basename, join
from cogent.util.misc import create_dir
from qiime.parse import parse_taxa_summary_table
from qiime.util import (parse_command_line_parameters, get_options_lookup,
                        make_option)

from taxcompare.compare_taxa_summaries import (add_filename_suffix,
        comparison_modes, compare_taxa_summaries, correlation_types,
        parse_sample_id_map)

options_lookup = get_options_lookup()

script_info = {}
script_info['brief_description'] = "Compares taxa summary files"
script_info['script_description'] = """
This script compares two taxa summary files by computing the correlation
coefficient between pairs of samples. This is useful, for example, if you want
to compare the taxonomic composition of mock communities that were assigned
using different taxonomy assigners in order to see if they are correlated or
not. Another example use-case is to compare the taxonomic composition of
several mock community replicate samples to a single expected, or known, sample
community.

This script is also useful for sorting and filling taxa summary files so that
each sample has the same taxa listed in the same order (with missing taxa
reporting an abundance of zero). The sorted and filled taxa summary files can
then be passed to a script, such as plot_taxa_summary.py, to visually compare
the differences using the same taxa coloring scheme.
"""
script_info['script_usage'] = []
script_info['script_usage'].append(("Paired sample comparison",
"Compare all samples that have matching sample IDs between the two input taxa "
"summary files using the pearson correlation coefficient.",
"%prog -i ts_rdp_0.60.txt,ts_rdp_0.80.txt -m paired -o taxa_comp"))
script_info['script_usage'].append(("Paired sample comparison with sample ID "
"map", "Compare all samples that have mappings in the sample ID "
"map using the pearson correlation coefficient.",
"%prog -i ts_rdp_0.80.txt,ts_rdp_0.60_renamed.txt -m paired -o taxa_comp -s "
"sample_id_map.txt"))
script_info['script_usage'].append(("Expected sample comparison",
"Compare all samples in the first taxa summary file to a taxa summary file "
{'fraction_non_alphanumeric': 0.07744453574363189, 'fraction_numerical': 0.0078060805258833195, 'mean_word_length': 5.37303664921466, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6800134', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1320, 'n_words': 551}