Exemplo n.º 1
0
def get_dna_seq(query):
    """ displays DNA seq associated with the query"""
    dna_seq = DB.get_gene_entry(query)["DNA_seq"]
    if not dna_seq.isalpha():
        raise TypeError("Not valid")
    else:
        return dna_seq
Exemplo n.º 2
0
def get_coding_seq(query):
    """
    displays the coding region
    Parameters: query, type string
    Ouput: CDS
    """

    coord = DB.get_gene_entry(query)['CDS']
    coding_seq = get_dna_seq(query)[coord[0] - 1:coord[1]]
    return coding_seq
Exemplo n.º 3
0
def get_aminoacid_seq(query):
    """ displays the amino acid sequence
     parameters: query, type st
     ring
    returns the amino acid sequence"""
    amino_acid_seq = DB.get_gene_entry(query)["aminoacid_sequence"]
    if not amino_acid_seq.isalpha(
    ):  #checks if all characters in the string are alphabets
        raise TypeError("Not valid")
    else:
        return amino_acid_seq
Exemplo n.º 4
0
def get_CDS_coord(query):
    """
    displays the coordinates of CDS
    :return: a list of lists containing pairs of 2 coordinates
    """
    valid = False
    cds_coord = DB.get_gene_entry(query)['CDS']
    for coord in cds_coord:
        if type(coord) == int and coord > 0:
            valid = True
    if valid == True:
        return cds_coord
    else:
        raise TypeError("Not valid")
Exemplo n.º 5
0
def non_coding_dna_seq(query):
    """
    retrieves the non coding DNA sequence downstream and upstream of the coding region
    :param query:
    :return: non_coding_seq type string
    """
    non_coding_seq = ''
    whole_dna_seq = get_dna_seq(query)
    coord = DB.get_gene_entry(query)['CDS']
    start = coord[0]
    end = coord[1]
    upstream_non_coding = whole_dna_seq[0:(start - 1)]
    downstream_non_coding = whole_dna_seq[(end - 1):len(whole_dna_seq) - 1]
    non_coding_seq = non_coding_seq + upstream_non_coding + " " + downstream_non_coding
    return non_coding_seq
Exemplo n.º 6
0
 def by_genbank_identifier(genBank_id):
     return DB.get_gene_entry()
Exemplo n.º 7
0
 def by_chromosomal_loc(chromosomal_loc):
     return DB.get_gene_entry()
Exemplo n.º 8
0
 def by_protein_product(protein_name):
     return DB.get_gene_entry()
Exemplo n.º 9
0
 def by_accession_code(accession_code):
     return DB.get_gene_entry()