User:ShawnDouglas/scripts

From OpenWetWare

< User:ShawnDouglas(Difference between revisions)
Jump to: navigation, search
m
Current revision (14:56, 12 February 2012) (view source)
(clean up some old python code)
 
(12 intermediate revisions not shown.)
Line 7: Line 7:
*[[/toehold.py]] - given input sequence generate N-mers orthogonal (to seq and its complement) to be used as toeholds
*[[/toehold.py]] - given input sequence generate N-mers orthogonal (to seq and its complement) to be used as toeholds
*[[/hexgui.py]] - Tk GUI for honeycomb lattice program
*[[/hexgui.py]] - Tk GUI for honeycomb lattice program
 +
 +
'''DNA sequence manipulation'''
 +
 +
*reverse complement & remove whitespace
 +
 +
<syntaxhighlight lang="python">
 +
complement = string.maketrans('ACGTacgt','TGCAtgca')
 +
def comp(s):
 +
  return s.translate(complement)[::-1]
 +
 +
def nowhite(s):
 +
  return ''.join([c for c in s if c in string.letters])
 +
 +
</syntaxhighlight>
 +
 +
 +
*replace mac return character ('\r') with unix return ('\n')
 +
<pre>
 +
cat foo | tr '\r' '\n' > bar
 +
mv bar foo
 +
</pre>

Current revision

PCR

  • /make-pcr-oligos.py - given target sequence, generate oligos that can be used for PCR assembly of that sequence
  • /random-sequence.py - generate random DNA sequence of specified length
  • /primer.py - given upstream and downstream sense sequence of region to amplify, print out correct primers

Nanostructures

  • /toehold.py - given input sequence generate N-mers orthogonal (to seq and its complement) to be used as toeholds
  • /hexgui.py - Tk GUI for honeycomb lattice program

DNA sequence manipulation

  • reverse complement & remove whitespace
complement = string.maketrans('ACGTacgt','TGCAtgca')
def comp(s):
  return s.translate(complement)[::-1]
 
def nowhite(s):
  return ''.join([c for c in s if c in string.letters])


  • replace mac return character ('\r') with unix return ('\n')
cat foo | tr '\r' '\n' > bar
mv bar foo
Personal tools