This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| PWMSearch | |
| Searches through a fasta sequence for the relevant Position Weight Matrices | |
| from the Jaspar Database. | |
| """ | |
| from __future__ import division | |
| from optparse import OptionParser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| grep "^>" t.txt | awk '{print $1}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| intext = ">pSB4T5 A 8326 Plasmid_Backbone Low copy BioBrick standard vector" | |
| my_text = intext.split()[0][1:] | |
| print my_text | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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(' ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1: C | |
| 2: PHP | |
| 3: JavaScript | |
| 4: C++ | |
| 5: Java | |
| 6: Ruby | |
| 7: Emacs Lisp | |
| 8: Python | |
| 9: Perl | |
| 10: C Sharp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for file in *.*;do | |
| tail -n+3000 $file > $file.truncated | |
| done |
NewerOlder