G::Seq

Eliminate

Summary Included libraries Package variables Synopsis Description General documentation Methods

Summary
G::Seq::Eliminate - Perl extension for blah blah blah
Package variables top
Globals (from use vars definitions)
@EXPORT
$VERSION
@EXPORT_OK
Included modulestop
G::Messenger
G::Seq::Util
SubOpt
strict
Inherit top
AutoLoader Exporter
Synopsistop
  use G::Seq::Eliminate;
blah blah blah
Descriptiontop
Stub documentation for G::Seq::Eliminate was created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.

Blah blah blah.
Methodstop
DESTROYNo descriptionCode
eliminate_atgNo descriptionCode
eliminate_patNo descriptionCode
newNo descriptionCode
valid_CDSNo descriptionCode

Methods description


Methods code

DESTROYdescriptiontopprevnext
sub DESTROY {
    my $self = shift;
}
eliminate_atgdescriptiontopprevnext
sub eliminate_atg {
    &opt_default(upstream=>15,downstream=>15);
    my @args=opt_get(@_);

    my $gb=opt_as_gb(shift @args);
    my $upstream=int(opt_val("upstream")/3);
my $downstream=int(opt_val("downstream")/3);
my $start; my $i=1; my $j; my $switch; my @result; foreach($gb->cds()){ $switch=0; if($gb->{"CDS$i"}->{direction} eq 'direct'){ $start=$gb->{"CDS$i"}->{start}; for($j = -$upstream * 3 + $start;$j <= $downstream * 3 + $start;$j += 3){ if($j != $start && substr($gb->{SEQ},$j-1,3) eq 'atg'){ $switch=1; } } } elsif($gb->{"CDS$i"}->{direction} eq 'complement'){ $start=$gb->{"CDS$i"}->{end}; for($j = $upstream * 3 + $start;$j >= -$downstream * 3 + $start;$j -= 3){ if($j != $start && substr($gb->{SEQ},$j-1,3) eq 'cat'){ $switch=1; } } } $gb->{"CDS$i"}->{on}=0 if($switch==1); push(@result,"CDS$i") if($switch==0); $i++; } return\@ result;
}
eliminate_patdescriptiontopprevnext
sub eliminate_pat {
    &opt_default(upstream=>30,downstream=>30);
    my @args=opt_get(@_);

    my $gb=opt_as_gb(shift @args);
    my $uppos=opt_val("upstream");
    my $downpos=opt_val("downstream");
    my $pat=shift;
    my $start;
    my $i=1;
    my $j;
    my $switch;
    my @result;


    foreach($gb->cds()){
	$switch=0;
	if($gb->{"CDS$i"}->{direction} eq 'direct'){ 
	    $start=$gb->{"CDS$i"}->{start};
	    for($j = -$uppos + $start;$j <= $downpos+ $start;$j ++){
		if($gb->getseq($j,$j+length($pat)-1) eq $pat){
		    $switch=1;
		}
	    }
	}
	elsif($gb->{"CDS$i"}->{direction} eq 'complement'){
	    $start=$gb->{"CDS$i"}->{end};
	    for($j = $uppos+ $start;$j >= -$downpos+ $start;$j --){
		if($gb->getseq($j-length($pat)+1,$j) eq _complement($pat)){ 
		    $switch=1;
		}
	    }
	} 
	$gb->{"CDS$i"}->{on}=0 if($switch==1);
	push(@result,"CDS$i") if($switch==0);
	$i++;
    }
    return\@ result;
}
newdescriptiontopprevnext
sub new {
    my $pkg = shift;
    my $filename = shift;
    my $option = shift;
    my $this;

    return $this;
}
valid_CDSdescriptiontopprevnext
sub valid_CDS {
    &opt_default(Max=>10000,Min=>20);
    my @args=opt_get(@_);

    my $gb=opt_as_gb(shift @args);
    my $max=opt_val("Max");
    my $min=opt_val("Min");
    my $start;
    my $end;
    my $num=1;
    my $tmp;
    my $switch;
    my @result;

    foreach($gb->cds()){
	$switch=0;
	$tmp=$num-1;
	if($gb->{"CDS$num"}->{direction} eq 'direct' && $gb->{"CDS"."$tmp"}->{direction} eq 'direct'){
	    $start = $gb->{"CDS$num"}->{start};
	    $end = $gb->{"CDS"."$tmp"}->{end};
	    $switch=1 if($start-$end > $max || $start-$end < $min);
	}
	elsif($gb->{"CDS$num"}->{direction} eq 'complement' && $gb->{"CDS"."$tmp"}->{direction} eq 'complement'){
	    $start = $gb->{"CDS$num"}->{start};
	    $end = $gb->{"CDS"."$tmp"}->{end};
	    $switch=1 if($start-$end > $max || $start-$end < $min);
	}
	$gb->{"CDS$num"}->{on}=0 if($switch==1);
	push(@result,"CDS$num") if($switch==0);
	$num++;
    }

    return\@ result;
}

General documentation

AUTHOR top
A. U. Thor, a.u.thor@a.galaxy.far.far.away
SEE ALSO top
perl(1).