]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/get_genome_phastcons
adding bzip2 support in ruby
[biopieces.git] / bp_bin / get_genome_phastcons
index 24994abfe61a385d0bff5353fea67b542477b170..4e348b8daa309f5c82c87d7dcb99df8f4bc08a3e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
 
 # Copyright (C) 2007-2009 Martin A. Hansen.
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
+use warnings;
 use strict;
 use Maasha::Biopieces;
 use Maasha::Filesys;
-use Maasha::UCSC;
+use Maasha::UCSC::Wiggle;
 
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -54,7 +55,7 @@ $out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } );
 $phastcons_file  = "$ENV{ 'BP_DATA' }/genomes/$options->{ 'genome' }/phastcons/$options->{ 'genome' }.pp";
 $phastcons_index = "$ENV{ 'BP_DATA' }/genomes/$options->{ 'genome' }/phastcons/$options->{ 'genome' }.pp.index";
 
-$index           = Maasha::UCSC::fixedstep_index_retrieve( $phastcons_index );
+$index           = Maasha::UCSC::Wiggle::fixedstep_index_retrieve( $phastcons_index );
 $fh_phastcons    = Maasha::Filesys::file_read_open( $phastcons_file );
 
 if ( defined $options->{ "chr" } and defined $options->{ "beg" } and ( defined $options->{ "end" } or defined $options->{ "len" } ) )
@@ -66,7 +67,7 @@ if ( defined $options->{ "chr" } and defined $options->{ "beg" } and ( defined $
         $options->{ "end" } = $options->{ "beg" } + $options->{ "len" } - 1;
     }
 
-    $scores = Maasha::UCSC::fixedstep_index_lookup( $index, $fh_phastcons, $options->{ "chr" }, $options->{ "beg" }, $options->{ "end" }, $options->{ "flank" } );
+    $scores = Maasha::UCSC::Wiggle::fixedstep_index_lookup( $index, $fh_phastcons, $options->{ "chr" }, $options->{ "beg" }, $options->{ "end" }, $options->{ "flank" } );
 
     $record->{ "CHR" }       = $options->{ "chr" };
     $record->{ "CHR_BEG" }   = $options->{ "beg" } - $options->{ "flank" };
@@ -82,15 +83,15 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 {
     if ( $record->{ "REC_TYPE" } eq "BED" )
     {
-        $scores = Maasha::UCSC::fixedstep_index_lookup( $index, $fh_phastcons, $record->{ "CHR" }, $record->{ "CHR_BEG" }, $record->{ "CHR_END" }, $options->{ "flank" } );
+        $scores = Maasha::UCSC::Wiggle::fixedstep_index_lookup( $index, $fh_phastcons, $record->{ "CHR" }, $record->{ "CHR_BEG" }, $record->{ "CHR_END" }, $options->{ "flank" } );
     }
     elsif ( $record->{ "REC_TYPE" } eq "PSL" )
     {
-        $scores = Maasha::UCSC::fixedstep_index_lookup( $index, $fh_phastcons, $record->{ "S_ID" }, $record->{ "S_BEG" }, $record->{ "S_END" }, $options->{ "flank" } );
+        $scores = Maasha::UCSC::Wiggle::fixedstep_index_lookup( $index, $fh_phastcons, $record->{ "S_ID" }, $record->{ "S_BEG" }, $record->{ "S_END" }, $options->{ "flank" } );
     }
     elsif ( $record->{ "REC_TYPE" } eq "BLAST" )
     {
-        $scores = Maasha::UCSC::fixedstep_index_lookup( $index, $fh_phastcons, $record->{ "S_ID" }, $record->{ "S_BEG" }, $record->{ "S_END" }, $options->{ "flank" } );
+        $scores = Maasha::UCSC::Wiggle::fixedstep_index_lookup( $index, $fh_phastcons, $record->{ "S_ID" }, $record->{ "S_BEG" }, $record->{ "S_END" }, $options->{ "flank" } );
     }
 
     $record->{ "PHASTCONS" } = join ",", @{ $scores } if @{ $scores };