<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Owner]]></title>
	<link>https://bioinformaticsonline.com/snippets/owner/abhimanyu?offset=10</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/owner/abhimanyu?offset=10" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/33511/extract-fasta-sequence-from-a-multifasta-file-with-fasta-header-ids</guid>
	<pubDate>Tue, 13 Jun 2017 07:49:37 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/33511/extract-fasta-sequence-from-a-multifasta-file-with-fasta-header-ids</link>
	<title><![CDATA[Extract fasta sequence from a multifasta file with fasta header Ids]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl

use strict;
use warnings;

#Usage: perl &lt;list_of_ids_one_per_line&gt; &lt;fasta&gt; &lt;outfile&gt;

my $list = shift @ARGV;
my $fasta = shift @ARGV;
my $out = shift @ARGV;
my %select;

open LIST, &quot;$list&quot; or die;
while (&lt;LIST&gt;) {
    chomp;
    s/&gt;//g;
    $select{$_} = 1;
}
close LIST;

$/ = &quot;\n&gt;&quot;;
open OUT, &quot;&gt;$out&quot; or die;
open FASTA, &quot;$fasta&quot; or die;
while (&lt;FASTA&gt;) {
    s/&gt;//g;
    my ($id) = split (/\n/, $_);
    print OUT &quot;&gt;$_&quot; if (defined $select{$id});
}
close FASTA;
close OUT;</code>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/31356/transpose-the-file-coordinates-and-plot-dendrogram-in-r</guid>
	<pubDate>Mon, 06 Mar 2017 04:57:54 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/31356/transpose-the-file-coordinates-and-plot-dendrogram-in-r</link>
	<title><![CDATA[Transpose the file coordinates and plot dendrogram in R]]></title>
	<description><![CDATA[<code>#Save this as tr.awk
{ 
    for (i=1; i&lt;=NF; i++) a[NR,i]=$i
}
END {
    for (i=1; i&lt;=NF; i++) {
        for (j=1; j&lt;=NR; j++) {
            printf &quot;%s&quot;, a[j,i]
            if (j&lt;NR) printf &quot;%s&quot;, OFS
        }
        printf &quot;%s&quot;,ORS
    }
}

#Run this on command-line to transpose ur file
awk -f tr.awk bbb.txt &gt; bbbout.txt

#Plot in R
tetra &lt;- read.csv(&quot;bbbout.txt&quot;, header=T, stringsAsFactors = F, sep = &quot;\t&quot;, row.names = 1)
hc = hclust(dist(tetra))
plot (hc)</code>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/31103/extract-a-range-from-genome-file-with-perl</guid>
	<pubDate>Fri, 24 Feb 2017 09:30:11 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/31103/extract-a-range-from-genome-file-with-perl</link>
	<title><![CDATA[Extract a range from genome file with perl.]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl 

use strict;
use warnings;
use Bio::SeqIO;

my $in_file = $ARGV[0];
my $start_pos = $ARGV[1];
my $end_pos = $ARGV[2];

my $in = Bio::SeqIO-&gt;new ( -file =&gt; $in_file, -format =&gt; &#039;fasta&#039;);
my $out = Bio::SeqIO-&gt;new( -file =&gt; &quot;&gt;$in_file.out&quot;, -format =&gt; &#039;fasta&#039;);


while (my $seq = $in-&gt;next_seq() ) {

    $seq-&gt;display_id( $seq-&gt;display_id() . &quot;_$start_pos-$end_pos&quot; );
    $out-&gt;write_seq( $seq-&gt;trunc($start_pos, $end_pos) );
}</code>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/30764/calculate-some-statistics-for-a-dna-alignment-with-perl</guid>
	<pubDate>Thu, 02 Feb 2017 04:11:54 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/30764/calculate-some-statistics-for-a-dna-alignment-with-perl</link>
	<title><![CDATA[Calculate some statistics for a DNA alignment with Perl]]></title>
	<description><![CDATA[<code>use Bio::AlignIO;
  use Bio::Align::DNAStatistics;

  my $stats = Bio::Align::DNAStatistics-&gt;new();
  my $alignin = Bio::AlignIO-&gt;new(-format =&gt; &#039;emboss&#039;,
                                 -file   =&gt; &#039;t/data/insulin.water&#039;);
  my $aln = $alignin-&gt;next_aln;
  my $jcmatrix = $stats-&gt;distance(-align =&gt; $aln, 
                                  -method =&gt; &#039;Jukes-Cantor&#039;);

  print $jcmatrix-&gt;print_matrix;
  ## and for measurements of synonymous /nonsynonymous substitutions ##

  my $in = Bio::AlignIO-&gt;new(-format =&gt; &#039;fasta&#039;,
                            -file   =&gt; &#039;t/data/nei_gojobori_test.aln&#039;);
  my $alnobj = $in-&gt;next_aln;
  my ($seq1id,$seq2id) = map { $_-&gt;display_id } $alnobj-&gt;each_seq;
  my $results = $stats-&gt;calc_KaKs_pair($alnobj, $seq1id, $seq2id);
  print &quot;comparing &quot;.$results-&gt;[0]{&#039;Seq1&#039;}.&quot; and &quot;.$results-&gt;[0]{&#039;Seq2&#039;}.&quot;\n&quot;;
  for (sort keys %{$results-&gt;[0]} ){
      next if /Seq/;
      printf(&quot;%-9s %.4f \n&quot;,$_ , $results-&gt;[0]{$_});
  }

  my $results2 = $stats-&gt;calc_all_KaKs_pairs($alnobj);
  for my $an (@$results2){
      print &quot;comparing &quot;. $an-&gt;{&#039;Seq1&#039;}.&quot; and &quot;. $an-&gt;{&#039;Seq2&#039;}. &quot; \n&quot;;
      for (sort keys %$an ){
          next if /Seq/;
          printf(&quot;%-9s %.4f \n&quot;,$_ , $an-&gt;{$_});
      }
      print &quot;\n\n&quot;;
  }

  my $result3 = $stats-&gt;calc_average_KaKs($alnobj, 1000);
  for (sort keys %$result3 ){
      next if /Seq/;
      printf(&quot;%-9s %.4f \n&quot;,$_ , $result3-&gt;{$_});
  }</code>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/30248/dotplot-with-perl</guid>
	<pubDate>Tue, 20 Dec 2016 07:25:01 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/30248/dotplot-with-perl</link>
	<title><![CDATA[DotPlot with Perl]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl
use strict;use warnings;
my $i;my $j;my $a;

open (FH1,&#039;&lt;&#039;, &quot;s.fa&quot;);
open (FH2,&#039;&lt;&#039;, &quot;s.fa&quot;);
my $seq1 = do { local $/; &lt;FH1&gt; };
my $seq2 = do { local $/; &lt;FH2&gt; };


my @s1=split(&#039;&#039;,$seq1);
my @s2=split(&#039;&#039;,$seq2);
my @matrix=();

for($i=0;$i&lt;scalar(@s2);$i++)
{
 for($j=0;$j&lt;scalar(@s1);$j++)
 {
  if($s2[$i] eq $s1[$j])
  {
  $matrix[$i][$j]=&quot;.&quot;;
  }
  else
  {
  $matrix[$i][$j]=&quot; &quot;;
  }

 }
}

#Printing matrix of dot plot
open (FHOUT,&quot;&gt;dotplot.txt&quot;) or die &quot;cannot open outfile\n&quot;;
for($a=0;$a&lt;scalar(@s1);$a++)
{
print FHOUT &quot;$s1[$a]&quot;;
}
print FHOUT &quot;\n&quot;;
#print&quot;\n\n&quot;;
for($i=0;$i&lt;scalar(@s2);$i++)
{
print FHOUT &quot;$s2[$i]&quot;;

 for($j=0;$j&lt;scalar(@s1);$j++)
 {
 print FHOUT &quot;$matrix[$i][$j]&quot;;
 }
print FHOUT &quot;\n&quot;;
#print&quot;\n\n&quot;;
}

close FH1;
close FH2;
close FHOUT;</code>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/30247/dotplot-with-perl-gd</guid>
	<pubDate>Tue, 20 Dec 2016 07:23:52 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/30247/dotplot-with-perl-gd</link>
	<title><![CDATA[DotPlot with Perl GD]]></title>
	<description><![CDATA[<code>#!/usr/local/bin/perl -w
# NOTE: YOU MUST CHANGE THE LINE ABOVE TO POINT TO
# THE FULL PATH OF THE PERL EXECUTABLE ON YOUR SYSTEM.

# System requirements: requires perl and perl modules
# DB_File and GD.pm, available from CPAN.
 
# For usage information, run this program with the flag
# -h.

require v5.6.0;

use GD;
use DB_File;
use strict;
use vars qw/$VERSION/;

BEGIN {

	    $VERSION = &#039;1.0&#039;;

	    if (!defined $GD::VERSION || $GD::VERSION ne 1.32) {
			print STDERR &quot;\n$0:\n&quot;;
			print STDERR &quot;WARNING -- GD VERSION 1.32 REQUIRED.\n&quot;;		
			if (defined $GD::VERSION){
				print STDERR &quot;You have GD version $GD::VERSION.\n&quot;;
				print STDERR &quot;If $0\n&quot;;
				print STDERR &quot;does not work correctly you will\n&quot;;
				print STDERR &quot;have to install GD version 1.32.\n\n&quot;;
		    }
		}

	    if (!defined $DB_File::VERSION || $DB_File::VERSION ne 1.814) {
			print STDERR &quot;\n$0:\n&quot;;
			print STDERR &quot;WARNING -- DB_File VERSION 1.814 REQUIRED.\n&quot;;
			if (defined $DB_File::VERSION){
				print STDERR &quot;You have DB_File version $DB_File::VERSION.\n&quot;;
				print STDERR &quot;If $0\n&quot;;
				print STDERR &quot;does not work correctly you will\n&quot;;
				print STDERR &quot;have to install DB_File version 1.814.\n\n&quot;;
		    }
		}
}

use Getopt::Long;

sub usage();
sub main();
sub print_square($$$$$$$$$$);
sub print_triangle($$$$$$$$$);
sub print_png ($$);
sub revcomp($);


main();

sub usage() {
    print qq/
    
USAGE: $0 -i &lt;in file&gt; [optional args]

OPTIONAL ARGUMENTS:

        -j &lt;2nd file&gt; 
        -o &lt;out file&gt;
        -d &lt;dot file&gt;
        -w &lt;word size&gt; 
        -s &lt;step size&gt;
        -p &lt;pixels&gt;
        -t &lt;title&gt;
          
        -h print this help message


Create a PNG (&quot;portable network graphics&quot;) file
that displays a triangular dot plot of the input
sequence against itself, or a square plot against 
a second sequence with option -j.





&lt;in file&gt;   is a fasta format file from which the
            sequence is taken.

            This is the only required parameter.
			


&lt;2nd file&gt;  is a fasta format file from which a
            second sequence is taken.
	
            default:
            null -- triangular dot plot created           
			


&lt;out file&gt;  is the PNG file created.

            default:
            &lt;in file(s)&gt;_&lt;word_size&gt;_&lt;step_length&gt;_&lt;pixels&gt;.png
			


&lt;dot file&gt;  A database file containing the 
            positions of words of &lt;word size&gt;
            encountered in your sequence.
            This database is not human-readable,
            and can get quite large, so make 
            sure that you have plenty of disk 
            space available. 
            
            Databases size scales linearly 
            with sequence length. With default 
            parameters,databases are are roughly 
            150k per base-pair of sequence.
            
            Complex sequences use more disk
            space than repetitive ones.
			
            default:
            &lt;infile(s)&gt;_&lt;word_size&gt;_&lt;step_length&gt;.dot
			


&lt;word size&gt; is the word size for a match.  A dot
            is printed if there is a perfect match
            of length &lt;word size&gt;.
            
            default:
            &lt;word size&gt; = 100
			


&lt;step size&gt; is the number of bases to move the
            word for each dot.
            
            default:
            &lt;step size&gt; = 1
			


&lt;pixels&gt;    is the width of the plot in pixels and
            defines the resolution of the image.

            default:
            &lt;pixels&gt; = 600
			


&lt;title&gt;     is a title to place in the output.

            default:
            null -- no title appears



If for some reason this program is disrupted during
a run, restart with the same parameters and it will
automatically resume where it left off.

Completed runs can be re-plotted from the existing 
dot file using a different resolution by changing -p

-h causes this message to printed.

(Version $VERSION)

/;
}

sub main() {

	#Define the arguments
    my ($seqfile, $second, $outfile, $dotfile, $word, $step, $pixels, $title, $help);
	
	#Perform Checking -- remind the user that TMTOWTDI.
    if (!GetOptions(
    	&#039;infile=s&#039;  =&gt; \$seqfile,
    	&#039;jfile=s&#039;   =&gt; \$second,
		&#039;wordlen=i&#039; =&gt; \$word,
		&#039;step=i&#039;    =&gt; \$step,
		&#039;outfile=s&#039; =&gt; \$outfile,
		&#039;title=s&#039;   =&gt; \$title,
		&#039;pixels=i&#039;   =&gt; \$pixels,
		&#039;dotfile=s&#039; =&gt; \$dotfile,
		&#039;help&#039;      =&gt; \$help)) {
		usage;
		exit -1;
    }
    
    if ($help) {
		usage;
		exit;
    }
    
	if (!defined $seqfile){
		usage; exit -1;
    }
    
	if (!defined $second){
		print &quot;Creating triangular plot from: $seqfile\n&quot;;
		print &quot;\t use -j to make a square plot\n&quot;;
	}
	
    if (!defined $word){
    	$word = 100;
    	print &quot;Using word size 100\n&quot;;
		print &quot;\tuse -w to set word size\n&quot;;
    }elsif ($word &lt;= 0){
		print STDERR &quot;$0 -w &lt;word size&gt; must be &gt;= 0\n&quot;;
		exit -1;
    }
    
	if (!defined $step){
		$step = 1;
    	print &quot;Using step size 1\n&quot;;
		print &quot;\tuse -s to set step size\n&quot;;
	}elsif ($step &lt;= 0) {
		print STDERR &quot;$0 -s &lt;step length&gt; must be &gt;= 0\n&quot;;
		exit -1;
    }	
    
    if (!defined $pixels){
    	$pixels = 600;
    	print &quot;Using image size 600 pixels\n&quot;;
		print &quot;\tuse -p to set pixels\n&quot;;
	}elsif ($pixels &lt;= 0) {
		print STDERR &quot;$0 -s &lt;pixels&gt; must be &gt;= 0\n&quot;;
		exit -1;
    }	
	
	if (!defined $dotfile) {
		$seqfile =~ m/\/?([^\/\.]+)\.?\w*$/;
		$dotfile = $1;
		if ($second){
			$second =~ m/\/?([^\/\.]+)\.?\w*$/;
			$dotfile .= &quot;_&quot; . $1;
		}
		$dotfile .= &quot;_&quot; . $word . &quot;_&quot; . $step;
		#$dotfile =~ tr/[\.\/]/_/;
		$dotfile .= &quot;.dot&quot;;
		print &quot;Storing matches in: $dotfile\n&quot;;
		print &quot;\tuse -d to name dot file\n&quot;;
    }
		
	if (!defined $outfile){
		$seqfile =~ m/\/?([^\/\.]+)\.?\w*$/;
		$outfile = $1;
		if ($second){
			$second =~ m/\/?([^\/\.]+)\.?\w*$/;
			$outfile .= &quot;_&quot; . $1;
		}
		$outfile .= &quot;_&quot; . $word . &quot;_&quot; . $step . &quot;_&quot; . $pixels;
		#$outfile =~ tr/[\.\/]/_/;
		$outfile .= &quot;.png&quot;;
		print &quot;Printing picture in: $outfile\n&quot;;
		print &quot;\tuse -o to name out file\n&quot;;
    }

	    
    $title = &#039;&#039; unless defined $title;

	#Open the database file -- this makes us fast!
	my %DOT = ();
	dbmopen(%DOT, &quot;$dotfile&quot;, 0666) || die &quot;Cannot open $dotfile: $!&quot;;

	#Define some variables we need
	my ($xlen, $ylen) = (0, 0);
	my ($i, $j, $k, $key) = (0, 0, 0, &quot;&quot;);
	my $seq = &quot;&quot;;
	
	#Start reading the first sequence, avoid a file slurp
	
    open(IN, $seqfile) || die &quot;Cannot open $seqfile: $!&quot;;
    while (&lt;IN&gt;){
    	if (m/^&gt;/){
    		next;
    	}
    	chomp;
    	$k += length $_;
    	$seq .= uc($_);
    	while ($seq &amp;&amp; (($i + $word) &lt; $k) &amp;&amp; ($j + $word) &lt; $k){
    		#wait until we hit the place where we left off!
    		if ($DOT{xpos} &amp;&amp; $i &lt; $DOT{xpos}){
    		}elsif ($i &lt; $j){
    			$DOT{xpos} = $i;
    		}elsif ($i == $j){
    			$DOT{xpos} = $i;
    			$key = substr($seq, 0, $word);
    			#treat Ns as mismatches
    			unless ($key =~ m/N/){
    				if ($DOT{$key}){
    					$DOT{$key} .= &quot;x:$i\t&quot;;
    				}elsif($DOT{revcomp($key)}){
    					$DOT{revcomp($key)} .= &quot;x:$i\t&quot;;
    				}else{
    					$DOT{$key} .= &quot;x:$i\t&quot;;
    				}
    			}
    			$j += $step;
    		}
    		substr($seq, 0, 1) = &quot;&quot;;
    		$i++;
    	}
	    	
	}
	close IN;
	$xlen = $k;
	
	#Is there another sequence?

	    
	if ($second){

		#Looks like there is.
		#Flush out these variables:

		($i, $j, $k, $key) = (0, 0, 0, &quot;&quot;);
		$seq = &quot;&quot;;
		
		#Read the second sequence, avoid a file slurp
		
    	open(IN, $second) || die &quot;Cannot open $second: $!&quot;;	
	    while (&lt;IN&gt;){
	    	if (m/^&gt;/){
	    		next;
	    	}
	    	chomp;
	    	$k += length $_;
	    	$seq .= uc($_);
	    	while ($seq &amp;&amp; (($i + $word) &lt; $k) &amp;&amp; ($j + $word) &lt; $k){
				#wait until we hit the place where we left off!
	    		if ($DOT{ypos} &amp;&amp; $i &lt; $DOT{ypos}){
	    		}elsif ($i &lt; $j){
	    			$DOT{ypos} = $i;
	    		}elsif ($i == $j){
	    			$DOT{ypos} = $i;
	    			$key = substr($seq, 0, $word);
	    			#treat Ns as mismatches
	    			unless ($key =~ m/N/){
	    				if ($DOT{$key}){
	    					$DOT{$key} .= &quot;y:$i\t&quot;;
	    				}elsif($DOT{revcomp($key)}){
	    					$DOT{revcomp($key)} .= &quot;y:$i\t&quot;;
	    				}else{
	    					$DOT{$key} .= &quot;y:$i\t&quot;;
	    				}
	    			}
	    			$j += $step;
	    		}
	    		substr($seq, 0, 1) = &quot;&quot;;
	    		$i++;
	    	}
	    	
	    }
	    close IN;
	    $ylen = $k;
	}
	# Close that DB
	
	dbmclose %DOT;
	
    # Create and print the output.
    
    my ($img, $white, $black, $gray, $margin, $x0, $y0, $x1, $y1);
	$margin = 50;
	$x0 = $y0 = $margin;
	$x1 = $y1 = $pixels - $margin;
    $img = new GD::Image($pixels, $pixels);
    $white = $img-&gt;colorAllocate(255,255,255);
	$black = $img-&gt;colorAllocate(0,0,0);
	$gray = $img-&gt;colorAllocate(187,187,187);
    $img-&gt;interlaced(&#039;true&#039;);
    $img-&gt;string(gdLargeFont, $x0, $y0 - 35, &quot;$title  -w=$word -s=$step&quot;, $black);
	
	
    # Square or Triangle?
    
    if ($second){
    	$img-&gt;string(gdLargeFont, $x0, $y0 - 15, &quot;$xlen bp x $ylen bp&quot;, $black);
    	print_square($img, $x0, $x1, $y0, $y1, $black, $gray, $xlen, $ylen, $dotfile);
    }else{
		$img-&gt;string(gdLargeFont, $x0, $y0 - 15, &quot;$xlen bp&quot;, $black);
		print_triangle($img, $x0, $x1, $y0, $y1, $black, $gray, $xlen, $dotfile);
    }
    
    # Print this thing out
    
    print_png($img, $outfile);
    
    print &quot;Plot Complete!\n&quot;;
} 
 

sub print_square ($$$$$$$$$$){

	my ($img, $x0, $x1, $y0, $y1, $black, $gray, $xlen, $ylen, $dotfile) = @_;
	
	my $del = ($x1 - $x0) / $xlen;
	if ($del &gt; (($y1 - $y0) / $ylen)){
		$del = (($y1 - $y0) / $ylen);
	}	
	my %hash = ();
	my ($xd, $yd, $key, $value);
	my %TEMPFILE = ();
	dbmopen(%TEMPFILE, &quot;$dotfile&quot;, 0666) || die &quot;Can&#039;t open database $dotfile: $!&quot;;
	#avoid slurping again, pull values out one by one!
	while (($key,$value) = each %TEMPFILE){
		if ($key =~ m/[ACGT]+/){
			while ($value =~ m/([xy]):(\d+)\t(.*)/){
				($hash{$1}{$2}, $value) = (1, $3);	
			}
		}
		foreach $xd (keys(%{$hash{x}})){
			foreach $yd (keys(%{$hash{y}})){
				$img-&gt;setPixel(($x0 + ($del * $xd)), ($y0 + ($del * $yd)), $black);
			}
		}
		%hash = ();
	}
	dbmclose %TEMPFILE;
	$img-&gt;rectangle($x0, $y0, ($x0 + ($del * $xlen)), ($y0 + ($del * $ylen)), $gray);
}

 
sub print_triangle ($$$$$$$$$){

	my ($img, $x0, $x1, $y0, $y1, $black, $gray, $xlen, $dotfile) = @_;
	
	my $del = ($x1 - $x0) / $xlen;
	my %hash = ();
	my ($xd, $yd, $key, $value);
	my %TEMPFILE = ();
	dbmopen(%TEMPFILE, &quot;$dotfile&quot;, 0666) || die &quot;Can&#039;t open database $dotfile: $!&quot;;
	#avoid slurping again, pull values out one by one!
	while (($key,$value) = each %TEMPFILE){
		if ($key =~ m/[ACGT]+/){
			while ($value =~ m/x:(\d+)\t(.*)/){
				($hash{x}{$1}, $hash{y}{$1}, $value) = (1, 1, $2);	
			}
		}
		foreach $xd (keys(%{$hash{x}})){
			foreach $yd (keys(%{$hash{y}})){
					$img-&gt;setPixel(($x0 + (($del * ($xd + $yd)) * 0.5)), ($y1 - (($del * sqrt(($yd - $xd) * ($yd - $xd))) * 0.5)), $black);
			}
		}
		%hash = ();
	}
	dbmclose %TEMPFILE;
	$img-&gt;line($x0, $y1, $x1, $y1, $gray);
	$img-&gt;line($x0, $y1, (($x0 + $x1) * 0.5), ($y1 - (($x1 - $x0) * 0.5)), $gray);
	$img-&gt;line((($x0 + $x1) * 0.5), ($y1 - (($x1 - $x0) * 0.5)), $x1, $y1, $gray);
		
}

sub print_png ($$) {
    my ($img, $outfile) = @_;
    if ($outfile) {
	open(OUT, &quot;&gt;$outfile&quot;)
	    || die &quot;Cannot write $outfile: $!\n&quot;;
	print OUT $img-&gt;png;
	close OUT;
    } else {
	print $img-&gt;png;
    }
}

sub revcomp ($){
	my $f = shift(@_);
	my $r = reverse($f);
	$r =~ tr/GATC/CTAG/;
	return $r;
}</code>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>

</channel>
</rss>