my $count = 0; 44 my $priorScaffold; 45 my $priorChr; 46 my @finalArray; 47 open (IN, '<', $fileName) or die "Cannot open $fileName\n"; 48 LINE: while (my $line = ){ 49 chomp $line; 50 if ($line =~ m/^>\w+/){ 51 next LINE; 52 } 53 my @dataLine = split /\t/, $line; 54 my $chr = $dataLine[5]; 55 next LINE if ($chr !~ /^\d{1,2}?$/); 56 my $scaffold = $dataLine[0]; 57 if ($count != 0){ 58 if ($scaffold ne $priorScaffold){ #If we found a new scaffoldd 59 push @{$global{$priorChr}{$priorScaffold}}, @finalArray; #write to hash @finalArray using prior accumulated data for last scaffold 60 $count = 0 ; 61 $allScaffolds{$priorScaffold}=0; #Save priorScaffold in allScaffolds Hash for list use later- value is meaningless 62 @finalArray = (); 63 } 64 elsif ($chr != $priorChr){ #If we just switched Chromosomes but are still on the same scaffold 65 push @{$global{$priorChr}{$priorScaffold}}, @finalArray; #write to global the @finalArray accumulated to the point it switches chromosomes 66 $count = 0; 67 @finalArray = (); 68 } 69 } 70 push @{$finalArray[$count]}, @dataLine; 71 $priorScaffold = $scaffold; 72 $priorChr = $chr; 73 $count ++; 74 print "$line\n"; 75 print join ("\t", @dataLine)."\n"; 76 } #### DB<1> b 54 $dataLine[2] = uninitialized DB<2> c This program requires 4 command line arguments Input File from as MizBee output from SyntenyFinder as first Input File listing all scaffolds and total lengths from the query genome Output FILE name to be used as basis for creation of MizBee input file and tmp file you can deleteA NUMERIC integer value specifying the cut off value for scaffold EXCLUSION from visualization This value is used to eliminate scaffolds with less then VAL hits on any given chromosome THIS ONLY ELIMINATES THE SCAFFOLD VISUALIZATION FOR THAT CHROMOSOME main::syntenyLoad(MizBEE_parseOUT.pl:54): 54: my $chr = $dataLine[5]; DB<2> x $line 0 "GL429767\cI42604\cI226589\cI0\cI1\cI7\cI100487615\cI100493753\cI550\cI-1\cI0.8748\cIENSMLUG00000029214\cIENSG00000087085\cI" DB<3> x split /\t/, $line 0 'GL429767' 1 42604 2 226589 3 0 4 1 5 7 6 100487615 7 100493753 8 550 9 '-1' 10 0.8748 11 'ENSMLUG00000029214' 12 'ENSG00000087085' DB<4> x @dataLine 0 'GL429767' 1 42604 2 'uninitialized' 3 0 4 1 5 7 6 100487615 7 100493753 8 550 9 '-1' 10 0.8748 11 'ENSMLUG00000029214' 12 'ENSG00000087085' DB<5>