when using biopython for hmmer results, it shows no hits attribute and I don't why
0
0
Entering edit mode
3.6 years ago
lwu8 • 0

Hi, could someone help me ? I am trying to parse hmmer results from a file with the code in biopython, however when I run it, it shows no "hits"attribute in the line with 'hits = qresult.hits' :

import Bio from Bio import SearchIO from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord with open ("file",'rU') as handle: # read used for search output files with a single query for qresult in SearchIO.read(handle, 'hmmer3-text'): query_id = qresult.id # seqID from fasta hits = qresult.hits num_hits = len(hits) # how many items (hits) by using len() if num_hits > 0: # if there are more than 0 hits in this query then extract the info for i in range(0, num_hits): hmm_name = hits[i].id # hit name hmm_description = hits[i].description # hit decription current_evalue = hits[i].evalue # evalue of hit handle.close() # close file

alignment • 741 views
ADD COMMENT

Login before adding your answer.

Traffic: 2451 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6