We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code would produce a KeyError:
""" import forgi.graph.bulge_graph as fgb import sys import os
class RedirectStdStreams(object): def init(self, stdout=None, stderr=None): self._stdout = stdout or sys.stdout self._stderr = stderr or sys.stderr def enter(self): self.old_stdout, self.old_stderr = sys.stdout, sys.stderr self.old_stdout.flush(); self.old_stderr.flush() sys.stdout, sys.stderr = self._stdout, self._stderr def exit(self, exc_type, exc_value, traceback): self._stdout.flush(); self._stderr.flush() sys.stdout = self.old_stdout sys.stderr = self.old_stderr
def create_bg_from_db(db_str): devnull = open(os.devnull, 'w') with RedirectStdStreams(stdout=devnull): bg = fgb.BulgeGraph.from_dotbracket(db_str) return bg
db_str = ".................." bg = create_bg_from_db(db_str) print(bg.to_neato_string()) """
If the dot-bracket string does not have any brackets (no stems), there will be a missing key 's0'.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following code would produce a KeyError:
"""
import forgi.graph.bulge_graph as fgb
import sys
import os
class RedirectStdStreams(object):
def init(self, stdout=None, stderr=None):
self._stdout = stdout or sys.stdout
self._stderr = stderr or sys.stderr
def enter(self):
self.old_stdout, self.old_stderr = sys.stdout, sys.stderr
self.old_stdout.flush(); self.old_stderr.flush()
sys.stdout, sys.stderr = self._stdout, self._stderr
def exit(self, exc_type, exc_value, traceback):
self._stdout.flush(); self._stderr.flush()
sys.stdout = self.old_stdout
sys.stderr = self.old_stderr
def create_bg_from_db(db_str):
devnull = open(os.devnull, 'w')
with RedirectStdStreams(stdout=devnull):
bg = fgb.BulgeGraph.from_dotbracket(db_str)
return bg
db_str = ".................."
bg = create_bg_from_db(db_str)
print(bg.to_neato_string())
"""
If the dot-bracket string does not have any brackets (no stems), there will be a missing key 's0'.
The text was updated successfully, but these errors were encountered: