]> git.donarmstrong.com Git - biopieces.git/commitdiff
added N block switch to blat_seq
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 15 Mar 2010 19:33:02 +0000 (19:33 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 15 Mar 2010 19:33:02 +0000 (19:33 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@905 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/blast_seq
bp_bin/blat_seq
bp_bin/calc_bit_scores
bp_bin/create_blast_index
bp_bin/create_vmatch_index
bp_bin/fold_seq
bp_bin/patscan_seq
bp_bin/translate_seq

index be2b8163cd99bdc6e2f9f7f8da14d4f4bda37a0f..3c4df0d585b12e9f3f6ea371618231804979a7fc 100755 (executable)
@@ -175,9 +175,9 @@ sub guess_database_type
 
     # Returns string;
     if ( -f $options->{ 'database' } . ".phr" ) {
-        return "protein";
+        return "PROTEIN";
     } else {
-        return "nucleotide";
+        return "NUCLEOTIDE";
     }
 }
 
@@ -197,13 +197,13 @@ sub guess_program
 
     my ( $program );
 
-    if ( $q_type      ne "protein" and $s_type ne "protein" ) {
+    if ( $q_type      ne "PROTEIN" and $s_type ne "PROTEIN" ) {
         $program = "blastn";
-    } elsif ( $q_type eq "protein" and $s_type eq "protein" ) {
+    } elsif ( $q_type eq "PROTEIN" and $s_type eq "PROTEIN" ) {
         $program = "blastp";
-    } elsif ( $q_type ne "protein" and $s_type eq "protein" ) {
+    } elsif ( $q_type ne "PROTEIN" and $s_type eq "PROTEIN" ) {
         $program = "blastx";
-    } elsif ( $q_type eq "protein" and $s_type ne "protein" ) {
+    } elsif ( $q_type eq "PROTEIN" and $s_type ne "PROTEIN" ) {
         $program = "tblastn";
     }
 
index 00693022f4438c69c69a72a7801a4227fe9dfc06..1f327fab0997097901c1d060a46de4edc69062ff 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 
-# Copyright (C) 2007-2009 Martin A. Hansen.
+# Copyright (C) 2007-2010 Martin A. Hansen.
 
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -43,16 +43,17 @@ my ( $options, $in, $out, $record, $blat_args, $subject_file, $query_file, $fh_i
 
 $options = Maasha::Biopieces::parse_options(
     [
-        { long => 'database',     short => 'd', type => 'file',   mandatory => 'no', default => undef,  allowed => undef, disallowed => undef },
-        { long => 'genome',       short => 'g', type => 'genome', mandatory => 'no', default => undef,  allowed => undef, disallowed => undef },
-        { long => 'fast_map',     short => 'f', type => 'flag',   mandatory => 'no', default => undef,  allowed => undef, disallowed => undef },
-        { long => 'occ',          short => 'c', type => 'flag',   mandatory => 'no', default => undef,  allowed => undef, disallowed => undef },
-        { long => 'intron_max',   short => 'i', type => 'uint',   mandatory => 'no', default => 750000, allowed => undef, disallowed => undef },
-        { long => 'tile_size',    short => 't', type => 'uint',   mandatory => 'no', default => 11,     allowed => undef, disallowed => 0 },
-        { long => 'step_size',    short => 's', type => 'uint',   mandatory => 'no', default => 11,     allowed => undef, disallowed => 0 },
-        { long => 'min_identity', short => 'm', type => 'uint',   mandatory => 'no', default => 90,     allowed => undef, disallowed => 0 },
-        { long => 'min_score',    short => 'M', type => 'uint',   mandatory => 'no', default => 0,      allowed => undef, disallowed => undef },
-        { long => 'one_off',      short => 'o', type => 'uint',   mandatory => 'no', default => 0,      allowed => undef, disallowed => undef },
+        { long => 'database',       short => 'd', type => 'file',   mandatory => 'no', default => undef,  allowed => undef, disallowed => undef },
+        { long => 'genome',         short => 'g', type => 'genome', mandatory => 'no', default => undef,  allowed => undef, disallowed => undef },
+        { long => 'fast_map',       short => 'f', type => 'flag',   mandatory => 'no', default => undef,  allowed => undef, disallowed => undef },
+        { long => 'occ',            short => 'c', type => 'flag',   mandatory => 'no', default => undef,  allowed => undef, disallowed => undef },
+        { long => 'intron_max',     short => 'i', type => 'uint',   mandatory => 'no', default => 750000, allowed => undef, disallowed => undef },
+        { long => 'tile_size',      short => 't', type => 'uint',   mandatory => 'no', default => 11,     allowed => undef, disallowed => 0 },
+        { long => 'step_size',      short => 's', type => 'uint',   mandatory => 'no', default => 11,     allowed => undef, disallowed => 0 },
+        { long => 'min_identity',   short => 'm', type => 'uint',   mandatory => 'no', default => 90,     allowed => undef, disallowed => 0 },
+        { long => 'min_score',      short => 'M', type => 'uint',   mandatory => 'no', default => 0,      allowed => undef, disallowed => undef },
+        { long => 'one_off',        short => 'o', type => 'uint',   mandatory => 'no', default => 0,      allowed => undef, disallowed => undef },
+        { long => 'allow_N_blocks', short => 'N', type => 'flag',   mandatory => 'no', default => undef,  allowed => undef, disallowed => undef },
     ]   
 );
 
@@ -68,20 +69,15 @@ if ( $options->{ 'database' } ) {
     $subject_file = "$ENV{ 'BP_DATA' }/genomes/$options->{ 'genome' }/fasta/$options->{ 'genome' }.fna";
 }
 
-if ( $options->{ 'fast_map' } )
-{
-    $blat_args .= " -fastMap";
-}
-else
-{
-    $blat_args .= " -tileSize=$options->{ 'tile_size' }";
-    $blat_args .= " -oneOff=$options->{ 'one_off' }";
-    $blat_args .= " -minIdentity=$options->{ 'min_identity' }";
-    $blat_args .= " -minScore=$options->{ 'min_score' }";
-    $blat_args .= " -stepSize=$options->{ 'step_size' }";
-    $blat_args .= " -maxIntron=$options->{ 'intron_max' }";
-    # $blat_args .= " -ooc=" . Maasha::Config::genome_blat_ooc( $options->{ "genome" }, 11 ) if $options->{ 'ooc' };
-}
+$blat_args .= " -tileSize=$options->{ 'tile_size' }";
+$blat_args .= " -oneOff=$options->{ 'one_off' }";
+$blat_args .= " -minIdentity=$options->{ 'min_identity' }";
+$blat_args .= " -minScore=$options->{ 'min_score' }";
+$blat_args .= " -stepSize=$options->{ 'step_size' }";
+$blat_args .= " -maxIntron=$options->{ 'intron_max' }";
+$blat_args .= " -fastMap"        if $options->{ 'fast_map' }; 
+$blat_args .= " -extendThroughN" if $options->{ 'allow_N_blocks' }; 
+# $blat_args .= " -ooc=" . Maasha::Config::genome_blat_ooc( $options->{ "genome" }, 11 ) if $options->{ 'ooc' };
 
 $tmp_dir = Maasha::Biopieces::get_tmpdir();
 $query_file = "$tmp_dir/blat.seq";
index 4b930c30c1c8e911431e11cc749e3c7d24e04a61..6da3afbddde48793a9ccd3ef43d5130fbb25f58b 100755 (executable)
@@ -69,7 +69,7 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 
 undef $record;
 
-if ( $type eq "protein" ) {
+if ( $type eq "PROTEIN" ) {
     $bit_max = 4;
 } else {
     $bit_max = 2;
index 61f75ffaaad781bea37083b7e220d93b58536b2c..1d2b1953aae144309fe3da4c68f44f3a2d686c45 100755 (executable)
@@ -69,7 +69,7 @@ close $fh_tmp;
 
 $arg = "-t $options->{ 'index_name' }";
 
-if ( $seq_type =~ /protein/i ) {
+if ( $seq_type eq "PROTEIN" ) {
     $arg .= " -p T";
 } else {
     $arg .= " -p F";
index bf467b21cdb27170755ddc852816c8f941d87039..b5d4d0e97d213a1ca2544ed378c7c1b1cc9fcd07 100755 (executable)
@@ -69,9 +69,9 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 close $fh_tmp;
 
 if ( $options->{ 'verbose' } ) {
-    Maasha::Common::run( "mkvtree", "-db $file_tmp -$type -pl -allout -indexname $options->{ 'index_name' }" );
+    Maasha::Common::run( "mkvtree", "-db $file_tmp -" . ( lc $type ) . " -pl -allout -indexname $options->{ 'index_name' }" );
 } else {
-    Maasha::Common::run( "mkvtree", "-db $file_tmp -$type -pl -allout -indexname $options->{ 'index_name' } > /dev/null 2>&1" );
+    Maasha::Common::run( "mkvtree", "-db $file_tmp -" . ( lc $type ) . " -pl -allout -indexname $options->{ 'index_name' } > /dev/null 2>&1" );
 }
 
 unlink $file_tmp;
index 1207cfe9bc46a84c476f64003bdd203f0f116016..4543920c2f749484ac3dddcd7311a677075780d4 100755 (executable)
@@ -45,11 +45,9 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 {
     if ( $record->{ "SEQ" } )
     {
-        if ( not $type ) {
-            $type = Maasha::Seq::seq_guess_type( $record->{ "SEQ" } );
-        }
+        $type = Maasha::Seq::seq_guess_type( $record->{ "SEQ" } ) if not $type;
         
-        if ( $type ne "protein" )
+        if ( $type ne "PROTEIN" )
         {
             ( $struct, $index ) = Maasha::Seq::fold_struct_rnafold( $record->{ "SEQ" } );
             $record->{ "SEC_STRUCT" }  = $struct;
index 28cb5859b4162953bed7b8eeb387f2efecf29e48..ca4fc983f47629bb78e960ea21f15f335bb68f5f 100755 (executable)
@@ -98,7 +98,7 @@ else
 
     close $fh_out;
 
-    $arg .= " -p" if $type eq "protein";
+    $arg .= " -p" if $type eq "PROTEIN";
 }
 
 foreach $pattern ( @{ $patterns } )
index d62188af432c7e9a16ec152e58707901198dda82..3af052136459dd53a6d5f01b994dc324fe614752 100755 (executable)
@@ -50,7 +50,7 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 {
     if ( $record->{ "SEQ" } )
     {
-        if ( Maasha::Seq::seq_guess_type( $record->{ "SEQ" } ) =~ /DNA/i )
+        if ( Maasha::Seq::seq_guess_type( $record->{ "SEQ" } ) eq "DNA" )
         {
             foreach $frame ( @{ $options->{ "frames" } } )
             {