"Fossies" - the Fresh Open Source Software Archive

Member "augustus-3.3.3/scripts/extractTranscriptEnds.pl" (13 Sep 2019, 511 Bytes) of package /linux/misc/augustus-3.3.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "extractTranscriptEnds.pl" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.3.2_vs_3.3.3.

    1 #!/usr/bin/env perl
    2 
    3 # extract transcript ends of a given length from a gene fasta file (no UTR)
    4 # Katharina Hoff, 9.8.2011, katharina.hoff@gmail.com
    5 
    6 my $n = 30;
    7 
    8 my $seq;
    9 my $seqLen;
   10 my $i = 1;
   11 while(<STDIN>){
   12     if($_=~m/^>/){
   13     $lenLen = length($seq);
   14     print ">seq".$i."\n";
   15     print substr($seq, $seqLen-30, 27)."\n";
   16     $seq = "";
   17     $i = $i+1;
   18     }else{
   19     chomp;
   20     $seq = $seq.$_;
   21     }
   22 }
   23 
   24 if(length($seq)>1){
   25     $lenLen = length($seq);
   26     print ">seq".$i."\n";
   27     print substr($seq, $seqLen-30, 30)."\n";
   28 }