<?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: Related items]]></title>
	<link>https://bioinformaticsonline.com/related/428?</link>
	<atom:link href="https://bioinformaticsonline.com/related/428?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/11181/perl-one-liner-for-bioinformatician</guid>
	<pubDate>Fri, 30 May 2014 05:49:07 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/11181/perl-one-liner-for-bioinformatician</link>
	<title><![CDATA[Perl one-liner for bioinformatician !!!]]></title>
	<description><![CDATA[<p>With the emergence of NGS technologies, and sequencing data most of the bioinformaticians mung and wrangle around massive amounts of genomics text. There are several "standardized" file formats (FASTQ, SAM, VCF, etc.) and some tools for manipulating them (fastx toolkit, samtools, vcftools, etc.), there are still times where knowing a little bit of Perl onliner is extremely helpful.</p><p>Perl one-liners are small and awesome Perl programs that fit in a single line of code and they do one thing really well. These things include changing line spacing, numbering lines, doing calculations, converting and substituting text, deleting and printing certain lines, parsing logs, editing files in-place, doing statistics, carrying out system administration tasks, updating a bunch of files at once, and many more. Perl one-liners will make you the shell warrior. Anything that took you minutes to solve, will now take you seconds!<br /><br />perl -pe '$\="\n"'&nbsp; &nbsp;<br />#double space a file<br /><br />perl -pe '$_ .= "\n" unless /^$/' <br />#double space a file except blank lines<br /><br />perl -pe '$_.="\n"x7' <br />#7 space in a line.<br /><br />perl -ne 'print unless /^$/' <br />#remove all blank lines<br /><br />perl -lne 'print if length($_) &lt; 20' <br />#print all lines with length less than 20.<br /><br />perl -00 -pe '' <br />#If there are multiple spaces, delete all leaving one(make the file a single spaced file).<br /><br />perl -00 -pe '$_.="\n"x4' <br />#Expand single blank lines into 4 consecutive blank lines<br /><br />perl -pe '$_ = "$. $_"'<br />#Number all lines in a file<br /><br />perl -pe '$_ = ++$a." $_" if /./' <br />#Number only non-empty lines in a file<br /><br />perl -ne 'print ++$a." $_" if /./' <br />#Number and print only non-empty lines in a file<br /><br />perl -pe '$_ = ++$a." $_" if /regex/' <br />#Number only lines that match a pattern<br /><br />perl -ne 'print ++$a." $_" if /regex/' <br />#Number and print only lines that match a pattern<br /><br />perl -ne 'printf "%-5d %s", $., $_ if /regex/' <br />#Left align lines with 5 white spaces if matches a pattern (perl -ne 'printf "%-5d %s", $., $_' : for all the lines)<br /><br />perl -le 'print scalar(grep{/./}&lt;&gt;)' <br />#prints the total number of non-empty lines in a file<br /><br />perl -lne '$a++ if /regex/; END {print $a+0}' <br />#print the total number of lines that matches the pattern<br /><br />perl -alne 'print scalar @F' <br />#print the total number fields(words) in each line.<br /><br />perl -alne '$t += @F; END { print $t}' <br />#Find total number of words in the file<br /><br />perl -alne 'map { /regex/ &amp;&amp; $t++ } @F; END { print $t }' <br />#find total number of fields that match the pattern<br /><br />perl -lne '/regex/ &amp;&amp; $t++; END { print $t }' <br />#Find total number of lines that match a pattern<br /><br />perl -le '$n = 20; $m = 35; ($m,$n) = ($n,$m%$n) while $n; print $m' <br />#will calculate the GCD of two numbers.<br /><br />perl -le '$a = $n = 20; $b = $m = 35; ($m,$n) = ($n,$m%$n) while $n; print $a*$b/$m' <br />#will calculate lcd of 20 and 35.<br /><br />perl -le '$n=10; $min=5; $max=15; $, = " "; print map { int(rand($max-$min))+$min } 1..$n' <br />#Generates 10 random numbers between 5 and 15.<br /><br />perl -le 'print map { ("a".."z",&rdquo;0&rdquo;..&rdquo;9&rdquo;)[rand 36] } 1..8'<br />#Generates a 8 character password from a to z and number 0 &ndash; 9.<br /><br />perl -le 'print map { ("a",&rdquo;t&rdquo;,&rdquo;g&rdquo;,&rdquo;c&rdquo;)[rand 4] } 1..20'<br />#Generates a 20 nucleotide long random residue.<br /><br />perl -le 'print "a"x50'<br />#generate a string of &lsquo;x&rsquo; 50 character long<br /><br />perl -le 'print join ", ", map { ord } split //, "hello world"'<br />#Will print the ascii value of the string hello world.<br /><br />perl -le '@ascii = (99, 111, 100, 105, 110, 103); print pack("C*", @ascii)'<br />#converts ascii values into character strings.<br /><br />perl -le '@odd = grep {$_ % 2 == 1} 1..100; print "@odd"'<br />#Generates an array of odd numbers.<br /><br />perl -le '@even = grep {$_ % 2 == 0} 1..100; print "@even"'<br />#Generate an array of even numbers<br /><br />perl -lpe 'y/A-Za-z/N-ZA-Mn-za-m/' file <br />#Convert the entire file into 13 characters offset(ROT13)<br /><br />perl -nle 'print uc' <br />#Convert all text to uppercase:<br /><br />perl -nle 'print lc' <br />#Convert text to lowercase:<br /><br />perl -nle 'print ucfirst lc' <br />#Convert only first letter of first word to uppercas<br /><br />perl -ple 'y/A-Za-z/a-zA-Z/' <br />#Convert upper case to lower case and vice versa<br /><br />perl -ple 's/(\w+)/\u$1/g' <br />#Camel Casing<br /><br />perl -pe 's|\n|\r\n|' <br />#Convert unix new lines into DOS new lines:<br /><br />perl -pe 's|\r\n|\n|' <br />#Convert DOS newlines into unix new line<br /><br />perl -pe 's|\n|\r|' <br />#Convert unix newlines into MAC newlines:<br /><br />perl -pe '/regexp/ &amp;&amp; s/foo/bar/' <br />#Substitute a foo with a bar in a line with a regexp.</p><p>Reference/Sources:</p><p>http://genomics-array.blogspot.in/2010/11/some-unixperl-oneliners-for.html</p><p><a href="http://genomespot.blogspot.com/2013/08/a-selection-of-useful-bash-one-liners.html">http://genomespot.blogspot.com/2013/08/a-selection-of-useful-bash-one-liners.html</a></p><p><a href="http://biowize.wordpress.com/2012/06/15/command-line-magic-for-your-gene-annotations/">http://biowize.wordpress.com/2012/06/15/command-line-magic-for-your-gene-annotations/</a></p><p><a href="http://genomics-array.blogspot.com/2010/11/some-unixperl-oneliners-for.html">http://genomics-array.blogspot.com/2010/11/some-unixperl-oneliners-for.html</a></p><p><a href="http://bioexpressblog.wordpress.com/2013/04/05/split-multi-fasta-sequence-file/">http://bioexpressblog.wordpress.com/2013/04/05/split-multi-fasta-sequence-file/</a></p>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/22571/pattern-matching-problem-solution-with-perl</guid>
	<pubDate>Tue, 09 Jun 2015 23:58:45 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/22571/pattern-matching-problem-solution-with-perl</link>
	<title><![CDATA[Pattern Matching Problem Solution with Perl]]></title>
	<description><![CDATA[<p>Problem at http://rosalind.info/problems/1c/</p><p>#Find all occurrences of a pattern in a string.<br />#Given: Strings Pattern and Genome.<br />#Return: All starting positions in Genome where Pattern appears as a substring. Use 0-based indexing.<br /><br />use strict;<br />use warnings;<br /><br />my $string="GATATATGCATATACTT";<br />my $subStr="ATAT";<br />my $kmer=length($subStr);<br /><br />kmerMatch ($string, $subStr, $kmer);<br /><br />sub kmerMatch { #Check the exact matching kmers with sliding window<br />my ($string, $myStr, $kmer)=@_;<br />for (my $aa=0; $aa&lt;=(length($string)-$kmer); $aa++) {<br />&nbsp;&nbsp;&nbsp; my $myWin=substr&nbsp; $string, $aa,$kmer;<br />&nbsp;&nbsp;&nbsp; if ($myWin eq $myStr) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #print "$myWin eq $myStr\n";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print $aa;<br />&nbsp;&nbsp;&nbsp; }<br />}<br />}</p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/22961/bioscripts</guid>
	<pubDate>Sun, 28 Jun 2015 07:46:14 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/22961/bioscripts</link>
	<title><![CDATA[BioScripts]]></title>
	<description><![CDATA[<p>You are requested to please bookmark collection of bioinformatics tools, scripts, codes that can be pieced together in a very easy and flexible manner to perform both simple and complex bioinformatics tasks.</p>
<p>The next-generation sequencing included whole genome sequencing(WGS), transcriptome sequencing (whole cDNA sequencing, RNA-seq), digital gene expression sequencing (Tag-Seq), ChIP-Seq, and so on. And there are many sequencing platform to generate sequece, as well know Sanger/ABi(the frist generation), Solexa/illumina, SOLiD/ABi, 454/Roche. But thier sequence format is different, also they have different error type. High quality data is very important for further analysis or data mining. There are many pipeline for raw sequence quality analysis and control with few of process for reporting reads quality statistical details, trimming, filtering, and error correction. Please bookmarks them for the benefits of bioinformatics community.</p>
<p>https://code.google.com/p/biowiki/</p>
<p>https://code.google.com/p/ngs-pipeline/source/browse/#svn%2Ftrunk</p>
<p>NGSand Perl scripts https://code.google.com/hosting/search?q=NGS+perl&amp;projectsearch=Search+projects</p>
<p>NGS and Python scripts https://code.google.com/hosting/search?q=NGS+Python&amp;projectsearch=Search+projects</p><p>Address of the bookmark: <a href="https://code.google.com/hosting/search?q=bioinformatics&amp;sa=Search" rel="nofollow">https://code.google.com/hosting/search?q=bioinformatics&amp;sa=Search</a></p>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/20471/bioinformatics-scripts</guid>
	<pubDate>Thu, 22 Jan 2015 22:29:39 -0600</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/20471/bioinformatics-scripts</link>
	<title><![CDATA[Bioinformatics Scripts]]></title>
	<description><![CDATA[<p>Some of the useful bioinformatics scripts.</p>
<p>For example ... contig-stats.pl is a Perl script that will automatically describe features of a sequence assembly.</p>
<p>http://milkweedgenome.org/?q=scripts</p><p>Address of the bookmark: <a href="http://milkweedgenome.org/?q=scripts" rel="nofollow">http://milkweedgenome.org/?q=scripts</a></p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/22388/perl-one-liner-basics</guid>
	<pubDate>Sun, 24 May 2015 09:28:33 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/22388/perl-one-liner-basics</link>
	<title><![CDATA[Perl One liner basics !!]]></title>
	<description><![CDATA[<p>Perl has a ton of command line switches (see perldoc perlrun), but I'm just going to cover the ones you'll commonly need to debug code. The most important switch is -e, for execute (or maybe "engage" :) ). The -e switch takes a quoted string of Perl code and executes it. For example:<br /><br />$ perl -e 'print "Hello, World!\n"'<br />Hello, World!<br /><br />It's important that you use single-quotes to quote the code for -e. This usually means you can't use single-quotes within the one liner code. If you're using Windows cmd.exe or PowerShell, you must use double-quotes instead.<br /><br />I'm always forgetting what Perl's predefined special variables do, and often test them at the command line with a one liner to see what they contain. For instance do you remember what $^O is?<br /><br />$ perl -e 'print "$^O\n"'<br />linux<br /><br />It's the operating system name. With that cleared up, let's see what else we can do. If you're using a relatively new Perl (5.10.0 or higher) you can use the -E switch instead of -e. This turns on some of Perl's newer features, like say, which prints a string and appends a newline to it. This saves typing and makes the code cleaner:<br /><br />$ perl -E 'say "$^O"'<br />linux<br /><br />Pretty handy! say is a nifty feature that you'll use again and again.</p>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/22570/frequent-words-problem-solution-by-perl</guid>
	<pubDate>Tue, 09 Jun 2015 23:38:44 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/22570/frequent-words-problem-solution-by-perl</link>
	<title><![CDATA[Frequent words problem solution by Perl]]></title>
	<description><![CDATA[<div><p>Solved with perl <a href="http://rosalind.info/problems/1a/">http://rosalind.info/problems/1a/</a></p><p>#Find the most frequent k-mers in a string.<br />#Given: A DNA string Text and an integer k.<br />#Return: All most frequent k-mers in Text (in any order).<br /><br />use strict;<br />use warnings;<br /><br />my $string="ACGTTGCATGTCGCATGATGCATGAGAGCT";<br />my $kmer=4; <br />my %myHash;<br />my $max=0;<br /><br />for (my $aa=0; $aa&lt;=(length($string)-4); $aa++) {<br />&nbsp;&nbsp; &nbsp;my $myStr=substr&nbsp; $string, $aa,$kmer;<br />&nbsp;&nbsp; &nbsp;#print "$myStr\n";<br />&nbsp;&nbsp; &nbsp;my $km=kmerMatch ($string, $myStr, $kmer);<br />&nbsp;&nbsp; &nbsp;if ($km &gt; $max) { $max = $km;}<br />&nbsp;&nbsp; &nbsp;#print "$km\t$myStr\n";<br />&nbsp;&nbsp; &nbsp;$myHash{$myStr}=$km;<br />&nbsp;&nbsp; &nbsp;<br />}<br /><br />#Print all key which have matching values<br />foreach my $name (keys %myHash){<br />&nbsp;&nbsp;&nbsp; print "$name " if $myHash{$name} == $max;<br />}<br /><br />sub kmerMatch { #Check the exact matching kmers with sliding window<br />my ($string, $myStr, $kmer)=@_;<br />my $count=0;<br />for (my $aa=0; $aa&lt;=(length($string)-4); $aa++) {<br />&nbsp;&nbsp; &nbsp;my $myWin=substr&nbsp; $string, $aa,$kmer;<br />&nbsp;&nbsp; &nbsp;if ($myWin eq $myStr) {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;#print "$myWin eq $myStr\n";<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$count++;<br />&nbsp;&nbsp; &nbsp;}<br />}<br />return $count;<br />}</p></div>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/22572/clump-finding-problem-solved-with-perl</guid>
	<pubDate>Wed, 10 Jun 2015 00:17:17 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/22572/clump-finding-problem-solved-with-perl</link>
	<title><![CDATA[Clump Finding Problem Solved with Perl]]></title>
	<description><![CDATA[<p>The question at http://rosalind.info/problems/1d/</p><p>Script are moved to&nbsp;http://bioinformaticsonline.com/snippets/view/34633/clump-finding-problem-solved-with-perl</p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/19792/irishgrid-irish-grid-mapping-system</guid>
	<pubDate>Fri, 26 Dec 2014 07:53:24 -0600</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/19792/irishgrid-irish-grid-mapping-system</link>
	<title><![CDATA[irishgrid: Irish Grid Mapping System]]></title>
	<description><![CDATA[<p>Perl module for creating geographic 10km-square maps using either SVG or PNG (with GD library) output format.</p>
<p>Originally design to map the location of objects in a 10 km map IrishGrid includes:</p>
<ul>
<li>native support of the Irish Grid System (see <a href="http://www.osi.ie/">http://www.osi.ie/</a>)</li>
<li>optimize for speed (there's as less as possible data to conversion)</li>
<li>customized color functions</li>
</ul>
<p>https://code.google.com/p/irishgrid/downloads/detail?name=irishgrid.pl</p><p>Address of the bookmark: <a href="https://code.google.com/p/irishgrid/" rel="nofollow">https://code.google.com/p/irishgrid/</a></p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/22569/reverse-complement-problem-solved-with-perl</guid>
	<pubDate>Tue, 09 Jun 2015 23:37:23 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/22569/reverse-complement-problem-solved-with-perl</link>
	<title><![CDATA[Reverse Complement Problem Solved with Perl]]></title>
	<description><![CDATA[<p>Question at http://rosalind.info/problems/1b/</p><p>#Find the reverse complement of a DNA string.<br />#Given: A DNA string Pattern.<br />#Return: Pattern, the reverse complement of Pattern.<br /><br />use strict;<br />use warnings;<br /><br />my $string="AAAACCCGGT";<br />my $finalString="";<br />my %hash = (<br />&nbsp;&nbsp; &nbsp;"C" =&gt; "G", <br />&nbsp;&nbsp; &nbsp;"A" =&gt; "T", <br />&nbsp;&nbsp; &nbsp;"T" =&gt; "A", <br />&nbsp;&nbsp; &nbsp;"G" =&gt; "C",<br />);<br /><br />for (my $aa=0; $aa&lt;=(length($string)-1); $aa++) {<br />&nbsp;&nbsp; &nbsp;my $char=substr $string, $aa, 1;<br />&nbsp;&nbsp; &nbsp;#print $hash{$char};<br />&nbsp;&nbsp; &nbsp;$finalString="$hash{$char}"."$finalString";<br />}<br /><br />print $finalString;<br />print "\n";</p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/22567/rosalind-problem-solution-with-perl</guid>
	<pubDate>Tue, 09 Jun 2015 23:35:18 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/22567/rosalind-problem-solution-with-perl</link>
	<title><![CDATA[Rosalind Problem Solution with Perl]]></title>
	<description><![CDATA[<p>Rosalind is a platform for learning bioinformatics and programming through problem solving. <a href="http://rosalind.info/problems/list-view/?location=bioinformatics-textbook-track">Take a tour</a> to get the hang of how Rosalind works.</p><p>Bioinformatics Textbook Track</p><p>Find more about Rosalind puzzle at http://rosalind.info/problems/list-view/?location=bioinformatics-textbook-track</p><p>I will provide solution of all the Rosalind problem with Perl for community.</p><p>Check out the right sidebar for more links ...</p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>