scripts/validation/validate_miRNA_seqs.py
def seed_to_dict(seed):
    """
    Relabels the accessions of a SEED alignment using RNAcentral
    identifiers. This is done by matching the seed sequences, with
    sequences existing in RNAcentral using md5 hashing.

    seed: A reformatted seed in Pfam format
    dest_dir: The path to the destination directory. None by default

    return: The path to the relabelled SEED alignement
    """
    rnac_miRNA_mappings = {}
    miRNA_mappings = {}

    filename = os.path.split(seed)[1].partition('.')[0]

    seed_fp = open(seed, 'r')

    for line in seed_fp:
        # check if this is an actual sequence line
        if line[0] != '#' and len(line) > 1 and line[0:2] != '//':
            line_elements = [x for x in line.strip().split(' ') if x != '']
            miRNA_mappings[line_elements[0]] = line_elements[1]

            sequence = line_elements[1].replace('.', '').replace('t', 'u').replace('T', 'U').upper()
            #md5_seq = sequence_to_md5(sequence)

            rnac_accession = generate_seed_id_from_RNAcentral(sequence)

            if rnac_accession is not None:
                rnac_miRNA_mappings[rnac_accession] = sequence

    seed_fp.close()

    return miRNA_mappings, rnac_miRNA_mappings

    Relabels the accessions of a SEED alignment using RNAcentral
    identifiers. This is done by matching the seed sequences, with
    sequences existing in RNAcentral using md5 hashing.

    seed: A reformatted seed in Pfam format
    dest_dir: The path to the destination directory. None by default

    return: The path to the relabelled SEED alignement
    
Relabels the accessions of a SEED alignment using RNAcentral
identifiers. This is done by matching the seed sequences, with
sequences existing in RNAcentral using md5 hashing.

A reformatted seed in Pfam format
dest_dir: The path to the destination directory. None by default

The path to the relabelled SEED alignement
Relabels the accessions of a SEED alignment using RNAcentral identifiers . This is done by matching the seed sequences with sequences existing in RNAcentral using md5 hashing . A reformatted seed in Pfam format dest_dir : The path to the destination directory . None by default The path to the relabelled SEED alignement
def seed_to_dict(seed):
    rnac_miRNA_mappings = {}
    miRNA_mappings = {}
    filename = os.path.split(seed)[1].partition('.')[0]
    seed_fp = open(seed, 'r')
    for line in seed_fp:
        if line[0] != '#' and len(line) > 1 and line[0:2] != '//':
            line_elements = [x for x in line.strip().split(' ') if x != '']
            miRNA_mappings[line_elements[0]] = line_elements[1]
            sequence = line_elements[1].replace('.', '').replace('t', 'u').replace('T', 'U').upper()
            rnac_accession = generate_seed_id_from_RNAcentral(sequence)
            if rnac_accession is not None:
                rnac_miRNA_mappings[rnac_accession] = sequence
    seed_fp.close()
    return miRNA_mappings, rnac_miRNA_mappings
def seed_to_dict ( seed ) : rnac_miRNA_mappings = { } miRNA_mappings = { } filename = os . path . split ( seed ) [ 1 ] . partition ( '.' ) [ 0 ] seed_fp = open ( seed , 'r' ) for line in seed_fp : if line [ 0 ] != '#' and len ( line ) > 1 and line [ 0 : 2 ] != '//' : line_elements = [ x for x in line . strip ( ) . split ( ' ' ) if x != '' ] miRNA_mappings [ line_elements [ 0 ] ] = line_elements [ 1 ] sequence = line_elements [ 1 ] . replace ( '.' , '' ) . replace ( 't' , 'u' ) . replace ( 'T' , 'U' ) . upper ( ) rnac_accession = generate_seed_id_from_RNAcentral ( sequence ) if rnac_accession is not None : rnac_miRNA_mappings [ rnac_accession ] = sequence seed_fp . close ( ) return miRNA_mappings , rnac_miRNA_mappings
Relabels the accessions of a SEED alignment using RNAcentral
identifiers.
Relabels the accessions of a SEED alignment using RNAcentral identifiers .
"""
    Relabels the accessions of a SEED alignment using RNAcentral
    identifiers. This is done by matching the seed sequences, with
    sequences existing in RNAcentral using md5 hashing.

    seed: A reformatted seed in Pfam format
    dest_dir: The path to the destination directory. None by default

    return: The path to the relabelled SEED alignement
    """ # check if this is an actual sequence line #md5_seq = sequence_to_md5(sequence)
seed