]> git.donarmstrong.com Git - biopieces.git/commitdiff
debugging soap_seq
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 21 Jul 2008 05:46:27 +0000 (05:46 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 21 Jul 2008 05:46:27 +0000 (05:46 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@181 74ccb610-7750-0410-82ae-013aeee3265d

code_perl/Maasha/Biopieces.pm
code_perl/Maasha/Match.pm

index ce93a0efd723ca16765c017f49842474b651bd34..4e30438ce13ce08e8a9d54a52781aa6cd8f3f34c 100644 (file)
@@ -3616,37 +3616,15 @@ sub script_soap_seq
     {
         chomp $line;
 
+        @fields = split /\t/, $line;
 
-print Dumper( $line );
-
-        next if $line =~ /^#/;
-
-        @fields = split /\s+/, $line;
-
-        $record->{ "REC_TYPE" }   = "BLAST";
+        $record->{ "REC_TYPE" }   = "SOAP";
         $record->{ "Q_ID" }       = $fields[ 0 ];
-        $record->{ "S_ID" }       = $fields[ 1 ];
-        $record->{ "IDENT" }      = $fields[ 2 ];
-        $record->{ "ALIGN_LEN" }  = $fields[ 3 ];
-        $record->{ "MISMATCHES" } = $fields[ 4 ];
-        $record->{ "GAPS" }       = $fields[ 5 ];
-        $record->{ "Q_BEG" }      = $fields[ 6 ] - 1; # BLAST is 1-based
-        $record->{ "Q_END" }      = $fields[ 7 ] - 1; # BLAST is 1-based
-        $record->{ "S_BEG" }      = $fields[ 8 ] - 1; # BLAST is 1-based
-        $record->{ "S_END" }      = $fields[ 9 ] - 1; # BLAST is 1-based
-        $record->{ "E_VAL" }      = $fields[ 10 ];
-        $record->{ "BIT_SCORE" }  = $fields[ 11 ];
-
-        if ( $record->{ "S_BEG" } > $record->{ "S_END" } )
-        {
-            $record->{ "STRAND" } = '-';
-
-            ( $record->{ "S_BEG" }, $record->{ "S_END" } ) = ( $record->{ "S_END" }, $record->{ "S_BEG" } );
-        }
-        else
-        {
-            $record->{ "STRAND" } = '+';
-        }
+        $record->{ "SCORE" }      = $fields[ 3 ];
+        $record->{ "STRAND" }     = $fields[ 6 ];
+        $record->{ "S_ID" }       = $fields[ 7 ];
+        $record->{ "S_BEG" }      = $fields[ 8 ] - 1; # soap is one based
+        $record->{ "S_END" }      = $fields[ 8 ] + $fields[ 5 ] - 2;
 
         put_record( $record, $out );
     }
@@ -4052,6 +4030,17 @@ sub script_write_bed
 
             Maasha::UCSC::bed_put_entry( $new_record, $fh, 6 );
         }
+        elsif ( $record->{ "REC_TYPE" } eq "SOAP" and $record->{ "S_ID" } =~ /^chr/i )    # ---- Hits from Vmatch ----
+        {
+            $new_record->{ "CHR" }     = $record->{ "S_ID" };
+            $new_record->{ "CHR_BEG" } = $record->{ "S_BEG" };
+            $new_record->{ "CHR_END" } = $record->{ "S_END" };
+            $new_record->{ "Q_ID" }    = $record->{ "Q_ID" };
+            $new_record->{ "SCORE" }   = $record->{ "SCORE" } || 999;
+            $new_record->{ "STRAND" }  = $record->{ "STRAND" };
+
+            Maasha::UCSC::bed_put_entry( $new_record, $fh, 6 );
+        }
         elsif ( $record->{ "CHR" } and defined $record->{ "CHR_BEG" } and $record->{ "CHR_END" } )  # ---- Generic data from tables ----
         {
             Maasha::UCSC::bed_put_entry( $record, $fh );
index f5a919e9a14f78676c5ec097357692d9dad6754a..5b0bd0907a6cc6f49d089b0986fb75659cb481a8 100644 (file)
@@ -327,7 +327,7 @@ sub vmatch_index
 
     Maasha::Common::dir_create_if_not_exists( $dst_dir );
 
-    if ( Maasha::Common::file_size( $file ) < 250_000_000 )
+    if ( Maasha::Common::file_size( $file ) < 200_000_000 )
     {
         &Maasha::Common::run( "mkvtree", "-db $src_dir/$file -dna -pl -allout -indexname $dst_dir/$file > /dev/null 3>&1" );
     }