CollateX: no ranks if nonlinear
Tara L Andrews [Thu, 6 Oct 2011 14:10:54 +0000 (16:10 +0200)]
Analysis: fix bug in conflict detection

Tradition.bbprojectd/project.bbprojectdata
TreeOfTexts/root/js/interaction.js
lib/Text/Tradition/Analysis.pm
lib/Text/Tradition/Parser/CollateX.pm
make_tradition.pl

index 6dacb92..777e914 100644 (file)
@@ -88,9 +88,9 @@
                                AAAAAAGkAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAA
                                AAAAAADKPI0jSCsAAAAILogRbWFrZV90cmFkaXRpb24u
                                cGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-                               AAAAAAAAAAAAAAAAAAAAADA/68quyjNURVhUAAAAAP//
+                               AAAAAAAAAAAAAAAAAAAAADZNAcqzM/JURVhUAAAAAP//
                                //8AAAkgAAAAAAAAAAAAAAAAAAAADHN0ZW1tYXRvbG9n
-                               eQAQAAgAAMo8cQMAAAARAAgAAMqurhMAAAABABAACC6I
+                               eQAQAAgAAMo8cQMAAAARAAgAAMqzF9IAAAABABAACC6I
                                AAckkwAFBAYAAL8xAAIAQk1hY2ludG9zaCBIRDpVc2Vy
                                czoAdGxhOgBQcm9qZWN0czoAc3RlbW1hdG9sb2d5OgBt
                                YWtlX3RyYWRpdGlvbi5wbAAOACQAEQBtAGEAawBlAF8A
index 919fd51..15f64e0 100644 (file)
@@ -32,7 +32,7 @@ function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) {
   jQuery.each( arr_node_ids, function(index,value) {
     $('.node').children('title').filter( function(index) {
       return $(this).text() == value;
-    }).siblings('ellipse, polygon').each( function( index ) {
+    }).siblings('ellipse').each( function( index ) {
         $(this).attr( {stroke:'black', fill:colors[column_index-1]} );
       });
   });
index b14f597..f4605ed 100644 (file)
@@ -102,6 +102,7 @@ sub run_analysis {
                # For all the groups with more than one member, collect the list of all
                # contiguous vertices needed to connect them.
                # TODO: deal with a.c. reading logic
+               $DB::single = 1 if $rank == 25;
                my $variant_row = analyze_variant_location( $group_readings, $groups, 
                    $stemma->apsp, $lacunose );
                $variant_row->{'id'} = $rank;
@@ -150,10 +151,14 @@ sub analyze_variant_location {
     my %missing;
     map { $missing{$_} = 1 } @$lacunose;
     my $variant_row = { 'readings' => [] };
+    # Mark each ms as in its own group, first.
+    foreach my $g ( @$groups ) {
+        my $gst = wit_stringify( $g );
+        map { $contig{$_} = $gst } @$g;
+    }
     foreach my $g ( sort { scalar @$b <=> scalar @$a } @$groups ) {
         my @members = @$g;
         my $gst = wit_stringify( $g ); # $gst is now the name of this group.
-        map { $contig{$_} = $gst } @members; # All members are in this group.
         while( @members ) {
             # Gather the list of vertices that are needed to join all members.
             my $curr = pop @members;
index 474d3ff..62123fe 100644 (file)
@@ -167,7 +167,7 @@ sub parse {
     populate_witness_path( $tradition );
 
     # Rank the readings.
-    $collation->calculate_ranks();
+    $collation->calculate_ranks() if $collation->linear;
 }
     
 =head1 BUGS / TODO
index a7a5030..28140e8 100755 (executable)
@@ -12,7 +12,7 @@ binmode STDOUT, ":utf8";
 eval { no warnings; binmode $DB::OUT, ":utf8"; };
 
 my( $informat, $inbase, $outformat, $help, $linear, $name, $HACK ) 
-    = ( '', '', '', '', 1, 0 );
+    = ( '', '', '', '', 0, 0 );
 
 GetOptions( 'i|in=s'    => \$informat,
             'b|base=s'  => \$inbase,