[Bio] / FigKernelScripts / collect_related_sequences.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/collect_related_sequences.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : golsen 1.1 ########################################################################
2 :     # -*- perl -*-
3 :     #
4 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
5 :     # for Interpretations of Genomes. All Rights Reserved.
6 :     #
7 :     # This file is part of the SEED Toolkit.
8 :     #
9 :     # The SEED Toolkit is free software. You can redistribute
10 :     # it and/or modify it under the terms of the SEED Toolkit
11 :     # Public License.
12 :     #
13 :     # You should have received a copy of the SEED Toolkit Public License
14 :     # along with this program; if not write to the University of Chicago
15 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
16 :     # Genomes at veronika@thefig.info or download a copy from
17 :     # http://www.theseed.org/LICENSE.TXT.
18 :     #
19 :    
20 :     # collect_related_sequences [options] dbfile seqfile
21 :    
22 :     # use Data::Dumper;
23 :     use strict;
24 :     use gjoseqlib;
25 :     use collect_related_sequences;
26 :    
27 :     my $usage =<<'End_of_Usage';
28 :    
29 :     Usage: collect_related_sequences [options] dbfile seqfile
30 :    
31 :     Options:
32 :    
33 :     -c min_coverage # D=0.80
34 :     -d tmp_dir # name of temporary directory
35 :     -e max_e_value # D=0.01
36 :     -i min_identity # D=0.25
37 :     -t tmp # place for temporary directory
38 :     -x extra_ends # extra length at ends
39 :    
40 :     End_of_Usage
41 :    
42 :     my $min_coverage = 0.80;
43 :     my $tmp_dir;
44 :     my $max_e_value = 0.01;
45 :     my $min_identity = 0.25;
46 :     my $tmp;
47 :     my $extra_ends = 10;
48 :    
49 :     while ( $ARGV[0] =~ /^-/ )
50 :     {
51 :     $_ = shift;
52 :     if ( s/^-c// ) { $min_coverage = $_ || shift }
53 :     elsif ( s/^-d// ) { $tmp_dir = $_ || shift }
54 :     elsif ( s/^-e// ) { $max_e_value = $_ || shift }
55 :     elsif ( s/^-i// ) { $min_identity = $_ || shift }
56 :     elsif ( s/^-t// ) { $tmp = $_ || shift }
57 :     elsif ( s/^-x// ) { $extra_ends = $_ || shift }
58 :     else
59 :     {
60 :     usage( "Bad command flag '$_'\n" );
61 :     }
62 :     }
63 :    
64 :     @ARGV == 2 or usage( "collect_related_sequences requires 2 parameters" );
65 :    
66 :     my ( $dbfile, $seqfile ) = @ARGV;
67 :    
68 :     my @seq = read_fasta( $seqfile );
69 :     @seq or usage( "Failed to read sequences from '$seqfile'" );
70 :    
71 :     my $options =
72 :     { min_coverage => $min_coverage,
73 :     max_e_value => $max_e_value,
74 :     min_identity => $min_identity,
75 :     extra_ends => $extra_ends
76 :     };
77 :     $options->{ tmp } = $tmp if $tmp;
78 :     $options->{ tmp_dir } = $tmp_dir if $tmp_dir;
79 :    
80 :     my $other = collect_related_sequences::collect_related_sequences( $dbfile, \@seq, $options );
81 :    
82 :     print_alignment_as_fasta( $other );
83 :     exit;
84 :    
85 :    
86 :     sub usage
87 :     {
88 :     print STDERR join( "\n", @_, $usage );
89 :     exit;
90 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3