Source code for rna_tools.BlastPDB

#!/usr/bin/env python
# -*- coding: utf-8 -*-

    import urllib3
    print('BlastPDB requires urllib3')

[docs] class BlastPDB: """BlastPDB - run Blast online on the PDB database. This can be used in Jupiter based RNA notebooks, e.g. Warning: getBlastPDB1 has been permanently removed as part of our announced shutdown on December 9th, 2020. Usage:: >>> p = BlastPDB('GGGUCAGGCCGGCGAAAGUCGCCACAGUUUGGGGAAAGCUGUGCAGCCUGUAACCCCCCCACGAAAGUGGG') >>> >>> p.result #doctest: +ELLIPSIS u'<HTML>\\n<TITLE>BLAST Search Results</TITLE>... :param seq: string """ def __init__(self, seq): self.seq = seq self.result = ''
[docs] def search(self): """Search online the seq.""" http = urllib3.PoolManager() response = http.request('GET', '' + self.seq + '&eCutOff=10.0&matrix=BLOSUM62&outputFormat=HTML') if response.status == 200: self.result =
# main if __name__ == '__main__': import doctest doctest.testmod()