LoginSignup
1
2

More than 3 years have passed since last update.

biopythonでHMMERの結果をparseする

Last updated at Posted at 2019-08-05

まずはHMMERで検索

hmmscan -o out_hmmscan.txt --cpu 4 -E 1e-10 prof.hmm some_proteins.fa

検索結果をparse

parse_hmmscan.py
#!/usr/bin/env python3

from Bio import SearchIO

qres=SearchIO.parse('out_hmmscan.txt', 'hmmer3-text') 

for q in qres:
    if len(q) >= 1:
        for hit in q:
            print('*** HIT ***')
            print(q.id)
            print(hit.id)
            print(hit.evalue)
            print()
            for hsp in hit:
                print(hsp.query.seq)
                print(str(hsp.aln_annotation['PP']))
                print(hsp.hit.seq)
                print()
            print()

環境

Ubuntu 18.04
hmmer 3.1b2
Python 3.7.2
biopython 1.72

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2