Exemple #1
0
def build_mgi_ensembl_map():
    """
    @return: A bidirectional-map between MGI identifiers and Ensembl identifiers.
    """
    import csv, cookbook
    from biopsy import DbRef, db
    reader = csv.reader(open(mrk_ensembl_filename, "r"), delimiter='\t')
    result = cookbook.BidirectionalMap()
    for row in reader:
        result.add(DbRef.parse_as(row[0], db.mgi), DbRef.parse_as(row[5], db.ensembl))
    return result
Exemple #2
0
def build_mgi_ensembl_map():
    """
    @return: A bidirectional-map between MGI identifiers and Ensembl identifiers.
    """
    import csv, cookbook
    from biopsy import DbRef, db
    reader = csv.reader(open(mrk_ensembl_filename, "r"), delimiter='\t')
    result = cookbook.BidirectionalMap()
    for row in reader:
        result.add(DbRef.parse_as(row[0], db.mgi),
                   DbRef.parse_as(row[5], db.ensembl))
    return result
Exemple #3
0
def build_mgi_name_map():
    """
    @return: A map between MGI identifiers and marker names.
    """
    import csv, cookbook
    from biopsy import DbRef, db
    reader = csv.reader(open(mrk_ensembl_filename, "r"), delimiter='\t')
    return dict((DbRef.parse_as(row[0], db.mgi), row[1]) for row in reader)
Exemple #4
0
def build_mgi_name_map():
    """
    @return: A map between MGI identifiers and marker names.
    """
    import csv, cookbook
    from biopsy import DbRef, db
    reader = csv.reader(open(mrk_ensembl_filename, "r"), delimiter='\t')
    return dict(
            (DbRef.parse_as(row[0], db.mgi), row[1])
            for row
            in reader
    )
Exemple #5
0
def build_mgi_go_map():
    """
    @return: A map between MGI identifiers and GO ontologies.
    """
    import csv, cookbook
    from biopsy import DbRef, db
    reader = csv.reader(open(gene_association_filename, "r"), delimiter='\t')
    result = cookbook.DictOfSets()
    for row in reader:
        if row[0].startswith('!'):
            continue
        result[DbRef.parse_as(row[1], db.mgi)].add(row[4])
    return result
Exemple #6
0
def build_mgi_go_map():
    """
    @return: A map between MGI identifiers and GO ontologies.
    """
    import csv, cookbook
    from biopsy import DbRef, db
    reader = csv.reader(open(gene_association_filename, "r"), delimiter='\t')
    result = cookbook.DictOfSets()
    for row in reader:
        if row[0].startswith('!'):
            continue
        result[DbRef.parse_as(row[1], db.mgi)].add(row[4])
    return result