Skip to content

Instantly share code, notes, and snippets.

"""
PWMSearch
Searches through a fasta sequence for the relevant Position Weight Matrices
from the Jaspar Database.
"""
from __future__ import division
from optparse import OptionParser
def parse_color(s):
""" Parses color string in format #ABC or #AABBCC to RGB tuple. """
g = len(s)
assert(g in (4,5,7,9))
if g in (4,5):
return tuple(int(ch * 2, 16) for ch in s[1:])
else:
return tuple(int(ch1 + ch2, 16) for ch1, ch2 in \
zip(
grep "^>" t.txt | awk '{print $1}'
intext = ">pSB4T5 A 8326 Plasmid_Backbone Low copy BioBrick standard vector"
my_text = intext.split()[0][1:]
print my_text
#!/usr/bin/ruby
# save as pubmed.rb and test using 'ruby pubmed.rb 19662644'
# keyword search may return > 1 record due to retmax bug
# http://github.com/bioruby/bioruby/commit/51c3223e033b2992a7bd95da282f88164406ff92
require 'rubygems'
require 'bio'
keywords = ARGV.join(' ')
1: C
2: PHP
3: JavaScript
4: C++
5: Java
6: Ruby
7: Emacs Lisp
8: Python
9: Perl
10: C Sharp
#usage
#first_file $1 - first parameter
#last_file $2 - second parameter
for ((i=$1;i<=$2;i++))
do
head -n500 $i.csv > $i.bak
done
for file in *.*;do
tail -n+3000 $file > $file.truncated
done