Skip to content
Snippets Groups Projects
Commit 83fc6e1a authored by Samuel Mondal's avatar Samuel Mondal
Browse files

function name change

parent 324c44c4
No related branches found
No related tags found
1 merge request!43function name change
import numpy as np import numpy as np
# To do: Taking probabilities of nucleotides from user and raising error if sum != 1 # To do: Taking probabilities of nucleotides from user and raising error if sum != 1
def polyA_generator( def poly_a_generator(
exon: str, exon: str,
) -> str: ) -> str:
"""Adds a PolyA tail to an exon sequence input into the function. """Adds a PolyA tail to an exon sequence input into the function.
...@@ -15,7 +15,7 @@ def polyA_generator( ...@@ -15,7 +15,7 @@ def polyA_generator(
polyA = ''.join(np.random.choice(listA,250,p=[0.9,0.040,0.020,0.020])) polyA = ''.join(np.random.choice(listA,250,p=[0.9,0.040,0.020,0.020]))
return (exon+polyA) return (exon+polyA)
def polyA_addition_to_fasta_list( def poly_a_addition_to_fasta_list(
fasta_list: list, fasta_list: list,
) -> list: ) -> list:
"""Takes in a list of tuples with annotations and exons and outputs a list where polyA tail has been added to all the exon 3' ends. """Takes in a list of tuples with annotations and exons and outputs a list where polyA tail has been added to all the exon 3' ends.
...@@ -26,5 +26,5 @@ def polyA_addition_to_fasta_list( ...@@ -26,5 +26,5 @@ def polyA_addition_to_fasta_list(
Returns: Returns:
A list like the initial list, this time with polyA tail added onto it. A list like the initial list, this time with polyA tail added onto it.
""" """
mature_rna_list = [(i[0],polyA_generator(i[1])) for i in fasta_list] mature_rna_list = [(i[0],poly_a_generator(i[1])) for i in fasta_list]
return mature_rna_list return mature_rna_list
import pytest
from polyA import poly
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment