scripts/preprocessing/relabel_seed.py
def map_rnacentral_urs_wirh_db_accessions(db_accession, expert_db):
    """
    Maps a database accession with a URS accession assigned by
    RNAcentral. The limitation

    db_accession: A valid member database accession already imported
    to RNAcentral
    expert_db: RNAcentral expert database to map the SEED accessions to

    return: The corresponding RNAcentral accession (URS)
    """

    rnacentral_url = "http://www.ebi.ac.uk/ebisearch/ws/rest/rnacentral?query=\"%s\" AND expert_db:\"%s\" AND so_rna_type_name:\"%s\""

    response = requests.get(rnacentral_url % (db_accession, expert_db, DB_RNA_TYPES[expert_db.lower()]))

    rnacentral_id = None

    if response.status_code == 200:
        xml_root = ET.fromstring(response.text)
        hit_count = int(xml_root.find("hitCount").text)

        if hit_count == 1:
            rnacentral_id = xml_root.find("entries").find("entry").get("id")

    return rnacentral_id

    Maps a database accession with a URS accession assigned by
    RNAcentral. The limitation

    db_accession: A valid member database accession already imported
    to RNAcentral
    expert_db: RNAcentral expert database to map the SEED accessions to

    return: The corresponding RNAcentral accession (URS)
    
Maps a database accession with a URS accession assigned by
RNAcentral. The limitation

A valid member database accession already imported
to RNAcentral
expert_db: RNAcentral expert database to map the SEED accessions to

The corresponding RNAcentral accession (URS)
Maps a database accession with a URS accession assigned by RNAcentral . The limitation A valid member database accession already imported to RNAcentral expert_db : RNAcentral expert database to map the SEED accessions to The corresponding RNAcentral accession ( URS )
def map_rnacentral_urs_wirh_db_accessions(db_accession, expert_db):
    rnacentral_url = "http://www.ebi.ac.uk/ebisearch/ws/rest/rnacentral?query=\"%s\" AND expert_db:\"%s\" AND so_rna_type_name:\"%s\""
    response = requests.get(rnacentral_url % (db_accession, expert_db, DB_RNA_TYPES[expert_db.lower()]))
    rnacentral_id = None
    if response.status_code == 200:
        xml_root = ET.fromstring(response.text)
        hit_count = int(xml_root.find("hitCount").text)
        if hit_count == 1:
            rnacentral_id = xml_root.find("entries").find("entry").get("id")
    return rnacentral_id
def map_rnacentral_urs_wirh_db_accessions ( db_accession , expert_db ) : rnacentral_url = "http://www.ebi.ac.uk/ebisearch/ws/rest/rnacentral?query=\"%s\" AND expert_db:\"%s\" AND so_rna_type_name:\"%s\"" response = requests . get ( rnacentral_url % ( db_accession , expert_db , DB_RNA_TYPES [ expert_db . lower ( ) ] ) ) rnacentral_id = None if response . status_code == 200 : xml_root = ET . fromstring ( response . text ) hit_count = int ( xml_root . find ( "hitCount" ) . text ) if hit_count == 1 : rnacentral_id = xml_root . find ( "entries" ) . find ( "entry" ) . get ( "id" ) return rnacentral_id
Maps a database accession with a URS accession assigned by
RNAcentral.
Maps a database accession with a URS accession assigned by RNAcentral .
"""
    Maps a database accession with a URS accession assigned by
    RNAcentral. The limitation

    db_accession: A valid member database accession already imported
    to RNAcentral
    expert_db: RNAcentral expert database to map the SEED accessions to

    return: The corresponding RNAcentral accession (URS)
    """
db_accession
expert_db