diff --git a/sequence_extractor/polyA.py b/sequence_extractor/polyA.py index cafa91b35da1c6244dde04b565b49923c2120a4f..e50102ff7efcc43794b43a0b65592d65a6117e0f 100644 --- a/sequence_extractor/polyA.py +++ b/sequence_extractor/polyA.py @@ -1,6 +1,6 @@ import numpy as np # To do: Taking probabilities of nucleotides from user and raising error if sum != 1 -def polyA_generator( +def poly_a_generator( exon: str, ) -> str: """Adds a PolyA tail to an exon sequence input into the function. @@ -15,7 +15,7 @@ def polyA_generator( polyA = ''.join(np.random.choice(listA,250,p=[0.9,0.040,0.020,0.020])) return (exon+polyA) -def polyA_addition_to_fasta_list( +def poly_a_addition_to_fasta_list( fasta_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. @@ -26,5 +26,5 @@ def polyA_addition_to_fasta_list( Returns: 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 diff --git a/tests/test_polyA.py b/tests/test_polyA.py new file mode 100644 index 0000000000000000000000000000000000000000..ead1507e6b262dae6b705401d8b34ed61bbf9309 --- /dev/null +++ b/tests/test_polyA.py @@ -0,0 +1,3 @@ +import pytest + +from polyA import poly