User:ShawnDouglas/scripts/primer.py

From OpenWetWare

Jump to: navigation, search
#!/usr/bin/env python

import string
import sys

# functions
def nowhite(s):
  return ''.join([c for c in s if c in string.letters])
def rev(s):
  return s[::-1]
complement = string.maketrans('ACGTacgt','TGCAtgca')
def comp(s):
  return rev(s.translate(complement))

upstream = 'TAGGTATTTCCATGAGCGTTTTTC'
downstream = 'CAGCTATGACCATGATTACGAATT'

print upstream
print comp(downstream)
Personal tools