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

View of /FigKernelScripts/svr_insert_seqs_into_alignment.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Mon Oct 4 15:19:42 2010 UTC (9 years, 1 month ago) by fangfang
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, rast_rel_2014_0912, myrast_rel40, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, rast_rel_2014_0729, mgrast_dev_02212011, rast_rel_2010_1206, mgrast_release_3_0, mgrast_dev_03252011, rast_rel_2011_0119, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, myrast_33, rast_rel_2011_0928, mgrast_dev_04052011, mgrast_dev_02222011, mgrast_dev_10262011, HEAD
Changes since 1.1: +2 -2 lines
take advantage of gjoseqlib's flexible API to implicitly interact with STDIN/STDOUT

#!/usr/bin/perl -w

#
# This is a SAS Component
#

#
# Copyright (c) 2003-2006 University of Chicago and Fellowship
# for Interpretations of Genomes. All Rights Reserved.
#
# This file is part of the SEED Toolkit.
#
# The SEED Toolkit is free software. You can redistribute
# it and/or modify it under the terms of the SEED Toolkit
# Public License.
#
# You should have received a copy of the SEED Toolkit Public License
# along with this program; if not write to the University of Chicago
# at info@ci.uchicago.edu or the Fellowship for Interpretation of
# Genomes at veronika@thefig.info or download a copy from
# http://www.theseed.org/LICENSE.TXT.
#

use strict;
use Data::Dumper;
use Carp;
use Getopt::Long;

=head1 svr_insert_seqs_into_alignment 

    svr_insert_seqs_into_alignment [options] Seqs < old_ali.fa > new_ali.fa

This script takes a FASTA file of protein/DNA alignment from the
standard input and the name of a FASTA file of sequences to be
inserted from the command line and writes the resulting alignment to
the standard output. When not possible, a message will be written to
the standard error output.

Seqs is the name of the FASTA file that contains the sequences to be inserted.

=head2 Command-Line Options

=over 4

=item trim

Trim sequence start and end.

=item verbose

Print information messages to the standard error output.

=item stddev

Window of similarity to include in profile (D = 1.5).

=back

=head2 Output Format

The standard output is a FASTA file which contains the inserted sequences.

=cut


use gjoalignment;
use gjoseqlib;

my $usage = "Usage: $0 [--help] [--verbose] [--trim] [--stddev=1.5] Seqs < old_ali.fa > new_ali.fa\n\n";

my $help    = 0;
my $verbose = 0;
my $trim    = 0;
my $stddev  = 1.5;

my $opted   = GetOptions("help"     => \$help,
                         "verbose"  => \$verbose,
                         "trim"     => \$trim,
                         "stddev=f" => \$stddev);

my $seqF    = shift @ARGV;

$seqF && !$help or die $usage;

my $opts = { trim => $trim, silent => !$verbose, stddev => $stddev };

my $seqs = gjoseqlib::read_fasta($seqF);
my $ali  = gjoseqlib::read_fasta();

$ali = gjoalignment::add_to_alignment_v2($_, $ali, $opts) for @$seqs;

gjoseqlib::print_alignment_as_fasta($ali);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3