humann/quantify/modules.py
def compute_unmapped_and_unintegrated(gene_abundance_in_pathways, remaining_gene_abundance, unaligned_reads_count, pathways_abundance):
    """
    Compute the unmapped and unintegrated pathway values
    The compression constant is defined as the total abundance of all pathways divided by the total abundance of genes in pathways
    """
    
    # Compute the overall compression constant
    pathways_list=pathways_abundance.get_pathways_list()
    total_abundance_all_pathways=sum([pathways_abundance.get_score(pathway) for pathway in pathways_list])
    try:
        compression_all=total_abundance_all_pathways / ( gene_abundance_in_pathways.get("all",0) * 1.0 )
    except ZeroDivisionError:
        compression_all=0
    
    # Compute unmapped
    unmapped_all=compression_all * unaligned_reads_count
    
    # Compute unintegrated
    unintegrated_all=compression_all * remaining_gene_abundance.get("all",0)
    unintegrated_per_bug={}
    for bug in pathways_abundance.get_bugs_list():
        total_abundance_all_pathways=sum([pathways_abundance.get_score_for_bug(bug,pathway) for pathway in pathways_list])
        try:
            compression = total_abundance_all_pathways / ( gene_abundance_in_pathways.get(bug,0) * 1.0 )
        except ZeroDivisionError:
            compression=0 
        
        unintegrated_per_bug[bug]=compression * remaining_gene_abundance.get(bug,0)
    
    return unmapped_all, unintegrated_all, unintegrated_per_bug

    Compute the unmapped and unintegrated pathway values
    The compression constant is defined as the total abundance of all pathways divided by the total abundance of genes in pathways
    
Compute the unmapped and unintegrated pathway values
The compression constant is defined as the total abundance of all pathways divided by the total abundance of genes in pathways
Compute the unmapped and unintegrated pathway values The compression constant is defined as the total abundance of all pathways divided by the total abundance of genes in pathways
def compute_unmapped_and_unintegrated(gene_abundance_in_pathways, remaining_gene_abundance, unaligned_reads_count, pathways_abundance):
    pathways_list=pathways_abundance.get_pathways_list()
    total_abundance_all_pathways=sum([pathways_abundance.get_score(pathway) for pathway in pathways_list])
    try:
        compression_all=total_abundance_all_pathways / ( gene_abundance_in_pathways.get("all",0) * 1.0 )
    except ZeroDivisionError:
        compression_all=0
    unmapped_all=compression_all * unaligned_reads_count
    unintegrated_all=compression_all * remaining_gene_abundance.get("all",0)
    unintegrated_per_bug={}
    for bug in pathways_abundance.get_bugs_list():
        total_abundance_all_pathways=sum([pathways_abundance.get_score_for_bug(bug,pathway) for pathway in pathways_list])
        try:
            compression = total_abundance_all_pathways / ( gene_abundance_in_pathways.get(bug,0) * 1.0 )
        except ZeroDivisionError:
            compression=0 
        unintegrated_per_bug[bug]=compression * remaining_gene_abundance.get(bug,0)
    return unmapped_all, unintegrated_all, unintegrated_per_bug
def compute_unmapped_and_unintegrated ( gene_abundance_in_pathways , remaining_gene_abundance , unaligned_reads_count , pathways_abundance ) : pathways_list = pathways_abundance . get_pathways_list ( ) total_abundance_all_pathways = sum ( [ pathways_abundance . get_score ( pathway ) for pathway in pathways_list ] ) try : compression_all = total_abundance_all_pathways / ( gene_abundance_in_pathways . get ( "all" , 0 ) * 1.0 ) except ZeroDivisionError : compression_all = 0 unmapped_all = compression_all * unaligned_reads_count unintegrated_all = compression_all * remaining_gene_abundance . get ( "all" , 0 ) unintegrated_per_bug = { } for bug in pathways_abundance . get_bugs_list ( ) : total_abundance_all_pathways = sum ( [ pathways_abundance . get_score_for_bug ( bug , pathway ) for pathway in pathways_list ] ) try : compression = total_abundance_all_pathways / ( gene_abundance_in_pathways . get ( bug , 0 ) * 1.0 ) except ZeroDivisionError : compression = 0 unintegrated_per_bug [ bug ] = compression * remaining_gene_abundance . get ( bug , 0 ) return unmapped_all , unintegrated_all , unintegrated_per_bug
Compute the unmapped and unintegrated pathway values
The compression constant is defined as the total abundance of all pathways divided by the total abundance of genes in pathways
Compute the unmapped and unintegrated pathway values The compression constant is defined as the total abundance of all pathways divided by the total abundance of genes in pathways
"""
    Compute the unmapped and unintegrated pathway values
    The compression constant is defined as the total abundance of all pathways divided by the total abundance of genes in pathways
    """ # Compute the overall compression constant # Compute unmapped # Compute unintegrated
gene_abundance_in_pathways
remaining_gene_abundance
unaligned_reads_count
pathways_abundance