Skip to content
Snippets Groups Projects
Commit 2192b4c9 authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

externalise code solutions

it will be easier to maintain and test
it will be easier for student to recover good code
parent b3d635e7
No related branches found
No related tags found
No related merge requests found
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
def fasta_2_one_line(seq):
header_end_at = find('\n')
seq = seq[:header_end_at + 1]
seq = seq.replace('\n', '')
return seq
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment