<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Autarchy of the Private Cave &#187; patch</title> <atom:link href="https://bogdan.org.ua/tags/patch/feed" rel="self" type="application/rss+xml" /><link>https://bogdan.org.ua</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Wed, 28 Dec 2022 16:09:04 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=3.8.27</generator> <item><title>How to use mkfifo named pipes with prinseq-lite.pl</title><link>https://bogdan.org.ua/2016/02/24/how-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html</link> <comments>https://bogdan.org.ua/2016/02/24/how-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html#comments</comments> <pubDate>Wed, 24 Feb 2016 11:39:37 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[Bioinformatics]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[FIFO]]></category> <category><![CDATA[gist]]></category> <category><![CDATA[mkfifo]]></category> <category><![CDATA[patch]]></category> <category><![CDATA[prinseq-lite.pl]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2360</guid> <description><![CDATA[prinseq-lite.pl is a utility written in Perl for preprocessing NGS reads, also in FASTQ format. It can read sequences both from files and from stdin (if you only have 1 sequence). I wanted to use it with compressed (gzipped/bzipped2) FASTQ input files. As I do not need to store decompressed input files, the most efficient [&#8230;]]]></description> <content:encoded><![CDATA[<p><img
src="http://bogdan.org.ua/wp-content/uploads/2016/02/prinseq_logo_1.png" alt="prinseq_logo_1" width="204" height="32" class="alignleft size-full wp-image-2361" /><a
href="http://prinseq.sourceforge.net/">prinseq-lite.pl</a> is a utility written in Perl for preprocessing NGS reads, also in <a
href="https://en.wikipedia.org/wiki/FASTQ_format">FASTQ format</a>.<br
/> It can read sequences both from files and from stdin (if you only have 1 sequence).</p><p>I wanted to use it with compressed (gzipped/bzipped2) FASTQ input files.<br
/> As I do not need to store decompressed input files, the most efficient solution is to use pipes.<br
/> This works well for a single file, but not for 2 files (paired-end reads).</p><p>For 2 files, <a
href="https://en.wikipedia.org/wiki/Named_pipe">named pipes</a> (also known as <a
href="https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics)">FIFO</a>s) can be used.<br
/> You can create a named pipe in Linux with the help of <code>mkfifo</code> command, for example <code>mkfifo R1_decompressed.fastq</code>.<br
/> To use it, start decompressing something into it (either in a different terminal, or in background), for example <code>zcat R1.fastq.gz > R1_decompressed.fastq &#038;</code>;<br
/> we can call this a writing/generating process, because it writes into a pipe.<br
/> (If you are writing software to use named pipes, any processes writing into them should be started in a new thread, as they will block until all the data is consumed.)<br
/> Now if you give the R1_decompressed.fastq as a file argument to some other program, it will see decompressed content (e.g. <code>wc -l R1_decompressed.fastq</code> will tell you the number of lines in the decompressed file); we can call program reading from the named pipe a reading/consuming process.<br
/> As soon as a consuming process had consumed (read) all of the data, the writing/generating process will finally exit.</p><p>This, however, does not work with prinseq-lite.pl (version 0.20.4 or earlier), with a <strong>broken pipe</strong> error.<span
id="more-2360"></span></p><p>Named pipes are very similar to usual files, with two <strong>major differences</strong>:</p><ul><li>named pipes are <strong>not seekable</strong>: you cannot move file pointer (at least not backwards, not sure about skipping forward);</li><li>you <strong>cannot</strong> arbitrarily close/<strong>re-open</strong> a named pipe from the consuming end: closing a pipe on the consuming end also closes it for the writing/generating process.</li></ul><p>The reason why prinseq-lite.pl does not work with named pipes is that it performs file format checking first &#8211; by opening the file, reading the first 3 lines, and closing it.<br
/> Closing a named pipe causes <strong>broken pipe</strong> for the writing process, and when prinseq-lite.pl attempts to open the pipe again &#8211; it succeeds, but there is no data there anymore, so it just sits and waits for data <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p><p>I&#8217;m ok with a quick and dirty solution, so here it is: <a
href="https://gist.github.com/spock/7d4e46e1158e2e4a46d4">prinseq-lite.pl patch to enable mkfifo named pipes as input files</a> (also local <a
href="http://bogdan.org.ua/wp-content/uploads/2016/02/prinseq-lite.pl_.patch_.txt">prinseq-lite.pl.patch</a>).<br
/> <strong>WARNING</strong>: this patch simply disables file format checking!</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F24%2Fhow-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html&amp;linkname=How%20to%20use%20mkfifo%20named%20pipes%20with%20prinseq-lite.pl" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F24%2Fhow-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html&amp;linkname=How%20to%20use%20mkfifo%20named%20pipes%20with%20prinseq-lite.pl" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F24%2Fhow-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html&amp;linkname=How%20to%20use%20mkfifo%20named%20pipes%20with%20prinseq-lite.pl" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F24%2Fhow-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html&amp;linkname=How%20to%20use%20mkfifo%20named%20pipes%20with%20prinseq-lite.pl" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F24%2Fhow-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html&amp;linkname=How%20to%20use%20mkfifo%20named%20pipes%20with%20prinseq-lite.pl" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F24%2Fhow-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html&#038;title=How%20to%20use%20mkfifo%20named%20pipes%20with%20prinseq-lite.pl" data-a2a-url="https://bogdan.org.ua/2016/02/24/how-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html" data-a2a-title="How to use mkfifo named pipes with prinseq-lite.pl"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2016/02/24/how-to-use-mkfifo-named-pipes-with-prinseq-lite-pl.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Simple and efficient Drupal upgrades: patch!</title><link>https://bogdan.org.ua/2010/01/03/simple-efficient-drupal-upgrades-patch.html</link> <comments>https://bogdan.org.ua/2010/01/03/simple-efficient-drupal-upgrades-patch.html#comments</comments> <pubDate>Sun, 03 Jan 2010 13:50:37 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Drupal]]></category> <category><![CDATA[Links]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[drupal]]></category> <category><![CDATA[patch]]></category> <category><![CDATA[upgrade]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=953</guid> <description><![CDATA[Just a quick note: upgrading Drupal using a patch file is a really efficient and fast method, especially because diff/patch files are available for different Drupal version combinations.]]></description> <content:encoded><![CDATA[<p>Just a quick note: <a
href="http://drupal.org/node/359234" class="broken_link" rel="nofollow">upgrading Drupal using a patch file</a> is a really efficient and fast method, especially because <a
href="http://fuerstnet.de/en/drupal-upgrade-easier">diff/patch files are available</a> for different Drupal version combinations.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F03%2Fsimple-efficient-drupal-upgrades-patch.html&amp;linkname=Simple%20and%20efficient%20Drupal%20upgrades%3A%20patch%21" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F03%2Fsimple-efficient-drupal-upgrades-patch.html&amp;linkname=Simple%20and%20efficient%20Drupal%20upgrades%3A%20patch%21" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F03%2Fsimple-efficient-drupal-upgrades-patch.html&amp;linkname=Simple%20and%20efficient%20Drupal%20upgrades%3A%20patch%21" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F03%2Fsimple-efficient-drupal-upgrades-patch.html&amp;linkname=Simple%20and%20efficient%20Drupal%20upgrades%3A%20patch%21" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F03%2Fsimple-efficient-drupal-upgrades-patch.html&amp;linkname=Simple%20and%20efficient%20Drupal%20upgrades%3A%20patch%21" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F03%2Fsimple-efficient-drupal-upgrades-patch.html&#038;title=Simple%20and%20efficient%20Drupal%20upgrades%3A%20patch%21" data-a2a-url="https://bogdan.org.ua/2010/01/03/simple-efficient-drupal-upgrades-patch.html" data-a2a-title="Simple and efficient Drupal upgrades: patch!"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2010/01/03/simple-efficient-drupal-upgrades-patch.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>