Skip to content

Instantly share code, notes, and snippets.

View danmaclean's full-sized avatar

Dan MacLean danmaclean

View GitHub Profile
I, the reviewer, promise:
1. to not hide behind a screen of anonymity
2. to be open and honest with you (the authors) at all times
3. to be constructive in my criticism
4. within the rules given to me by the journal, to assist you in every way I ethically can to get your manuscript published,by providing criticism and praise that is valid and relevant
Dan MacLean
The Sainsbury Laboratory
## The Reviewer
I, the reviewer, promise:
1. to not hide behind a screen of anonymity
2. to be open and honest with you (the authors) at all times
3. to be constructive in my criticism
4. within the rules given to me by the journal, to assist you in every way I ethically can to get your manuscript published,by providing criticism and praise that is valid and relevant
5. It is your paper, not mine. I will not try to turn author’s paper into a paper I would have written.
@danmaclean
danmaclean / gist:7321562
Created November 5, 2013 16:18
irb session using Bio::GFF::GFF3::Record
irb(main):001:0> require 'bio'
=> true
irb(main):002:0> r = Bio::GFF::GFF3.new()
=> #<Bio::GFF::GFF3:0x007ff22b911ea8 @gff_version=nil, @records=[], @sequence_regions=[], @metadata=[], @sequences=[], @in_fasta=false>
irb(main):003:0> r = Bio::GFF::GFF3::Record.new()
=> #<Bio::GFF::GFF3::Record:0x007ff22c104728 @seqname=nil, @source=nil, @feature=nil, @score=nil, @strand=nil, @attributes=[], @start=nil, @end=nil, @frame=nil>
irb(main):004:0> r.seqname = "meh"
=> "meh"
irb(main):005:0> r
=> #<Bio::GFF::GFF3::Record:0x007ff22c104728 @seqname="meh", @source=nil, @feature=nil, @score=nil, @strand=nil, @attributes=[], @start=nil, @end=nil, @frame=nil>
@danmaclean
danmaclean / gist:6021633
Last active December 19, 2015 21:39
alternative instructions for getting app running
$ biogem --with-engine Foo foo
$ cd bioruby-foo
$ rake version:write
update gemfile to specify new version of bundler
$ bundle install
Note: a database is automatically configure for the newly created gem
$ cd ../
$ rails new Webfoo
$ add `gem 'bio-foo', :path=>'path_gem_dir' ` into Rails application Gemfile the newly created gem:
$ cd Webfoo
@danmaclean
danmaclean / gist:6019651
Last active December 19, 2015 21:19
codefest - sample rack app
require 'rubygems'
require 'json'
require 'rack'
require 'rinruby'
class HelloApp
def call(env)
req = Rack::Request.new(env)
@danmaclean
danmaclean / gist:5444903
Created April 23, 2013 16:00
Cant create experiment.
ActiveModel::MassAssignmentSecurity::Error in ExperimentsController#create
Can't mass-assign protected attributes: yaml_file
Rails.root: /Users/macleand/Downloads/gee_fu-experimental-8
Application Trace | Framework Trace | Full Trace
activemodel (3.2.13) lib/active_model/mass_assignment_security/sanitizer.rb:48:in `process_removed_attributes'
activemodel (3.2.13) lib/active_model/mass_assignment_security/sanitizer.rb:20:in `debug_protected_attribute_removal'
activemodel (3.2.13) lib/active_model/mass_assignment_security/sanitizer.rb:12:in `sanitize'
activemodel (3.2.13) lib/active_model/mass_assignment_security.rb:230:in `sanitize_for_mass_assignment'
@danmaclean
danmaclean / gist:5444205
Created April 23, 2013 14:51
rake repo:export fails - reference without ID in my DB.
rake repo:export
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/macleand/Downloads/gee_fu-experimental-8/Rakefile:7)
rake aborted!
Couldn't find Reference without an ID
/Users/macleand/.rvm/gems/ruby-1.9.3-p286@gee_fu/gems/activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:312:in `find_with_ids'
/Users/macleand/.rvm/gems/ruby-1.9.3-p286@gee_fu/gems/activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:107:in `find'
/Users/macleand/.rvm/gems/ruby-1.9.3-p286@gee_fu/gems/activerecord-3.2.13/lib/active_record/querying.rb:5:in `find'
/Users/macleand/Downloads/gee_fu-experimental-8/app/models/feature.rb:225:in `to_gff'
/Users/macle
@danmaclean
danmaclean / gist:5444177
Created April 23, 2013 14:48
fragment of foreman startup falling over at sidekiq startup
macleand$ foreman s
15:43:33 web.1 | started with pid 36997
15:43:33 worker.1 | started with pid 36998
15:43:36 worker.1 | DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/macleand/Downloads/gee_fu-experimental-8/config/environment.rb:5)
15:43:36 web.1 | DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (require
@danmaclean
danmaclean / gist:5437636
Created April 22, 2013 19:08
Poor handling of empty lines (non chomping of line!) in experiments_controller.rb lines 51 - 54
File.open( "#{@experiment.gff_file.path}" ).each do |line|
next if line =~ /^#/
break if line =~ /^##fasta/ or line =~ /^>/
record = Bio::GFF::GFF3::Record.new(line)
@danmaclean
danmaclean / gist:5437571
Created April 22, 2013 19:00
finding a reference and creating the feature in experiments_controller.rb (lines 76 - 93)
ref = Reference.find(:first, :conditions => ["name = ? AND genome_id = ?", "#{ record.seqname }", "#{@experiment.genome_id}"])
feature = Feature.new(
:group => "#{attribute}",
:feature => "#{record.feature}",
:source => "#{record.source}",
:start => "#{record.start}",
:end => "#{record.end}",
:strand => "#{record.strand}",
:phase => "#{record.frame}",