From 38103afa69b5ee536b1c183cbad0bb815103f569 Mon Sep 17 00:00:00 2001 From: Samuel Mondal <samuel.mondal@unibas.ch> Date: Fri, 25 Nov 2022 18:43:25 +0100 Subject: [PATCH] re-addition of script --- sequence_extractor/polyA.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sequence_extractor/polyA.py diff --git a/sequence_extractor/polyA.py b/sequence_extractor/polyA.py new file mode 100644 index 0000000..63919fa --- /dev/null +++ b/sequence_extractor/polyA.py @@ -0,0 +1,16 @@ +import numpy as np +# To do: Taking probabilities of nucleotides from user and raising error if sum != 1 +def PolyA_generator( + exon: str, +) -> str: + """Adds a PolyA tail to an exon sequence input into the function. + + Args: + exon: RNA sequence, obtained from concatenation of exons, that needs polyA to be added to its 3' end. + + Returns: + RNA with polyA tail added to its 3' end. + """ + listA = ['A','T','G','C'] + polyA = ''.join(np.random.choice(listA,250,p=[0.9,0.040,0.020,0.020])) + return (exon+polyA) -- GitLab