1. Mark Howison
  2. gabi

Commits

Mark Howison  committed 323cfeb

fixed errors with report

  • Participants
  • Parent commits 1185aef
  • Branches issue-7

Comments (0)

Files changed (3)

File gabi/convergence.py

View file
     for i, y in enumerate(likelihoods):
         label = 'Chain %d' % (i+1)
         plot(y, color=palette[i%3], alpha=0.5, zorder=0, label=label)
-    gca().legend(loc='lower right', fontsize=7)
+#    gca().legend(loc='lower right', fontsize=7)
+    gca().legend(loc='lower right')
 
     subplot(222)
     title('b', size=12, weight='heavy')

File gabi/graph.py

View file
         return SeqRecord(
             Seq(seq), 'contig-%d' % i, description=str(len(seq))+desc)
 
-    def contigs(self, paths=False):
+    def contigs(self, paths_only=False):
         """
         An iterator that yields a FASTA SeqRecord for each path in the
         assembly graph.
             while paths:
                 path = paths.pop()
                 if self.A.out_degree(path[-1]) == 0:
-                    if paths:
+                    if paths_only:
                         yield path
                     else:
                         yield self.contig(path, ncontigs)
                 self.A.add_node(int(id[4:]))
             elif id.startswith("edge"):
                 self.activate(int(id[4:]))
-        for i, path in enumerate(self.contigs(paths=True)):
+        for i, path in enumerate(self.contigs(paths_only=True)):
             posteriors = []
             j = 0
             for n in path:
     def perturb_path(self, rate=1):
         e = self.edge_random()
         distance = int(gammavariate(1, rate))
-        path = list(*self.edges[e])
+        path = list(self.edges[e])
         for _ in xrange(distance):
             n = self.forward_random(path[-1])
             if n is None:
                 break
             path.insert(0, n)
         if self.A.has_edge(*self.edges[e]):
-            self.deactivate(path[0], path[1])
-            self.deactivate(path[-2], path[-1])
+            if self.A.has_edge(path[0], path[1]):
+                self.deactivate(path[0], path[1])
+            if self.A.has_edge(path[-2], path[-1]):
+                self.deactivate(path[-2], path[-1])
             if len(path) > 2:
                 self.A.remove_nodes_from(path[1:-1])
         else:

File gabi/report.py

View file
     table = [
         ('Catalog ID', args['run'].id),
         ('Timestamp', args['run'].timestamp),
-        ('Expected # Contigs', args['contigs']),
-        ('Expected Genome Size', '{:,} bp'.format(int(args['genome_size']))),
+#        ('Expected # Contigs', args['contigs']),
+#        ('Expected Genome Size', '{:,} bp'.format(int(args['genome_size']))),
         ('# Samples', '{:,.0f}'.format(args['nsamples'])),
         ('# Accepted', '{:,} ({:.1f}%)'.format(args['accept'], args['accept_per'])),
         ('Total Sample Time', '{:,.1f} sec'.format(args['time'])),