diff --git a/sequence_extractor/polyA.py b/sequence_extractor/polyA.py index 2c88e791ec06ef9024ffc45904a6f0c39d2258e8..dc24b2408b474f0cf2b645ce4bc8acf7015190af 100644 --- a/sequence_extractor/polyA.py +++ b/sequence_extractor/polyA.py @@ -1,6 +1,31 @@ import numpy as np def PolyA_generator(exon): +def PolyA_generator(exon): +"""Appends PolyA tail. + + This function appends a polyA tail on the transcript sequence based on a random selection of bases, with A defined as being in larger proportion.. + + Parameters + ---------- + arg1 : exon + Transcript sequence made up of exons. + + Returns + ------- + fasta + Transcript sequence with concatenated polyA tails. + + + + Raises + ------ + TypeError + ValueError: PolyA tail needs to contain majority As. + """ +listA = ['A','T','G','C'] + polyA = ''.join(np.random.choice(listA,250,p=[0.9,0.040,0.020,0.020])) + return (exon+polyA) listA = ['A','T','G','C'] polyA = ''.join(np.random.choice(listA,250,p=[0.9,0.040,0.020,0.020])) return (exon+polyA)