Giter Club home page Giter Club logo

Comments (5)

hunzinker avatar hunzinker commented on September 17, 2024

This sounds like a name space collision with bioruby and not a bug in blastxmlparser. Can you provide a code example? Thanks!

from blastxmlparser.

slhogle avatar slhogle commented on September 17, 2024

sample code:

#!/usr/bin/env ruby
require 'bio'
require 'bio-blastxmlparser'

all_hits = Array.new
blastfile = 'moore_metal_abc.blastxml'
  n = Bio::Blast::XmlIterator.new(blastfile).to_enum
  n.each do | iter |
    iter.each do | hit |
      all_hits << hit.hit_def
    end
  end

unique_hits = all_hits.uniq
print "Found #{unique_hits.count} unique hits from the #{all_hits.count} total hits\n"

db_fasta = '/home/shane/Documents/sequence_data/CAM_PROJ_MarineMicrobes/CAM_PROJ_MarineMicrobes_peptides_shortdef.fasta'
File.open('moore_abc_uniq_seqs.fasta', 'w') do |f|
  Bio::FlatFile.auto(db_fasta).each do | item |
    unique_hits.each do |seq|
        if seq == item.definition
          new_seq = Bio::FastaFormat.new('> '+item.definition+"\n"+item.data)
          f.puts new_seq
        end
      end
    end
  end

error received:

/usr/lib/ruby/gems/1.9.1/gems/bio-blastxmlparser-1.1.0/lib/bio/db/blast/xmliterator.rb:4:in <module:Bio>': Blast is not a module (TypeError) from /usr/lib/ruby/gems/1.9.1/gems/bio-blastxmlparser-1.1.0/lib/bio/db/blast/xmliterator.rb:3:in<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /usr/lib/ruby/gems/1.9.1/gems/bio-blastxmlparser-1.1.0/lib/bio-blastxmlparser.rb:19:in <top (required)>' from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:60:inrequire'
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:60:in rescue in require' from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:35:inrequire'
from get_my_seqs.rb:3:in `

'

Thanks!!

from blastxmlparser.

pjotrp avatar pjotrp commented on September 17, 2024

I'll check what happened on the BioRuby side.

from blastxmlparser.

pjotrp avatar pjotrp commented on September 17, 2024

BioRuby has

module Bio
class Blast

The BlastXMLParser has

module Bio
module Blast

indeed, this is wrong. I should have named the surrounding Bio module something else. No reason to share that name space.

from blastxmlparser.

pjotrp avatar pjotrp commented on September 17, 2024

Version 1.1.1 has a fix in the form of changing Bio::Blast to Bio::BlastXMLParser name space.

from blastxmlparser.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.