diff --git a/source/_static/code/amplicon_len.py b/source/_static/code/amplicon_len.py new file mode 100644 index 0000000000000000000000000000000000000000..3e9eeea9b3c222681fdaacefd7ac6119212f5d04 --- /dev/null +++ b/source/_static/code/amplicon_len.py @@ -0,0 +1,15 @@ + +def amplicon_len(seq, primer_1, primer_2): + """ + given primer_1 and primer_2 + return the lenght of the amplicon + primer_1 and primer_2 ar present and in this order + in sequence + """ + primer_1 = primer_1.upper() + primer_2 = primer_2.upper() + sequence = sequence.upper() + pos_1 = sv40_sequence.find(primer_1) + pos_2 = sv40_sequence.find(primer_2) + amplicon_len = pos_2 + len(primer_2) - pos_1 + return amplicon_len \ No newline at end of file diff --git a/source/_static/code/fasta_to_one_line.py b/source/_static/code/fasta_to_one_line.py new file mode 100644 index 0000000000000000000000000000000000000000..6ef59c05b921f85ff9fe6886321b83a0f696008e --- /dev/null +++ b/source/_static/code/fasta_to_one_line.py @@ -0,0 +1,7 @@ + +def fasta_2_one_line(seq): + header_end_at = find('\n') + seq = seq[:header_end_at + 1] + seq = seq.replace('\n', '') + return seq + diff --git a/source/_static/code/gc_percent.py b/source/_static/code/gc_percent.py new file mode 100644 index 0000000000000000000000000000000000000000..b5d988b99343fa3fdb6eabd2b8c5ce9aec539607 --- /dev/null +++ b/source/_static/code/gc_percent.py @@ -0,0 +1,4 @@ + +def gc_percent(seq): + gc_pc = float(seq.count('g') + seq.count('c')) / float(len(seq)) + return gc_pc \ No newline at end of file diff --git a/source/_static/code/vol_of_sphere.py b/source/_static/code/vol_of_sphere.py new file mode 100644 index 0000000000000000000000000000000000000000..72884956851f2ce1d5bee95928c00646380d560d --- /dev/null +++ b/source/_static/code/vol_of_sphere.py @@ -0,0 +1,9 @@ +import math + +def vol_of_sphere(radius): + """ + compute the volume of sphere of a given radius + """ + + vol = float(4)/float(3) * float(math.pi) * pow(radius, 3) + return vol