From rob.syme at gmail.com Mon Nov 17 22:03:58 2008 From: rob.syme at gmail.com (Rob Syme) Date: Tue, 18 Nov 2008 12:03:58 +0900 Subject: [BioRuby] Extracting identity from Bio::Blast::Report::Hit Message-ID: Hi all, I'm running a blast against a local database, but I'm only getting some of the information back: local_blast_factory = Bio::Blast.local('blastn','/home/.../sn15cds') query = "TAT...sequence...TAA" report = local_blast_factory.query(query) report.each do |hit| puts hit.identity.class end Gives: NilClass NilClass Most of the other variables (eg: query_def, definition, hsps) work fine. I don't know why the identity information can't be extracted. Are there particular arguments I need to give the blast factory so that I can extract the identity information? Thanks in advance. -r From ngoto at gen-info.osaka-u.ac.jp Tue Nov 18 03:32:41 2008 From: ngoto at gen-info.osaka-u.ac.jp (Naohisa GOTO) Date: Tue, 18 Nov 2008 17:32:41 +0900 Subject: [BioRuby] Extracting identity from Bio::Blast::Report::Hit In-Reply-To: References: Message-ID: <20081118083242.834921CBC3C5@idnmail.gen-info.osaka-u.ac.jp> Hi, On Tue, 18 Nov 2008 12:03:58 +0900 "Rob Syme" wrote: > Hi all, > I'm running a blast against a local database, but I'm only getting > some of the information back: > > local_blast_factory = Bio::Blast.local('blastn','/home/.../sn15cds') > query = "TAT...sequence...TAA" > report = local_blast_factory.query(query) > > report.each do |hit| > puts hit.identity.class > end > > Gives: > NilClass > NilClass > > Most of the other variables (eg: query_def, definition, hsps) work > fine. I don't know why the identity information can't be extracted. > Are there particular arguments I need to give the blast factory so > that I can extract the identity information? > Thanks in advance. Which BioRuby version, Ruby version, OS, and machine you are using? Perhaps because the blast report format was 8 (Tab-deliminated). In some previous version of bioruby, default format was 8. A workaround is to set "-m 7" option (XML output format) when creating factory object, for example, Bio::Blast.local('blastn','/home/.../sn15cds', '-m 7 -e 10') -- Naohisa Goto ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org From rob.syme at gmail.com Tue Nov 18 03:03:58 2008 From: rob.syme at gmail.com (Rob Syme) Date: Tue, 18 Nov 2008 12:03:58 +0900 Subject: [BioRuby] Extracting identity from Bio::Blast::Report::Hit Message-ID: Hi all, I'm running a blast against a local database, but I'm only getting some of the information back: local_blast_factory = Bio::Blast.local('blastn','/home/.../sn15cds') query = "TAT...sequence...TAA" report = local_blast_factory.query(query) report.each do |hit| puts hit.identity.class end Gives: NilClass NilClass Most of the other variables (eg: query_def, definition, hsps) work fine. I don't know why the identity information can't be extracted. Are there particular arguments I need to give the blast factory so that I can extract the identity information? Thanks in advance. -r From ngoto at gen-info.osaka-u.ac.jp Tue Nov 18 08:32:41 2008 From: ngoto at gen-info.osaka-u.ac.jp (Naohisa GOTO) Date: Tue, 18 Nov 2008 17:32:41 +0900 Subject: [BioRuby] Extracting identity from Bio::Blast::Report::Hit In-Reply-To: References: Message-ID: <20081118083242.834921CBC3C5@idnmail.gen-info.osaka-u.ac.jp> Hi, On Tue, 18 Nov 2008 12:03:58 +0900 "Rob Syme" wrote: > Hi all, > I'm running a blast against a local database, but I'm only getting > some of the information back: > > local_blast_factory = Bio::Blast.local('blastn','/home/.../sn15cds') > query = "TAT...sequence...TAA" > report = local_blast_factory.query(query) > > report.each do |hit| > puts hit.identity.class > end > > Gives: > NilClass > NilClass > > Most of the other variables (eg: query_def, definition, hsps) work > fine. I don't know why the identity information can't be extracted. > Are there particular arguments I need to give the blast factory so > that I can extract the identity information? > Thanks in advance. Which BioRuby version, Ruby version, OS, and machine you are using? Perhaps because the blast report format was 8 (Tab-deliminated). In some previous version of bioruby, default format was 8. A workaround is to set "-m 7" option (XML output format) when creating factory object, for example, Bio::Blast.local('blastn','/home/.../sn15cds', '-m 7 -e 10') -- Naohisa Goto ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org