Commit dfadd1f5 authored by Thomas Schwarzl's avatar Thomas Schwarzl

added backbone '((..))' annotation

parent cb901241
......@@ -171,12 +171,13 @@ def main():
# print the summary
LOGGER.warning(f.summary(__VERSION__))
# if it is not a test run
# if it is not a test run, print a version
if not options.TEST:
f.init_stemloop()
f.calculate_sequences()
LOGGER.warning("# " + str(f.sequences_summary()))
LOGGER.warning("# example sequences: " + str(f.sequences_header(10)))
LOGGER.warning(f.sequences_summary())
f.print_sequences(OUTFILE)
# close to avoid broken pipe
......
......@@ -78,11 +78,21 @@ class StemLoopFactory:
return self.stemloop.length()
def backbone(self):
self.check_init()
return self.stemloop.str_all()
def backbone_structure(self):
s = self.backbone()
s = s.replace(Gap.shortname, ".")
s = s.replace(MatchMate.shortname, ")")
s = s.replace(Match.shortname, "(")
s = s.replace(Loop.shortname, ".")
s = s.replace(LoopOption.shortname, ".")
return s
def summary(self, version = "unkown"):
out = "# STEM LOOP GENERATOR v%s\n" % version
out += "# --------------------------------- #\n"
out += "# ========================================================== #\n"
out += "# stem size: %s\n" % self.stem_size
out += "# minimal loop size: %s\n" % self.min_loop_size
out += "# maximal loop size: %s\n" % self.max_loop_size
......@@ -90,17 +100,25 @@ class StemLoopFactory:
out += "# maximum total gap count: %s\n" % self.max_total_gap_count
out += "# minimal matches before first gap: %s\n" % self.min_matches_before_first_gap
out += "# minimal gc content [0-1]: %s\n" % self.min_gc_content
out += "# --------------------------------- #\n"
out += "# ---------------------------------------------------------- #\n"
out += "# Backbone: \n"
out += "# \n"
out += "# " + self.backbone() + "\n"
out += "# " + self.backbone_structure() + "\n"
out += "# \n"
out += "# M Match, N Mate, L Loop, O Loop (optional), g Gap\n"
out += "# \n"
out += "# minimal sequence length: %s\n" % self.min_length()
out += "# maximal sequence length: %s\n" % (self.min_length() + min(self.max_gap_size, self.max_total_gap_count))
out += "# total length: %s\n" % self.length()
out += "# --------------------------------- #\n"
out += "# " + self.backbone() + "\n"
out += "# --------------------------------- #"
out += "# ---------------------------------------------------------- #"
return(out)
def sequences_summary(self):
out = "number of unique sequences: %s" % self.sequences_count()
out = "# number of unique sequences: %s\n" % self.sequences_count()
out += "# example sequences: %s\n" % self.sequences_header(10)
out += "# ========================================================== #"
return(out)
def check_sequences_init(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment