From 83fc6e1af34c8b58d12fc6a81d56a24054bffafc Mon Sep 17 00:00:00 2001 From: Samuel Mondal <mondal0000@bz-rgab01-pdm02.bioz.unibas.ch> Date: Mon, 28 Nov 2022 15:37:31 +0100 Subject: [PATCH] function name change --- sequence_extractor/polyA.py | 6 +++--- tests/test_polyA.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 tests/test_polyA.py diff --git a/sequence_extractor/polyA.py b/sequence_extractor/polyA.py index cafa91b..e50102f 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 0000000..ead1507 --- /dev/null +++ b/tests/test_polyA.py @@ -0,0 +1,3 @@ +import pytest + +from polyA import poly -- GitLab