<?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/34791?offset=20</link>
	<atom:link href="https://bioinformaticsonline.com/related/34791?offset=20" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/898/ruby-language</guid>
	<pubDate>Mon, 15 Jul 2013 01:34:26 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/898/ruby-language</link>
	<title><![CDATA[Ruby Language]]></title>
	<description><![CDATA[<p>Ruby was created by Yukihiro Matsumoto, who wished to create a new language that balanced functional programming with imperative programming</p><p>Ruby is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Matz" Matsumoto. It was influenced primarily by Perl, Smalltalk, Eiffel, and Lisp.</p><p>Ruby supports multiple programming paradigms, including functional, object oriented, imperative and reflective. It also has a dynamic typesystem and automatic memory management; it is therefore similar in varying respects to Python, Perl, Lisp, Dylan, Pike, and CLU.</p><p>The standard 1.8.7 implementation is written in C, as a single-pass interpreted language. There is currently no specification of the Ruby language, so the original implementation is considered to be the de facto reference. As of 2010, there are a number of complete or upcoming alternative implementations of the Ruby language, including YARV, JRuby, Rubinius, IronRuby, MacRuby and HotRuby, each of which takes a different approach, with IronRuby, JRuby and MacRuby providing just-in-time compilation and MacRuby also providing ahead-of-time compilation. The official 1.9 branch uses YARV, as will 2.0 (development), and will eventually supersede the slower Ruby MRI.</p><p>Ruby Quick Reference<br />http://www.zenspider.com/Languages/Ruby/QuickRef.html</p><p>Ruby Annotation<br />http://www.w3.org/TR/ruby/</p><p>Ruby in Linux Journals<br />http://www.linuxjournal.com/article/5915</p><p>Ruby Documentation: Programming Ruby<br />http://ruby-doc.org/docs/ProgrammingRuby/</p><p>The Top 10 Reasons The Ruby Programming Language Sucks</p><p>http://www.slideshare.net/vishnu/the-top-10-reasons-the-ruby-programming-language-sucks</p><p>Ruby : The Programmers best friends<br />http://www.ruby-lang.org/en/</p><p>For Ruby Beginners<br />http://www.squidoo.com/ruby-programming-beginner</p><p>Ruby Programming<br />http://en.wikibooks.org/wiki/Ruby_Programming</p><p>Ruby CookBook<br />http://en.wikibooks.org/wiki/Cookbook:Table_of_Contents</p><p>Ruby Programming Challenge for Newbies -<br />http://rubylearning.com/blog/ruby-programming-challenge-faq/</p><p>Common "issues" faced by Ruby Newbies by Chris Strom -<br />http://japhr.blogspot.com/2009/10/newbie-feedback.html</p><p>Books<br />http://www.sapphiresteel.com/The-Book-Of-Ruby</p><p>Free Online Ruby Programming along with many Ruby newbies here -<br />http://rubylearning.org/class/</p>]]></description>
	<dc:creator>Jitendra Narayan</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/21703/coding-ground</guid>
	<pubDate>Tue, 17 Mar 2015 00:47:20 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/21703/coding-ground</link>
	<title><![CDATA[Coding Ground]]></title>
	<description><![CDATA[<p>Online coding group for most of the programming languages.</p>
<p>Code in almost all popular languages using Coding Ground.&nbsp;Edit, compile, execute and share your projects, 100% cloud.</p>
<p>http://www.tutorialspoint.com/codingground.htm</p><p>Address of the bookmark: <a href="http://www.tutorialspoint.com/codingground.htm" rel="nofollow">http://www.tutorialspoint.com/codingground.htm</a></p>]]></description>
	<dc:creator>Jitendra Narayan</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/37590/parallel-processing-with-perl</guid>
	<pubDate>Sat, 25 Aug 2018 11:32:40 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/37590/parallel-processing-with-perl</link>
	<title><![CDATA[Parallel Processing with Perl !]]></title>
	<description><![CDATA[<p>Here is a small tutorial on how to make best use of multiple processors for bioinformatics analysis. One best way is using perl threads and forks. Knowing how these threads and forks work is very important before implementing them. Getting to know how these work would be really useful before reading this tutorial.</p><p>Many times in bioinformatics we need to deal with huge datasets which&nbsp; are more than 100GB size. The traditional way to analysis a file is using the while loop</p><p>while (FILE){</p><p>Do something;</p><p>}</p><p>This is very slow(since we are using only one processor) and if we have 500 million lines in the dataset it takes more than a day to iterate through the whole dataset. So how do we make best use of all our processors and get the work done quickly?</p><p>Here is a very simple and efficient technique with perl which i have been using. I am&nbsp; more inclined towards using perl fork than perl threads.</p><p>One of the oldest way to fork is</p><blockquote><p>my $fork = fork();<br />if($fork){&nbsp;&nbsp;&nbsp;<br />push (@childs,$fork);&nbsp;<br />}<br />elseif($fork==0){<br /><strong>your code here;</strong><br />exit(0);<br />}<br />else{die &ldquo;Couldnt fork : $!&rdquo;;}</p><p>## wait for the child process to finish<br />foreach(@childs){<br />my $tmp=waitid($_,0);<br />}</p></blockquote><p>what a fork does is it creates a child process and takes the variables and code with it to analyze it separately (detached from the parent process) and thus a separate process is created( which usually runs on a separate processor). Thats it!! One big disadvantage of forking is its very difficult to share variables among the different processes. I will show you how to do it easily but still it has its own drawbacks.</p><blockquote><p>Okie, now if you really do not want to use fork in your code, that&rsquo;s okie too..There are many useful modules which do it for you very efficiently. One really useful module is Parallel::ForkManager. You can use Parallel::ForkManager to manage the number of forks you want to generate (number of processors you want to use).</p><p><strong>Simple usage:</strong><br />use Parallel::ForkManager;<br />my $max_processors=8;<br />my $fork= new Parallel::ForkManager($max_processors);<br />foreach (@dna) {<br />$fork-&gt;start and next; # do the fork<br /><strong>you code here;</strong><br />$fork-&gt;finish; # do the exit in the child process<br />}<br />$pm-&gt;wait_all_children;</p></blockquote><p>so you will be generating 8 forks which do the same thing for your each element of array. when one child finishes, Parallel::ForkManager generates a new one and thus you will be using all your processors to analyze the data. Now, if you have generated 8 child processes and want to write the data to one file. You need to lock the file to do this, because you will have problems with the buffering. You can lock the file using flock command.</p><blockquote><p>open (my $QUAL, &ldquo;myfile.txt&rdquo;);<br />flock $QUAL, LOCK_EX or die &ldquo;cant lock file $!&rdquo;;<br />print $QUAL &ldquo;$output&rdquo;;<br />flock $QUAL, LOCK_UN or die &ldquo;$!&rdquo;;<br />close $QUAL;</p></blockquote><p>I would not suggest using flock when dealing with multiple processes because it will decrease the processing efficiency( each child process must wait for the lock to be released by the other child process). Instead, I would suggest each fork writing to a separate file and after the processing just concatenating them.</p><p><strong>Putting it all together, If you have 100GB data you can do this</strong></p><blockquote><p><strong>step 1</strong>&nbsp;: split the dataset equally according to number of processors you have. this may take a few hours(about 2-3 hrs for 100GB file)<br />You can use unix &ldquo;split&rdquo; command for this<br />for example:<br />my $number_split=int($number_of_entries_in_your_dataset/$max_processors);<br />my $split_Files=`split -l $number_split &ldquo;your_file.fasta&rdquo; &ldquo;file_name&rdquo;`;</p><p><strong>step2</strong>: open you directory comtaining you split files and start Parallel::ForkManager.<br /><strong>For example:</strong><br />opendir(DIRECTORY, $split_files_directory) or die $!; ### open the directory<br />my $fork= new Parallel::ForkManager($max_processors);<br />while (my $file = readdir(DIRECTORY)) { ### read the directory<br />if($file=~/^\./){next;}<br />print $file,&rdquo;\n&rdquo;;<br />########## Start fork ##########<br />my $pid= $super_fork-&gt;start and next;<br /><strong>Whatever you want to do with the split file ;</strong><br /><strong>analyze my piece of $file;</strong><br />######### end fork ###############<br />$super_fork-&gt;finish;<br />}<br />$super_fork-&gt;wait_all_children;</p></blockquote><p>So basically each processor will be active with its piece of data (split file) and thus you have created 8 processes at one time which run without interfering with the other process. I again will not suggest writing output from each child process to one file(for reasons above). Write output from each fork to a separate file and finally concatenate them. Thats it, you have just increased your program speed by 8 times!! Isnt it easy?</p><p><strong>Note:</strong><br />You may worry about concatenation of the output each child generates, since it does take some time(remember 100GB). I think now you can use a mysql database LOAD DATA LOCAL INFILE command to load all the files into a single table(Should take about 3hrs for 100Gb dataset) and then export the whole table into one file. This should be faster than just concatenating them using &ldquo;cat&rdquo; command.(correct me if I am wrong)</p><p>Or much simpler way is to use pipes</p><p>cat output_dir/* | my_pipe or my_pipe &lt;(file1) final_file;</p><p>Thats it guys!! Enjoy programming and please do comment. I am not a computer scientist so forgive me for any mistakes and if any please report them. Thank you.</p>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/40583/trelliscope-flexibly-visualize-large-complex-data-in-great-detail-from-within-the-r-statistical-programming-environment</guid>
	<pubDate>Tue, 21 Jan 2020 04:22:49 -0600</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/40583/trelliscope-flexibly-visualize-large-complex-data-in-great-detail-from-within-the-r-statistical-programming-environment</link>
	<title><![CDATA[Trelliscope: flexibly visualize large, complex data in great detail from within the R statistical programming environment.]]></title>
	<description><![CDATA[<p>Trelliscope provides a way to flexibly visualize large, complex data in great detail from within the R statistical programming environment. Trelliscope is a component in the<span>&nbsp;</span><a href="http://deltarho.org/docs-trelliscope/deltarho.org">DeltaRho</a><span>&nbsp;</span>environment.</p>
<p>For those familiar with<span>&nbsp;</span><a href="http://cm.bell-labs.com/cm/ms/departments/sia/project/trellis/">Trellis Display</a>,<span>&nbsp;</span><a href="http://docs.ggplot2.org/0.9.3.1/facet_wrap.html">faceting in ggplot</a>, or the notion of<span>&nbsp;</span><a href="http://en.wikipedia.org/wiki/Small_multiple">small multiples</a>, Trelliscope provides a scalable way to break a set of data into pieces, apply a plot method to each piece, and then arrange those plots in a grid and interactively sort, filter, and query panels of the display based on metrics of interest. With Trelliscope, we are able to create multipanel displays on data with a very large number of subsets and view them in an interactive and meaningful way.</p><p>Address of the bookmark: <a href="http://deltarho.org/docs-trelliscope/#introduction" rel="nofollow">http://deltarho.org/docs-trelliscope/#introduction</a></p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>