Sha256: ffb6bf9ef118956fd500d2833d9aa5512b5e326636a718216162b0b91a7a6c11

Contents?: true

Size: 687 Bytes

Versions: 15

Compression:

Stored size: 687 Bytes

Contents

module SequenceServer
  # Sample hit link customization file.
  module Links
    SI_UNIPROT_IDPAT = /SI2.2.0.(\d*)/
    SI_UNIPROT_IDMAP = YAML.load_file(File.expand_path('si_uniprot_idmap.yml',
                                                       File.dirname(__FILE__)))

    def uniprot
      return unless accession.match(SI_UNIPROT_IDPAT)
      uniprot_id  = SI_UNIPROT_IDMAP["SINV_#{Regexp.last_match[1]}"]
      return unless uniprot_id

      uniprot_id = encode uniprot_id
      url = "http://www.uniprot.org/uniprot/#{uniprot_id}"
      {
        :order => 2,
        :title => 'UniProt',
        :url   => url,
        :icon  => 'fa-external-link'
      }
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sequenceserver-1.0.14 spec/database/sample/links.rb
sequenceserver-1.0.13 spec/database/sample/links.rb
sequenceserver-1.0.12 spec/database/sample/links.rb
sequenceserver-1.0.11 spec/database/sample/links.rb
sequenceserver-1.0.10 spec/database/sample/links.rb
sequenceserver-1.0.9 spec/database/sample/links.rb
sequenceserver-1.0.8 spec/database/sample/links.rb
sequenceserver-1.0.7 spec/database/sample/links.rb
sequenceserver-1.0.6 spec/database/sample/links.rb
sequenceserver-1.0.5 spec/database/sample/links.rb
sequenceserver-1.0.4 spec/database/sample/links.rb
sequenceserver-1.0.3 spec/database/sample/links.rb
sequenceserver-1.0.2 spec/database/sample/links.rb
sequenceserver-1.0.1 spec/database/sample/links.rb
sequenceserver-1.0.0 spec/database/sample/links.rb