G::Tools Repeat
Included librariesPackage variablesGeneral documentationMethods
Package variables
No package variables defined.
Included modules
G::Messenger
SelfLoader
SubOpt
Inherit
Exporter
Synopsis
No synopsis!
Description
No description!
Methods
_repeatmasker
No description
Code
_trf
No description
Code
Methods description
None available.
Methods code
_repeatmaskerdescriptionprevnextTop
sub _repeatmasker {
    &opt_default(input=>"file",qr=>"off");
    my @param;
    my @tmp;
    foreach(@_){
	if($_ eq '-nolow' || $_ eq '-l' || $_ eq '-int' || $_ eq '-norna' ||
           $_ eq '-alu' || $_ eq '-m' || $_ eq '-rod' || $_ eq '-mam' ||
           $_ eq '-cow' || $_ eq '-ar' || $_ eq '-dr' || $_ eq '-el' ||
	   $_ eq '-is_only' || $_ eq '-is_clip' || $_ eq '-no_is' ||
	   $_ eq '-rodspec' || $_ eq '-primspec' || $_ eq '-w' || $_ eq '-s'||
	   $_ eq '-q' || $_ eq '-qq' || $_ eq '-gccalc' || $_ eq '-nocut' ||
	   $_ eq '-noisy' || $_ eq '-a' || $_ eq '-cut' || $_ eq '-small' ||
	   $_ eq '-xsmall' || $_ eq '-x' || $_ eq '-poly' || $_ eq '-ace' ||
	   $_ eq '-gff' || $_ eq '-u' || $_ eq '-xm' || $_ eq '-fixed' ||
	   $_ eq '-no_id' || $_ eq '-e'){
	    push(@param,$_);
	}
	else{
	    push(@tmp,$_);
	}
    }
    @_=@tmp;
    my @args=opt_get(@_);

    my $input=&opt_val("input");
    my $qr=&opt_val("qr");
    my $file;
    my $seq;
    my $param;
    my %opt;
    my $num;

    if($input eq "seq"){
	$seq=shift @args;
	opendir(DIR,'/tmp');
	@tmp=readdir(DIR);
	$num=$#tmp+1+time;
	@tmp=keys(%$seq);
	open(FILE,'>/tmp/repeatmasker_'.$num.'.seq');
	print FILE ">$tmp[0]\n";
	print FILE $$seq{$tmp[0]},"\n";
	close(FILE);
	$file='/tmp/repeatmasker_'.$num.'.seq'; 
	&opt_default(dir=>'.');
    }
    else{
	$file=shift @args;
    }

    $opt{div}=&opt_val("div");
    $opt{lib}=&opt_val("lib");
    $opt{cutoff}=&opt_val("cutoff");
    $opt{pa}=&opt_val("pa");
    $opt{gc}=&opt_val('gc');
    $opt{frag}=&opt_val('frag');
    $opt{dir}=&opt_val('dir');

    foreach(sort keys(%opt)){
	next if($opt{$_} eq '');
	push(@param,'-'.$_);
	push(@param,$opt{$_});
    }
    $param=join(" ",@param);
    
    system("RepeatMasker $param $file") if($qr ne 'on');
    system('qr',"RepeatMasker $param $file") if($qr eq 'on');

    unlink('/tmp/repeatmasker_'.$num.'.seq') if($input eq "seq" && $qr ne 'on');

    return "$param $file";
}
_trfdescriptionprevnextTop
sub _trf {
    &opt_default(qr=>'off',input=>"file",Match=>"2",Mismatch=>"7",Delta=>"7",PM=>"80",PI=>"10",Minscore=>"50",MaxPeriod=>"500");
    my @param;
    my @tmp;
    foreach(@_){
        if($_ eq '-m' || $_ eq '-f' || $_ eq '-d'){
            push(@param,$_);
        }
        else{
            push(@tmp,$_);
        }
    }
    @_=@tmp;
    my @args=opt_get(@_);

    my $qr=&opt_val("qr");
    my $input=&opt_val("input");
    my $filename=&opt_val("filename");
    my $file;
    my $seq;
    my $param;
    my %opt;
    my $num;

    if($input eq "seq"){
        $seq=shift @args;
	if($filename eq ''){
	    opendir(DIR,'/tmp');
	    @tmp=readdir(DIR);
	    $num=$#tmp+1+time;
	    $filename='/tmp/trf_'.$num.'.seq';
	}
        @tmp=keys(%$seq);
        open(FILE,'>'."$filename");
        print FILE ">$tmp[0]\n";
        print FILE $$seq{$tmp[0]},"\n";
        close(FILE);
        $file=$filename; 
    }
    else{
        $file=shift @args;
    }

    @param=(&opt_val("Match"),&opt_val("Mismatch"),&opt_val("Delta"),&opt_val("PM"),&opt_val("PI"),&opt_val("Minscore"),&opt_val("MaxPeriod"),@param);
    foreach(sort keys(%opt)){
        next if($opt{$_} eq '');
        push(@param,'-'.$_);
        push(@param,$opt{$_});
    }
    $param=join(" ",@param);
    
    system("trf $file $param") if($qr ne 'on');
    system('qr',"trf $file $param") if($qr eq 'on');

    unlink("$filename") if($input eq "seq" && $qr ne 'on');

    return "$file $param";
}
General documentation
No general documentation available.