<?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/nishi?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/owner/nishi?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/42186/concatenate-two-given-sequences-and-find-the-length-of-the-new-sequence-and-also-print-out-the-second-codon-of-the-sequence</guid>
	<pubDate>Thu, 03 Sep 2020 06:47:43 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/42186/concatenate-two-given-sequences-and-find-the-length-of-the-new-sequence-and-also-print-out-the-second-codon-of-the-sequence</link>
	<title><![CDATA[Concatenate two given sequences, and find the length of the new sequence and also print out the second codon of the sequence]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl
use strict;
use warnings;

#assign strings to variables
my $DNA = &quot;GATTACACAT&quot;;
my $polyA = &quot;AAAA&quot;;

#concatenate two strings
my $modifiedDNA = $DNA.$polyA;

#calculate the length of $modifiedDNA and
#print out the value of the variable and its length
my $DNAlength = length($modifiedDNA);
print &quot;Modified DNA: $modifiedDNA has length $DNAlength\n&quot;;

#extract the second codon in $modifiedDNA
my $codon = substr($modifiedDNA,3,3);
print &quot;Second codon is $codon\n&quot;;</code>]]></description>
	<dc:creator>Nishi Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/27270/parse-a-genbank-file-using-regular-expressions</guid>
	<pubDate>Tue, 10 May 2016 11:56:26 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/27270/parse-a-genbank-file-using-regular-expressions</link>
	<title><![CDATA[Parse a genbank file using regular expressions]]></title>
	<description><![CDATA[<code>#! /usr/local/bin/perl -w

$genbank = &quot;genbank_file.txt&quot;;

open (GENBANK, $genbank) || die &quot;cannot open $gb_report for reading: $!&quot;;

# Flag for multiline translation; 1 means translation &quot;in progress&quot;  
$trans = 0;

while (&lt;GENBANK&gt;)
{
   if (/(LOCUS\s*)(\w*)(.*)/) { 
       print &quot;Locus: $2\n&quot;; 
   }
   elsif (/(VERSION.*GI:)(\d*)/) { 
      print &quot;GI: $2\n&quot;; 
   }
   elsif (/(DEFINITION\s*)(.*)(\.)/) {
      print &quot;Sequence name: $2\n&quot;;
   }
   elsif (/(ORGANISM\s*)(.*)/) {
      print &quot;Organism: $2\n&quot;;
   }
   elsif(/(gene)(\s*)(\d*)(\.\.)(\d*)/) {
      print &quot;Gene length: $5\n&quot;;
   }
   elsif (/(CDS\s*)(\d*)(\.\.)(\d*)/)  {
   # ex: CDS             357..1541
      $cds_start = $2;
      $cds_end = $4;
      print &quot;CDS: $cds_start - $cds_end\n&quot;;
   }
   elsif (/(\/translation=&quot;)(.*)/)  {  # protein product begins
      print &quot;Translation: &quot;;
      $protein = $2;
      $trans = 1;
   }
   elsif ($trans)  {   # translation still going on
      if (!/&quot;/)  {  # no terminal quote; translation continues
         $protein .= $_;
      }
      elsif (/(.*)(&quot;)/)  {  # terminal quote; end of translation
         $protein .= $1;
         $protein =~ s/\s*//g;
         print &quot;$protein\n&quot;;
         $trans = 0;
      }
      else  {
         print &quot;Problems: end of translation product not found.\n&quot;;
      }
   }
   else  {
      # Skip this data
   }
}</code>]]></description>
	<dc:creator>Nishi Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/27269/check-if-your-coputer-ready-to-use-bioperl</guid>
	<pubDate>Tue, 10 May 2016 11:48:50 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/27269/check-if-your-coputer-ready-to-use-bioperl</link>
	<title><![CDATA[Check if your coputer ready to use BioPerl]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl
use strict;
use warnings;

#bioperl example code
use strict;
use warnings;

#make the bioperl module (class) accessible to your program
use Bio::Seq;

print&quot;ok - ready to use Bio::Seq&quot;;</code>]]></description>
	<dc:creator>Nishi Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/27268/read-lines-from-input-file-%E2%80%93-print-lines-that-match-a-regular-expression</guid>
	<pubDate>Tue, 10 May 2016 11:46:19 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/27268/read-lines-from-input-file-%E2%80%93-print-lines-that-match-a-regular-expression</link>
	<title><![CDATA[Read lines from input file – print lines that match a regular expression]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl
use strict;
use warnings;

my $line;

#read the line-by-line for each line ask if it matches the regex print it if it matches

while($line = &lt;DATA&gt;){
        chomp $line;
        if ($line =~ /^ATG?C*[ATCG]+?A{3,10}$/) {
                print &quot;$line\n&quot;;
        }
}

exit();

__DATA__
ATGCCCAA
ATGCCCAAAA
ATGCCCAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD</code>]]></description>
	<dc:creator>Nishi Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/27267/for-a-given-dna-sequence-find-its-rna-transcript-find-its-reverse-complement-and-check-if-the-reverse-complement-contains-a-start-codon</guid>
	<pubDate>Tue, 10 May 2016 11:42:30 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/27267/for-a-given-dna-sequence-find-its-rna-transcript-find-its-reverse-complement-and-check-if-the-reverse-complement-contains-a-start-codon</link>
	<title><![CDATA[For a given DNA sequence find its RNA transcript, find its reverse complement and check if the reverse complement contains a start codon]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl
use strict;
use warnings;

my $DNA = &quot;GATTACACAT&quot;;

#transcribe DNA to RNA - T changes to U
my $RNA = $DNA;
$RNA =~ s/T/U/g;
print &quot;RNA sequence is $RNA\n&quot;;

#find the reverse complement of $DNA using substitution operator
#first - reverse the sequence
my $rcDNA = reverse($DNA);

$rcDNA =~ s/T/A/g;
$rcDNA =~ s/A/T/g;
$rcDNA =~ s/G/C/g;
$rcDNA =~ s/C/G/g;

print &quot;Reverse complement of $DNA is $rcDNA\n&quot;; #did it work?

#find the reverse complement of $DNA using translation operator
#first - reverse the sequence
$rcDNA = reverse($DNA);
#then - complement the sequence
$rcDNA =~ tr/ACGT/TGCA/;
#then - print the reverse complement
print &quot;Reverse complement of $DNA is $rcDNA\n&quot;;

#look for a start codon in the reverse sequence
if($rcDNA =~ /ATG/){
	print &quot;Start codon found\n&quot;;
}
else{
	print &quot;Start codon not found\n&quot;;
}</code>]]></description>
	<dc:creator>Nishi Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/27266/count-the-frequency-of-base-g-in-a-given-dna-sequence</guid>
	<pubDate>Tue, 10 May 2016 11:38:32 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/27266/count-the-frequency-of-base-g-in-a-given-dna-sequence</link>
	<title><![CDATA[Count the frequency of base G in a given DNA sequence]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl
use strict;
use warnings;

my $DNA = &quot;GATTACACAT&quot;;

#initialize $countG and $currentPos
my $countG = 0;
my $currentPos = 0;

#calculate the length of $DNA
my $DNAlength = length($DNA);

#for each letter in the sequence check if it is the base G
#if &#039;yes&#039; increment $countG
while($currentPos &lt; $DNAlength){
	my $base = substr($DNA,$currentPos,1);
	if($base eq &quot;G&quot;){
		$countG++;
	}
	$currentPos++;
} #end of while loop

#print out the number of Gs
print &quot;There are $countG G bases\n&quot;;</code>]]></description>
	<dc:creator>Nishi Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/27265/concatenate-two-given-sequences-and-find-the-length-of-the-new-sequence-and-also-print-out-the-second-codon-of-the-sequence</guid>
	<pubDate>Tue, 10 May 2016 11:36:27 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/27265/concatenate-two-given-sequences-and-find-the-length-of-the-new-sequence-and-also-print-out-the-second-codon-of-the-sequence</link>
	<title><![CDATA[Concatenate two given sequences, and find the length of the new sequence and also print out the second codon of the sequence]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl
use strict;
use warnings;

#assign strings to variables
my $DNA = &quot;GATTACACAT&quot;;
my $polyA = &quot;AAAA&quot;;

#concatenate two strings
my $modifiedDNA = $DNA.$polyA;

#calculate the length of $modifiedDNA and
#print out the value of the variable and its length
my $DNAlength = length($modifiedDNA);
print &quot;Modified DNA: $modifiedDNA has length $DNAlength\n&quot;;

#extract the second codon in $modifiedDNA
my $codon = substr($modifiedDNA,3,3);
print &quot;Second codon is $codon\n&quot;;</code>]]></description>
	<dc:creator>Nishi Singh</dc:creator>
</item>

</channel>
</rss>