<?xml version="1.0" encoding="iso-8859-1"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>MedWorm Tags: bash</title>
        <description>MedWorm provides a medical RSS filtering service. Over 6000 RSS medical sources are combined and output via different filters. This feed contains the latest medical blog items that have been tagged with 'bash'.</description>
        <link><![CDATA[http://www.medworm.com/rss/search.php?qu=%22bash%22&t=%22bash%22&r=Exact&o=d&f=tag]]></link>
        <lastBuildDate>Sat, 03 Sep 2011 03:00:03 +0100</lastBuildDate>
        <item>
            <title>Fixing aberrant files using R and the shell: a case study</title>
            <link>http://www.medworm.com/index.php?rid=4693447&amp;cid=t_162830_132_f&amp;fid=35006&amp;url=http%3A%2F%2Fnsaunders.wordpress.com%2F2011%2F04%2F08%2Ffixing-aberrant-files-using-r-and-the-shell%2F</link>
            <description>Once in a while, you embark on what looks like a simple computational procedure only to encounter frustration very early on. &amp;#8220;I can&amp;#8217;t even read my file into R!&amp;#8221; you cry.
Step back, take a deep breath and take note of what the software is trying to tell you. Most times, you&amp;#8217;ve just missed something very straightforward. Here&amp;#8217;s an example.

Recently, I was trying to retrieve some data describing characteristics of microbial genomes from the NCBI FTP site. The file, lproks_0.txt (direct link), looked like a regular tab-delimited file with a couple of header lines:

head lproks_0.txt
## Microbial Organism Information Page
## Columns:	&amp;quot;RefSeq project ID&amp;quot;	&amp;quot;Project ID&amp;quot;	&amp;quot;Taxonomy ID&amp;quot;	&amp;quot;Organism Name&amp;quot;	&amp;quot;Super Kingdom&amp;quot;	&amp;qu...</description>
            <author>What You're Doing Is Rather Desperate</author>
            <type>blogs</type>
        <comments>http://www.medworm.com/rss/comments.php?id=4693447</comments>
            <pubDate>Fri, 08 Apr 2011 04:41:37 +0100</pubDate>
            <guid isPermaLink="false">4693447</guid>        </item>
        <item>
            <title>Dropbox tip continued: convert a file tree to HTML</title>
            <link>http://www.medworm.com/index.php?rid=4168128&amp;cid=t_162830_132_f&amp;fid=35006&amp;url=http%3A%2F%2Fnsaunders.wordpress.com%2F2010%2F11%2F16%2Fdropbox-tip-continued-convert-a-file-tree-to-html%2F</link>
            <description>A couple of posts ago, I outlined a small bash script to generate an index.html file, containing links to other files in a directory. This was for generating links to files in a Dropbox public directory.
I had completely forgotten about the very useful UNIX/Linux command named tree. If not installed, it should be in your distribution repository (e.g. sudo apt-get install tree for Ubuntu/Debian). Then simply:

cd Dropbox/Public/mydirectory
tree -H . &amp;gt; index.html




Next, navigate to index.html at the Dropbox website and you should see something like the tree on the right. It&amp;#8217;s a little ugly and obviously, not as convenient as something like Github, but can be a good quick and dirty fix if you need to share a hierarchy of directories and files.






Filed under: computing, linux, ...</description>
            <author>What You're Doing Is Rather Desperate</author>
            <type>blogs</type>
        <comments>http://www.medworm.com/rss/comments.php?id=4168128</comments>
            <pubDate>Tue, 16 Nov 2010 02:29:37 +0100</pubDate>
            <guid isPermaLink="false">4168128</guid>        </item>
        <item>
            <title>A quick Bash tip: add an index.html file to a Dropbox public folder</title>
            <link>http://www.medworm.com/index.php?rid=4152099&amp;cid=t_162830_132_f&amp;fid=35006&amp;url=http%3A%2F%2Fnsaunders.wordpress.com%2F2010%2F11%2F09%2Fa-quick-bash-tip-add-an-index-html-file-to-a-dropbox-public-folder%2F</link>
            <description>You know that Dropbox is terrific, of course. No? Go and check it out now.
One issue: files in your Public folder have a public URL, that you can send to other people. Unfortunately, directories do not. So how do you share a public directory full of files?
Answer: create an index.html file and share that. Let&amp;#8217;s say that your files end in &amp;#8220;.txt&amp;#8221; and reside in ~/Dropbox/Public/entrez. Do this:

cd ~/Dropbox/Public/entrez
echo &amp;quot;&amp;lt;ol&amp;gt;&amp;quot; &amp;gt; index.html
for i in `ls *.txt`; do echo &amp;quot;&amp;lt;li&amp;gt;&amp;lt;a href='$i'&amp;gt;$i&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&amp;quot; &amp;gt;&amp;gt; index.html; done
echo &amp;quot;&amp;lt;/ol&amp;gt;&amp;quot; &amp;gt;&amp;gt; index.html

Now you can share the link to the index.html, which when clicked will display a list of links to all the other files in the directory.
Filed unde...</description>
            <author>What You're Doing Is Rather Desperate</author>
            <type>blogs</type>
        <comments>http://www.medworm.com/rss/comments.php?id=4152099</comments>
            <pubDate>Tue, 09 Nov 2010 00:26:01 +0100</pubDate>
            <guid isPermaLink="false">4152099</guid>        </item>
        <item>
            <title>Text to fasta and other delights of the shell</title>
            <link>http://www.medworm.com/index.php?rid=2083948&amp;cid=t_162830_132_f&amp;fid=35006&amp;url=http%3A%2F%2Fnsaunders.wordpress.com%2F2009%2F01%2F07%2Ftext-to-fasta-and-other-delights-of-the-shell%2F</link>
            <description>One thing I&amp;#8217;ve learned in my current job is that some familiarity with Linux tools for processing text files: awk, sed, grep, head/tail, cut/paste and so on, often provides a speedier solution than writing a script in (insert scripting language of choice here). I know this stuff is trivial to shell gurus, but I still get a little buzz out of it. A couple of real-life examples.


Delimited text to fasta
Your collaborator has developed &amp;#8220;peptides on a chip&amp;#8221; and sends you a text file describing said chip where column 1 = spot number, column 2 = peptide sequence:

1	ELDQGSLATSF
2	VDLAATPTDVR
3	TTNEEYLDLSQ
4	SSLDVYDGRFL
5	ALVHSYMTGRR


Your analysis requires that the peptide sequences be in fasta format. Easy, using awk:


awk &amp;#039;{print &amp;quot;&amp;gt;peptide&amp;quot; $1 &amp;quot;\n&amp;qu...</description>
            <author>What You're Doing Is Rather Desperate</author>
            <type>blogs</type>
        <comments>http://www.medworm.com/rss/comments.php?id=2083948</comments>
            <pubDate>Wed, 07 Jan 2009 03:02:42 +0100</pubDate>
            <guid isPermaLink="false">2083948</guid>        </item>
        <item>
            <title>Count the number of sequences in a FASTA format file: a Unix shell snippet</title>
            <link>http://www.medworm.com/index.php?rid=2523543&amp;cid=t_162830_132_f&amp;fid=35021&amp;url=http%3A%2F%2Ffeedproxy.google.com%2F%7Er%2FYourBonesGotALittleMachine%2F%7E3%2FXttIOC7bqfg%2F</link>
            <description>Sometimes it&amp;#8217;s nice to quickly check how many sequences are in a FASTA format sequence file.
It barely warrants it&amp;#8217;s own blog post, but here we go anyhow: my one-liner shell script for counting the number of sequences in a FASTA &amp;#8220;flat-file database&amp;#8221;, based on the presence of the &amp;#8220;&amp;gt;&amp;#8221; header symbol.
#!/bin/sh
# ~/bin/countseqs
# Counts the number of sequences in a FASTA format file
grep &amp;quot;&amp;gt;&amp;quot; $1 | wc -l
Dead easy huh ? I put this in ~/bin/countseqs, make it executable (chmod +x ~/bin/countseqs) and use it in lots of situations, as a quick sanity check.
(oh, btw, this is not public domain and u can&amp;#8217;t use it for commercial gain without paying me a license fee. academic users can fax me something for a free license. k thx bye).
Couldn&amp;#821...</description>
            <author>Your bones got a little machine.</author>
            <type>blogs</type>
        <comments>http://www.medworm.com/rss/comments.php?id=2523543</comments>
            <pubDate>Mon, 01 Sep 2008 05:49:38 +0100</pubDate>
            <guid isPermaLink="false">2523543</guid>        </item>
        <item>
            <title>6 words meme</title>
            <link>http://www.medworm.com/index.php?rid=1434543&amp;cid=t_162830_133_f&amp;fid=35129&amp;url=http%3A%2F%2Fwhitterer-autism.blogspot.com%2F2008%2F05%2F6-words-meme.html</link>
            <description>&quot;Angela&quot; over at &quot;Memoirs of a Chaotic Mommy&quot; has tagged me for this 'Your life in 6 words&quot; meme. Hers is much more pleasant than mine.However, as if that wasn't enough, she also added an extremely helpful note about derivation and pronunciation, as follows:-'What is a meme?!A meme has been explained to me in two ways:1. Meme--pronounced 'mem', a memory2. Meme--rhymes with 'theme', a theme where I am tagged to answer questions about 'me' or myself...'Now isn't that illuminating? If that has been a test I'd have scored zero, or naught as I would prefer to refer to it.So my life in six words would be this:-'Rambunctious, rowdy, revelry raising unruly renegades.'So now I need to tag six people?Six it is. Watch out next six commenters, you'll be in the hot seat.So first up is &quot;Joker&quot; from &quot;Mus...</description>
            <author>Whitterer on Autism</author>
            <type>blogs</type>
        <comments>http://www.medworm.com/rss/comments.php?id=1434543</comments>
            <pubDate>Sun, 11 May 2008 23:51:08 +0100</pubDate>
            <guid isPermaLink="false">1434543</guid>        </item>
        <item>
            <title>Linux tip:  sort a tab-delimited file</title>
            <link>http://www.medworm.com/index.php?rid=1129355&amp;cid=t_162830_132_f&amp;fid=35006&amp;url=http%3A%2F%2Fnsaunders.wordpress.com%2F2008%2F01%2F04%2Flinux-tip-sort-a-tab-delimited-file%2F</link>
            <description>The Linux command &amp;#8220;sort&amp;#8221; is both powerful and confusing. The manpage tells us that the &amp;#8220;-t&amp;#8221; switch can be used to set the field delimiter.
If you&amp;#8217;ve tried various combinations of &amp;#8220;-t&amp;#8221; and &amp;#8220;\t&amp;#8221; to tell sort that your file is tab-delimited without success, try this (bash shell):



TAB=`echo -e &quot;\t&quot;`
sort -t&quot;$TAB&quot; myfile



with &amp;#8220;-kN&amp;#8221; as appropriate, where N is the column on which to sort.
Long-winded discussion with much incorrect syntax in this forum; or get straight to the point in this mail archive. (Source: What You're Doing Is Rather Desperate)</description>
            <author>What You're Doing Is Rather Desperate</author>
            <type>blogs</type>
        <comments>http://www.medworm.com/rss/comments.php?id=1129355</comments>
            <pubDate>Fri, 04 Jan 2008 05:50:20 +0100</pubDate>
            <guid isPermaLink="false">1129355</guid>        </item>
    </channel>
</rss>

