scripts/preprocessing/relabel_seed.py
def fetch_sequence_from_rnacentral(rnacentral_id):
    """
    Uses RNAcentral's API to fetch corresponding sequence based on
    RNAcentral URS id

    rnacentral_id: A valid RNAcentral URS identifier e.g.

    return: Corresponding sequence if available, none otherwise
    """

    # isolate URS if necessary
    if rnacentral_id.find('_') != -1:
        rnacentral_id = rnacentral_id.partition('_')[0]

    rnacentral_url = "https://rnacentral.org/api/v1/rna/%s.fasta"

    response = requests.get(rnacentral_url % rnacentral_id)

    sequence = None

    # if request status is OK - remove header and merge sequence
    # segments
    if response.status_code == 200:
        sequence = ''.join(response.text.strip().split('\n')[1:])

    return sequence

    Uses RNAcentral's API to fetch corresponding sequence based on
    RNAcentral URS id

    rnacentral_id: A valid RNAcentral URS identifier e.g.

    return: Corresponding sequence if available, none otherwise
    
Uses RNAcentral's API to fetch corresponding sequence based on
RNAcentral URS id

A valid RNAcentral URS identifier e.g.

Corresponding sequence if available, none otherwise
Uses RNAcentral ' s API to fetch corresponding sequence based on RNAcentral URS id A valid RNAcentral URS identifier e . g . Corresponding sequence if available none otherwise
def fetch_sequence_from_rnacentral(rnacentral_id):
    if rnacentral_id.find('_') != -1:
        rnacentral_id = rnacentral_id.partition('_')[0]
    rnacentral_url = "https://rnacentral.org/api/v1/rna/%s.fasta"
    response = requests.get(rnacentral_url % rnacentral_id)
    sequence = None
    if response.status_code == 200:
        sequence = ''.join(response.text.strip().split('\n')[1:])
    return sequence
def fetch_sequence_from_rnacentral ( rnacentral_id ) : if rnacentral_id . find ( '_' ) != - 1 : rnacentral_id = rnacentral_id . partition ( '_' ) [ 0 ] rnacentral_url = "https://rnacentral.org/api/v1/rna/%s.fasta" response = requests . get ( rnacentral_url % rnacentral_id ) sequence = None if response . status_code == 200 : sequence = '' . join ( response . text . strip ( ) . split ( '\n' ) [ 1 : ] ) return sequence
Uses RNAcentral's API to fetch corresponding sequence based on
RNAcentral URS id
Uses RNAcentral ' s API to fetch corresponding sequence based on RNAcentral URS id
"""
    Uses RNAcentral's API to fetch corresponding sequence based on
    RNAcentral URS id

    rnacentral_id: A valid RNAcentral URS identifier e.g.

    return: Corresponding sequence if available, none otherwise
    """ # isolate URS if necessary # if request status is OK - remove header and merge sequence # segments
rnacentral_id