humann/quantify/modules.py
def compute_pathways_abundance_and_coverage(gene_scores, reactions_database, 
                                            pathways_and_reactions_store, pathways_database, unaligned_reads_count):
    """
    Compute the abundance and coverage of the pathways
    """
    
    # Read in and store the pathway id to name mappings
    pathway_names=store.Names(config.pathway_name_mapping_file)
    
    # Compute abundance for all pathways
    pathways_abundance, reactions_in_pathways_present=compute_pathways_abundance(
        pathways_and_reactions_store, pathways_database)
    
    # Compute the abundance of genes in pathways and not in pathways
    gene_abundance_in_pathways, remaining_gene_abundance=compute_gene_abundance_in_pathways(
        gene_scores, reactions_database, reactions_in_pathways_present)
    
    # Compute the unmapped and unintegrated values
    unmapped_all, unintegrated_all, unintegrated_per_bug=compute_unmapped_and_unintegrated(
        gene_abundance_in_pathways, remaining_gene_abundance, unaligned_reads_count, pathways_abundance)
    
    # Compute coverage for all pathways
    pathways_coverage=compute_pathways_coverage(pathways_and_reactions_store,
        pathways_database)

    # Get the sorted list of pathways and bugs from the abundance values
    # This same sorting will be used for both the abundance and coverage output files
    sorted_pathways_and_bugs=pathways_abundance.get_pathways_and_bugs_nonzero_sorted()

    # Print the pathways abundance data to file
    print_pathways(pathways_abundance, config.pathabundance_file, "_Abundance", 
                   pathway_names, sorted_pathways_and_bugs, unmapped_all,
                   unintegrated_all, unintegrated_per_bug)
    
    # Set the unmapped and unintegrated to one for coverage output
    unmapped_all=1
    unintegrated_all=1
    unintegrated_per_bug={bug:1 for bug in unintegrated_per_bug.keys()}
    
    # Print the pathways coverage data to file
    print_pathways(pathways_coverage, config.pathcoverage_file, "_Coverage", 
                   pathway_names, sorted_pathways_and_bugs, unmapped_all,
                   unintegrated_all, unintegrated_per_bug)

    return config.pathabundance_file, config.pathcoverage_file

    Compute the abundance and coverage of the pathways
    
Compute the abundance and coverage of the pathways
Compute the abundance and coverage of the pathways
def compute_pathways_abundance_and_coverage(gene_scores, reactions_database, 
                                            pathways_and_reactions_store, pathways_database, unaligned_reads_count):
    pathway_names=store.Names(config.pathway_name_mapping_file)
    pathways_abundance, reactions_in_pathways_present=compute_pathways_abundance(
        pathways_and_reactions_store, pathways_database)
    gene_abundance_in_pathways, remaining_gene_abundance=compute_gene_abundance_in_pathways(
        gene_scores, reactions_database, reactions_in_pathways_present)
    unmapped_all, unintegrated_all, unintegrated_per_bug=compute_unmapped_and_unintegrated(
        gene_abundance_in_pathways, remaining_gene_abundance, unaligned_reads_count, pathways_abundance)
    pathways_coverage=compute_pathways_coverage(pathways_and_reactions_store,
        pathways_database)
    sorted_pathways_and_bugs=pathways_abundance.get_pathways_and_bugs_nonzero_sorted()
    print_pathways(pathways_abundance, config.pathabundance_file, "_Abundance", 
                   pathway_names, sorted_pathways_and_bugs, unmapped_all,
                   unintegrated_all, unintegrated_per_bug)
    unmapped_all=1
    unintegrated_all=1
    unintegrated_per_bug={bug:1 for bug in unintegrated_per_bug.keys()}
    print_pathways(pathways_coverage, config.pathcoverage_file, "_Coverage", 
                   pathway_names, sorted_pathways_and_bugs, unmapped_all,
                   unintegrated_all, unintegrated_per_bug)
    return config.pathabundance_file, config.pathcoverage_file
def compute_pathways_abundance_and_coverage ( gene_scores , reactions_database , pathways_and_reactions_store , pathways_database , unaligned_reads_count ) : pathway_names = store . Names ( config . pathway_name_mapping_file ) pathways_abundance , reactions_in_pathways_present = compute_pathways_abundance ( pathways_and_reactions_store , pathways_database ) gene_abundance_in_pathways , remaining_gene_abundance = compute_gene_abundance_in_pathways ( gene_scores , reactions_database , reactions_in_pathways_present ) unmapped_all , unintegrated_all , unintegrated_per_bug = compute_unmapped_and_unintegrated ( gene_abundance_in_pathways , remaining_gene_abundance , unaligned_reads_count , pathways_abundance ) pathways_coverage = compute_pathways_coverage ( pathways_and_reactions_store , pathways_database ) sorted_pathways_and_bugs = pathways_abundance . get_pathways_and_bugs_nonzero_sorted ( ) print_pathways ( pathways_abundance , config . pathabundance_file , "_Abundance" , pathway_names , sorted_pathways_and_bugs , unmapped_all , unintegrated_all , unintegrated_per_bug ) unmapped_all = 1 unintegrated_all = 1 unintegrated_per_bug = { bug : 1 for bug in unintegrated_per_bug . keys ( ) } print_pathways ( pathways_coverage , config . pathcoverage_file , "_Coverage" , pathway_names , sorted_pathways_and_bugs , unmapped_all , unintegrated_all , unintegrated_per_bug ) return config . pathabundance_file , config . pathcoverage_file
Compute the abundance and coverage of the pathways
Compute the abundance and coverage of the pathways
"""
    Compute the abundance and coverage of the pathways
    """ # Read in and store the pathway id to name mappings # Compute abundance for all pathways # Compute the abundance of genes in pathways and not in pathways # Compute the unmapped and unintegrated values # Compute coverage for all pathways # Get the sorted list of pathways and bugs from the abundance values # This same sorting will be used for both the abundance and coverage output files # Print the pathways abundance data to file # Set the unmapped and unintegrated to one for coverage output # Print the pathways coverage data to file
gene_scores
reactions_database
pathways_and_reactions_store
pathways_database
unaligned_reads_count