
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.rajkumar.in/index.php?action=history&amp;feed=atom&amp;title=Count_fasta.pl</id>
	<title>Count fasta.pl - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.rajkumar.in/index.php?action=history&amp;feed=atom&amp;title=Count_fasta.pl"/>
	<link rel="alternate" type="text/html" href="https://www.rajkumar.in/index.php?title=Count_fasta.pl&amp;action=history"/>
	<updated>2026-07-09T19:45:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://www.rajkumar.in/index.php?title=Count_fasta.pl&amp;diff=1773&amp;oldid=prev</id>
		<title>Raj: Created page with &#039;Category:Bioinformatics &lt;source lang=perl&gt; #! /usr/bin/perl -w   # ************************************************************* # This Programme does the following in sequen…&#039;</title>
		<link rel="alternate" type="text/html" href="https://www.rajkumar.in/index.php?title=Count_fasta.pl&amp;diff=1773&amp;oldid=prev"/>
		<updated>2010-06-03T14:16:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;&lt;a href=&quot;/index.php/Category:Bioinformatics&quot; title=&quot;Category:Bioinformatics&quot;&gt;Category:Bioinformatics&lt;/a&gt; &amp;lt;source lang=perl&amp;gt; #! /usr/bin/perl -w   # ************************************************************* # This Programme does the following in sequen…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Bioinformatics]]&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
#! /usr/bin/perl -w&lt;br /&gt;
 &lt;br /&gt;
# *************************************************************&lt;br /&gt;
# This Programme does the following in sequence&lt;br /&gt;
# -&amp;gt; Count Numbers and generate statistics&lt;br /&gt;
# -&amp;gt; Singlecored&lt;br /&gt;
# Author : Rajkumar (itc@rajkumar.in)&lt;br /&gt;
# Release: JUN 2010&lt;br /&gt;
# *************************************************************&lt;br /&gt;
 &lt;br /&gt;
# Libraries&lt;br /&gt;
        use strict;&lt;br /&gt;
        use Bio::Perl;&lt;br /&gt;
        use Bio::SearchIO;&lt;br /&gt;
        use List::Util qw[min max];&lt;br /&gt;
        use Parallel::ForkManager;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
# At the top: Time Start&lt;br /&gt;
        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =&lt;br /&gt;
        localtime(time);&lt;br /&gt;
 &lt;br /&gt;
# Variables&lt;br /&gt;
        my $path    = &amp;quot;/home/raj/bio&amp;quot;;&lt;br /&gt;
        my $datadir = &amp;quot;$path/tobacco/data&amp;quot;;&lt;br /&gt;
        my $curdir  = &amp;quot;$path/tobacco/annotation/gt&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        my $infile  = &amp;quot;$datadir/unigenes.fa&amp;quot;;&lt;br /&gt;
        my $outfile = &amp;quot;$curdir/est.stat&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
        my ($i, $c_fasta)     = $_;&lt;br /&gt;
        my (@length)     = @_;&lt;br /&gt;
&lt;br /&gt;
        my $pm = new Parallel::ForkManager(16);&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
# Genome threader RUN&lt;br /&gt;
 &lt;br /&gt;
        print &amp;quot;\n\tCounting ...\n&amp;quot;;     &lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
        # count number of fasta&lt;br /&gt;
        $c_fasta = `grep -c &amp;quot;&amp;gt;&amp;quot; $infile`;&lt;br /&gt;
        chomp $c_fasta;&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        my $in  = Bio::SeqIO-&amp;gt;new(-file =&amp;gt; &amp;quot;$infile&amp;quot;, -format =&amp;gt;&lt;br /&gt;
        &amp;#039;Fasta&amp;#039;);&lt;br /&gt;
        my $identifier;&lt;br /&gt;
        my $sequence;&lt;br /&gt;
&lt;br /&gt;
        $i = 0;&lt;br /&gt;
        while ( my $seq = $in-&amp;gt;next_seq() ) {&lt;br /&gt;
                $identifier = $seq-&amp;gt;id;&lt;br /&gt;
                $sequence = $seq-&amp;gt;seq;&lt;br /&gt;
                &lt;br /&gt;
                $i++;&lt;br /&gt;
                &lt;br /&gt;
                my $percent = ($i/$c_fasta)*100;&lt;br /&gt;
                $percent = sprintf(&amp;quot;%.2f&amp;quot;, $percent);&lt;br /&gt;
                &lt;br /&gt;
                                &lt;br /&gt;
                my $length = ($sequence =~ tr/[A-Z]|[a-z]//);&lt;br /&gt;
                &lt;br /&gt;
                push(@length, &amp;quot;$length&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
                &lt;br /&gt;
                &lt;br /&gt;
                #print &amp;quot;$identifier\t$length\n&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        my $mini = min(@length);&lt;br /&gt;
        my $maxi = max(@length);&lt;br /&gt;
        my $c_array = @length;&lt;br /&gt;
        &lt;br /&gt;
        my $set1  = @length[$mini .. 1000];&lt;br /&gt;
        my $set2  = @length[1001 .. 2000];&lt;br /&gt;
        my $set3  = @length[2001 .. 3000];&lt;br /&gt;
        my $set4  = @length[3001 .. $maxi];&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
        print &amp;quot;Max:$maxi\tMini:$mini\tTotalLength:$c_array\n&lt;br /&gt;
               Set1:$set1\tSet2:$set2\tSet3:$set3\tSet4:$set4\n&amp;quot;;&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
exit;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
# At the End: Time Calculation&lt;br /&gt;
        my&lt;br /&gt;
        ($sec_,$min_,$hour_,$mday_,$mon_,$year_,$wday_,$yday_,$isdst_) =&lt;br /&gt;
        localtime(time);&lt;br /&gt;
        my $days  = $mday_-$mday;&lt;br /&gt;
        my $hours = $hour_-$hour;&lt;br /&gt;
        my $mins  = $min_-$min;&lt;br /&gt;
        my $secs  = $sec_-$sec;&lt;br /&gt;
        print &amp;quot;\n------------------------\nDuration: &amp;quot;;&lt;br /&gt;
        if ($days&amp;gt;0) { print &amp;quot;$days days&amp;quot;;}&lt;br /&gt;
        if ($hours&amp;gt;0) { print &amp;quot;: $hours hours&amp;quot;;}&lt;br /&gt;
        if ($mins&amp;gt;0) { print &amp;quot;: $mins mins&amp;quot;;}&lt;br /&gt;
        if ($secs&amp;gt;0) { print &amp;quot;: $secs secs&amp;quot;;}&lt;br /&gt;
        print &amp;quot;\n------------------------\n&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
# END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Raj</name></author>
	</entry>
</feed>