X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fget_genome_phastcons;h=4e348b8daa309f5c82c87d7dcb99df8f4bc08a3e;hb=0253e2b8737fba111f4ec7406704dacaa4877d8d;hp=24994abfe61a385d0bff5353fea67b542477b170;hpb=66938be910a5642b50ddf28991649858b5c36580;p=biopieces.git diff --git a/bp_bin/get_genome_phastcons b/bp_bin/get_genome_phastcons index 24994ab..4e348b8 100755 --- a/bp_bin/get_genome_phastcons +++ b/bp_bin/get_genome_phastcons @@ -1,4 +1,4 @@ -#!/usr/bin/env perl -w +#!/usr/bin/env perl # Copyright (C) 2007-2009 Martin A. Hansen. @@ -26,10 +26,11 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +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 };