G::Seq
Eliminate
G::Seq::Eliminate - Perl extension for blah blah blah
|
Globals (from use vars definitions) |
@EXPORT |
$VERSION |
@EXPORT_OK |
use G::Seq::Eliminate; blah blah blah
|
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.
|
DESTROY | No description | Code |
eliminate_atg | No description | Code |
eliminate_pat | No description | Code |
new | No description | Code |
valid_CDS | No description | Code |
Methods description
Methods code
sub DESTROY
{ my $self = shift;
}
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;
}
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;
}
sub new
{ my $pkg = shift;
my $filename = shift;
my $option = shift;
my $this;
return $this;
}
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