Beispiel #1
0
def get_cnr_psl(rcomp_psl_file):
    """
    return dictionary where
    
        cnr_psl[graph][node]
    
    is a list of read aligned to that node 
    
    c - comp
    n - node
    r - read
    """
    
    cnr_psl = defaultdict(lambda : defaultdict(list))
    
    for psl in read_psl(rcomp_psl_file):
        comp, node = psl.tName.split(":")
        cnr_psl[comp][node].append(psl)
    
    return cnr_psl
Beispiel #2
0
def get_rcc_psl(rcont_psl_file):
    """
    return a defaultdict(lambda : defaultdict(list))
    where
    
        rcc_psl[read][graph]
    
    is a list of alignments to contigs in that graph
    
    r - read
    1st c - comp
    2nd c - contig
    """
    
    rcc_psl = defaultdict(lambda : defaultdict(list))
    
    for psl in read_psl(rcont_psl_file):
        rcc_psl[psl.qName][psl.tName.split("_")[0]].append(psl)
    
    return rcc_psl