[Bio] / FigMetagenomeTools / repeatfinder.pl Repository:
ViewVC logotype

View of /FigMetagenomeTools/repeatfinder.pl

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.2 - (download) (as text) (annotate)
Fri Mar 16 20:51:25 2007 UTC (12 years, 11 months ago) by olson
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, mgrast_rel_2008_0806, mgrast_dev_10262011, mgrast_dev_02212011, mgrast_rel_2008_0923, mgrast_release_3_0, mgrast_dev_03252011, mgrast_rel_2008_0924, mgrast_rel_2008_1110_v2, mgrast_rel_2008_0625, 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, mgrast_rel_2008_0919, mgrast_rel_2008_1110, myrast_33, mgrast_rel_2008_0917, mgrast_dev_04052011, mgrast_dev_02222011, HEAD
Changes since 1.1: +0 -1 lines
initial tweaks

#!/usr/bin/env perl

# find repeats in all of the phage genomes.

# the repeats must be within 2kb of the start and end. 
# Actually: 
#   left_start must be 1,
#   left_end must be Sherwood phage start + 100
#   right_start must be sherwood phage end - 100
#   right_end must be length of sequence

use strict;
use Bio::SeqIO;
use RepeatFinder;

my $usage=<<EOF;
-f 	file
-m 	minimum size
-ls	left start
-le	left end
-rs	right start
-re 	right end
-n	near-to distance

my ($file, $min, $leftstart, $leftend, $rightstart, $rightend, $near);

while (@ARGV)
	my $t=shift @ARGV;
	if ($t eq "-f")  {$file=shift}
	if ($t eq "-m")  {$min=shift}
	if ($t eq "-ls") {$leftstart=shift}
	if ($t eq "-le") {$leftend=shift}
	if ($t eq "-rs") {$rightstart=shift}
	if ($t eq "-re") {$rightend=shift}
	if ($t eq "-n")  {$near=shift}

$min=10 unless ($min);

die $usage unless $file;
my $seqin=Bio::SeqIO->new(-file=>"$file");
my $seqout=Bio::SeqIO->new(-file=>">$file.repeats.gbk", -format=>'genbank');

while (my $seq=$seqin->next_seq) {
  my $rep=RepeatFinder->new(-seq=>$seq, -minimum=>$min);
  if ($leftstart) {$rep->left_start($leftstart)}
  if ($leftend) {$rep->left_end($leftend)}
  if ($rightstart) {$rep->right_start($rightstart)}
  if ($rightend) {$rep->right_end($rightend)}
 my $newseq=$rep->joined_repeats;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3