scripts/preprocessing/relabel_seed.py
def load_fasta_file_to_dict(fasta):
    """
    Loads a fasta file (seqdb) into a dictionary with the sequence
    accession used as a key and the sequence as a value

    fasta: A valid sequence file in fasta format

    return: A python dictionary with accession:sequence pairs
    """

    fasta_dict = {}

    fasta_fp = open(fasta, 'r')

    accession = ""

    flag_init_seq = 0

    for line in fasta_fp:

        # fetching accession from fasta header
        # with the 1st statement you ensure that
        if line[0] == '>':
            line = line.strip()
            # go on and extract header and initialize key pair in dict
            elements = line[1:].split(' ')
            accession = elements[0]
            fasta_dict[accession] = ""

        # keep building the sequence
        else:
            # replace Us in sequences (SEED) with Ts
            line = line.strip().replace('U', 'T')
            fasta_dict[accession] += line

    fasta_fp.close()

    return fasta_dict

    Loads a fasta file (seqdb) into a dictionary with the sequence
    accession used as a key and the sequence as a value

    fasta: A valid sequence file in fasta format

    return: A python dictionary with accession:sequence pairs
    
Loads a fasta file (seqdb) into a dictionary with the sequence
accession used as a key and the sequence as a value

A valid sequence file in fasta format

A python dictionary with accession:sequence pairs
Loads a fasta file ( seqdb ) into a dictionary with the sequence accession used as a key and the sequence as a value A valid sequence file in fasta format A python dictionary with accession : sequence pairs
def load_fasta_file_to_dict(fasta):
    fasta_dict = {}
    fasta_fp = open(fasta, 'r')
    accession = ""
    flag_init_seq = 0
    for line in fasta_fp:
        if line[0] == '>':
            line = line.strip()
            elements = line[1:].split(' ')
            accession = elements[0]
            fasta_dict[accession] = ""
        else:
            line = line.strip().replace('U', 'T')
            fasta_dict[accession] += line
    fasta_fp.close()
    return fasta_dict
def load_fasta_file_to_dict ( fasta ) : fasta_dict = { } fasta_fp = open ( fasta , 'r' ) accession = "" flag_init_seq = 0 for line in fasta_fp : if line [ 0 ] == '>' : line = line . strip ( ) elements = line [ 1 : ] . split ( ' ' ) accession = elements [ 0 ] fasta_dict [ accession ] = "" else : line = line . strip ( ) . replace ( 'U' , 'T' ) fasta_dict [ accession ] += line fasta_fp . close ( ) return fasta_dict
Loads a fasta file (seqdb) into a dictionary with the sequence
accession used as a key and the sequence as a value
Loads a fasta file ( seqdb ) into a dictionary with the sequence accession used as a key and the sequence as a value
"""
    Loads a fasta file (seqdb) into a dictionary with the sequence
    accession used as a key and the sequence as a value

    fasta: A valid sequence file in fasta format

    return: A python dictionary with accession:sequence pairs
    """ # fetching accession from fasta header # with the 1st statement you ensure that # go on and extract header and initialize key pair in dict # keep building the sequence # replace Us in sequences (SEED) with Ts
fasta