Пример #1
0
def run_all(gbfile, groupfile, transfile, tagFiles):
    # does this filter out replicates that appear in every tag?
    annodb, al, dna = analyze.read_genbank_annots(gbfile)
    snps = analyze.read_tag_files(tagFiles)
    gsd = analyze.map_snps(snps, al, dna)

    # Count nonsyn vs. syn. sites for each gene
    site_counts = genes_sites_dict(annodb)
    # Count nonsyn vs. syn. snps for each gene
    snp_counts = analyze.get_gene_na_ns(gsd)

    genes = annodb.keys()
    functional_groups = load_func_assoc(groupfile, transfile)

    #binomial_tests(snp_counts, site_counts)
    #main(site_counts, snp_counts, genes, functional_groups, test_func=binomial_test)
    for name, test_func in [("Fisher test", fisher_test),
                            ("Binomial Test", binomial_test)]:
        print name
        run_tests(site_counts,
                  snp_counts,
                  genes,
                  functional_groups,
                  test_func=test_func)
        print
Пример #2
0
def pathways_cmd(gbfile, groupfile, transfile, tagFiles):
    pathway_dict = load_func_assoc(groupfile, transfile)
    for k, v in pathway_dict.items():
        pathway_dict[k] = v[1]  # only keep the gene list

    annodb, al, dna = analyze.read_genbank_annots(gbfile)
    snps = analyze.read_tag_files(tagFiles)
    results = analyze.analyze_nonsyn_groups(pathway_dict, snps, annodb, al,
                                            dna)
    for k, v in results:
        print "%s,%s,%s" % (k, v, " ".join(pathway_dict[v]))
Пример #3
0
def pathways_cmd(gbfile, groupfile, transfile, tagFiles):
    pathway_dict = load_func_assoc(groupfile, transfile)
    for k,v in pathway_dict.items():
        pathway_dict[k] = v[1] # only keep the gene list
        
    annodb, al, dna = analyze.read_genbank_annots(gbfile)
    snps = analyze.read_tag_files(tagFiles)
    results = analyze.analyze_nonsyn_groups(pathway_dict, snps, annodb,
                                            al, dna)
    for k, v in results:
        print "%s,%s,%s" % (k, v, " ".join(pathway_dict[v]))
Пример #4
0
def run_all(gbfile, groupfile, transfile, tagFiles):
    # does this filter out replicates that appear in every tag?
    annodb, al, dna = analyze.read_genbank_annots(gbfile)
    snps = analyze.read_tag_files(tagFiles)
    gsd = analyze.map_snps(snps, al, dna)

    # Count nonsyn vs. syn. sites for each gene
    site_counts = genes_sites_dict(annodb)
    # Count nonsyn vs. syn. snps for each gene
    snp_counts = analyze.get_gene_na_ns(gsd)
    
    genes = annodb.keys()
    functional_groups = load_func_assoc(groupfile, transfile)

    #binomial_tests(snp_counts, site_counts)
    #main(site_counts, snp_counts, genes, functional_groups, test_func=binomial_test)
    for name, test_func in [("Fisher test", fisher_test), ("Binomial Test", binomial_test)]:
        print name
        run_tests(site_counts, snp_counts, genes, functional_groups,
                  test_func=test_func)
        print
Пример #5
0
def phenoseq_top_genes(gbfile, tagFiles):
    annodb, al, dna = analyze.read_genbank_annots(gbfile)
    snps = analyze.read_tag_files(tagFiles)
    results = analyze.analyze_nonsyn(snps, annodb, al, dna)
    return results
Пример #6
0
def phenoseq_top_genes(gbfile, tagFiles):
    annodb, al, dna = analyze.read_genbank_annots(gbfile)
    snps = analyze.read_tag_files(tagFiles)
    results = analyze.analyze_nonsyn(snps, annodb, al, dna)
    return results