BisearchEnzimHu
A colleague of mine comes to me and expose his work problem, she would like to automatize the following steps:
- open the browser and connect to the Primer design page of Bisearch.enzim.hu site of Institute of Enzymology
- filling the form:
- paste a sequence like "ATTATCACA...tagtttctgcaa"
- check 'Bisulfite'
- set 'Opt' of 'Primer length' ('Primer scoring values' section) to 30
- set 'Minimum of CpGs' ('Primer design' section) to 0
- set 'Database' to 'Homo sapiens' ('Database search and fast PCR' section)
- Push the "Search primers" button to submit the search
- Wait about 30 seconds to get the 10 results
- For each result push the 'FPCR' (FastPCR or PCR in silico), wait about 5 seconds to get the level2 result
- Analyse the 'FPCR' result, and drop the one they have more than 1 product
So I build this gem that automatize all the tasks in a single request (a Wrapper):
require 'bisearch_enzim_hu'
pd = BisearchEnzimHu::PrimerDesign.new
pd.sequence(seq, chr, start_pos).search
TODO: Write a gem description
Installation
Add this line to your application's Gemfile:
gem 'bisearch_enzim_hu'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bisearch_enzim_hu
Usage
require 'bisearch_enzim_hu'
chr = "chr17"
start_pos = 32305219
seq = "ATTATCACACTCAGGCCCTAGCTGCTAGAAGCCTCATTTGCCTAAGTTTTTGTCCCAATGTTTCCGTGAAGGCAGAGAGAGGAGCTATTTGCATGCCAGCCCAGGGCTACGTAGAAAATATGGCAGGGATCCTCTCACACTGCAGTCGAGTCAAGGCAGTCCAGGGTGGCTGctggggccagactgccccgtcaagatccagcctgcctttcactgactgtgtgattagaatgtcttgccctatccctggactttagtttctgcaa"
pd = BisearchEnzimHu::PrimerDesign.new
pd.sequence(seq, chr, start_pos).search # chr and start_pos are optional
File.open('result.yml', 'w') {|f| f.write pd.primers.to_yaml } # save the result (an hash) to a YAML file
pd.prune # remove from result the _multi products_ FPCR results
File.open('result_pruned.yml', 'w') {|f| f.write pd.primers.to_yaml }
Contributing
- Fork it ( https://github.com/iwan/bisearch_enzim_hu/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request