Comments (5)
This sounds like a name space collision with bioruby and not a bug in blastxmlparser. Can you provide a code example? Thanks!
from blastxmlparser.
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:in
require'
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:in
require'
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:in
require'
from get_my_seqs.rb:3:in `
Thanks!!
from blastxmlparser.
I'll check what happened on the BioRuby side.
from blastxmlparser.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blastxmlparser.