<?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/43112?offset=510</link>
	<atom:link href="https://bioinformaticsonline.com/related/43112?offset=510" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/21444/a-guide-for-complete-r-beginners-installing-r-packages</guid>
	<pubDate>Tue, 24 Feb 2015 20:23:34 -0600</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/21444/a-guide-for-complete-r-beginners-installing-r-packages</link>
	<title><![CDATA[A guide for complete R beginners :- Installing R packages]]></title>
	<description><![CDATA[<p>Part of the reason R has become so popular is the vast array of packages available at the <a href="http://cran.r-project.org/" target="_blank">cran</a> and <a href="http://www.bioconductor.org/" target="_blank">bioconductor</a> repositories. In the last few years, the number of packages has grown <a href="http://blog.revolutionanalytics.com/2010/09/what-can-other-languages-learn-from-r.html" target="_blank">exponentially</a>!</p><p>This is a short post giving steps on how to actually install R packages. Let&rsquo;s suppose you want to install the <a href="http://had.co.nz/ggplot2/" target="_blank">ggplot2</a> package. Well nothing could be easier. We just fire up an R shell and type:<br /><code><br />&gt; install.packages("ggplot2")</code></p><p>In theory the package should just install, however:</p><ul>
<li>if you are using Linux and don&rsquo;t have root access, this command won&rsquo;t work.</li>
<li>you will be asked to select your local mirror, i.e. which server should you use to download the package.</li>
</ul><h4>Installing packages without root access</h4><p>First, you need to designate a directory where you will store the downloaded packages. On my machine, I use the directory <code>/data/Rpackages/</code> After creating a package directory, to install a package we use the command:<br /><code><br />&gt; install.packages("ggplot2"</code><code>, lib="/data/Rpackages/")<br />&gt; library(ggplot2, lib.loc="/data/Rpackages/")<br /></code></p><p>It&rsquo;s a bit of a pain having to type <code>/data/Rpackages/</code> all the time. To avoid this burden,&nbsp; we create a file <code>.Renviron</code> in our home area, and add the line <code>R_LIBS=/data/Rpackages/</code> to it. This means that whenever you start R, the directory <code>/data/Rpackages/</code> is added to the list of places to look for R packages and so:</p><p><code>&gt; install.packages("ggplot2"</code><code>)<br />&gt; library(ggplot2)</code></p><p>just works!</p><h4>Setting the repository</h4><p>Every time you install a R package, you are asked which repository R should use. To set the repository and avoid having to specify this at every package install, simply:</p><ul>
<li>create a file <code>.Rprofile</code> in your home area.</li>
<li>Add the following piece of code to it:</li>
</ul><p><code><br />cat(".Rprofile: Setting UK repositoryn")<br />r = getOption("repos") # hard code the UK repo for CRAN<br />r["CRAN"] = "http://cran.uk.r-project.org"<br />options(repos = r)<br />rm(r)<br /></code></p><p>I found this tip in a stackoverflow <a href="http://stackoverflow.com/questions/1189759/expert-r-users-whats-in-your-rprofile/1189826#1189826" target="_blank">answer </a>.</p>]]></description>
	<dc:creator>Archana Malhotra</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/23516/visual-machine-learning</guid>
	<pubDate>Wed, 29 Jul 2015 04:29:13 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/23516/visual-machine-learning</link>
	<title><![CDATA[Visual machine learning !!!]]></title>
	<description><![CDATA[<p>In machine learning, computers apply <strong>statistical learning</strong> techniques to automatically identify patterns in data. These techniques can be used to make highly accurate predictions.</p>
<p>More at http://www.r2d3.us/visual-intro-to-machine-learning-part-1/</p><p>Address of the bookmark: <a href="http://www.r2d3.us/visual-intro-to-machine-learning-part-1/" rel="nofollow">http://www.r2d3.us/visual-intro-to-machine-learning-part-1/</a></p>]]></description>
	<dc:creator>Jitendra Narayan</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/27078/homer-software-for-motif-discovery-and-next-gen-sequencing-analysis</guid>
	<pubDate>Tue, 26 Apr 2016 03:48:23 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/27078/homer-software-for-motif-discovery-and-next-gen-sequencing-analysis</link>
	<title><![CDATA[HOMER:  Software for motif discovery and next-gen sequencing analysis]]></title>
	<description><![CDATA[<p><span>This tutorial covers topics independently of HOMER, and represents knowledge which is important to know before diving head first into more advanced analysis tools such as HOMER.</span></p>
<ol>
<li><a href="http://homer.salk.edu/homer/basicTutorial/computerSetup.html">Setting up your computing environment</a></li>
<li><a href="http://homer.salk.edu/homer/basicTutorial/retrieveFiles.html">Retrieving and storing sequencing files</a>&nbsp;(your own data or from public sources)</li>
<li><a href="http://homer.salk.edu/homer/basicTutorial/fastqFiles.html">Checking sequence quality, trimming, general sequence manipulation</a></li>
<li><a href="http://homer.salk.edu/homer/basicTutorial/mapping.html">Mapping reads to a reference genome</a></li>
<li><a href="http://homer.salk.edu/homer/basicTutorial/samfiles.html">Manipulating SAM/BAM alignment files</a></li>
<li><a href="http://homer.salk.edu/homer/basicTutorial/genomeBrowsers.html">Visualizing data in a genome browser</a></li>
</ol>
<p><br>RNA-Seq</p>
<ol>
<li><a href="http://homer.salk.edu/homer/basicTutorial/rnaseqCufflinks.html">De novo transcript discovery and differential analysis with Cufflinks</a></li>
<li><a href="http://homer.salk.edu/homer/basicTutorial/rnaseqR.html">Differential expression analysis with R/Bioconductor</a></li>
<li><a href="http://homer.salk.edu/homer/basicTutorial/clustering.html">Clustering of large expression datasets (microarray or RNA-Seq)</a></li>
</ol>
<p><br><span>Microarray</span></p>
<ol>
<li><a href="http://homer.salk.edu/homer/basicTutorial/affymetrix.html">Basic analysis of Affymetrix Gene Expression Arrays using R/Bioconductor</a></li>
</ol>
<p><span>General Tips for Data Analysis</span></p>
<ol>
<li><a href="http://homer.salk.edu/homer/basicTutorial/excelTips.html">Excel workarounds, adding gene annotation, X-Y plots tips, etc.</a></li>
</ol><p>Address of the bookmark: <a href="http://homer.salk.edu/homer/basicTutorial/" rel="nofollow">http://homer.salk.edu/homer/basicTutorial/</a></p>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/27971/samtools-primer</guid>
	<pubDate>Thu, 23 Jun 2016 07:18:17 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/27971/samtools-primer</link>
	<title><![CDATA[Samtools Primer !!]]></title>
	<description><![CDATA[<p>SAMtools: Primer / Tutorial by Ethan Cerami, Ph.D.<br><br>keywords: samtools, next-gen, next-generation, sequencing, bowtie, sam, bam, primer, tutorial, how-to, introduction<br>Revisions<br><br>&nbsp;&nbsp;&nbsp; 1.0: May 30, 2013: First public release on biobits.org.<br>&nbsp;&nbsp;&nbsp; 1.1: July 24, 2013: Updated with Disqus Comments / Feedback section.<br>&nbsp;&nbsp;&nbsp; 1.2: December 19, 2014: Multiple updates, including:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Updated to use samtools 1.1 and bcftools 1.2.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Updated usage for bcftools.<br><br>About<br><br>SAMtools is a popular open-source tool used in next-generation sequence analysis. This primer provides an introduction to SAMtools, and is geared towards those new to next-generation sequence analysis. The primer is also designed to be self-contained and hands-on, meaning that you only need to install SAMtools, and no other tools, and sample data sets are provided. Terms in bold are also explained in the glossary at the end of the document.</p><p>Address of the bookmark: <a href="http://biobits.org/samtools_primer.html" rel="nofollow">http://biobits.org/samtools_primer.html</a></p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/32399/mapping-ngs</guid>
	<pubDate>Tue, 02 May 2017 07:58:07 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/32399/mapping-ngs</link>
	<title><![CDATA[Mapping NGS]]></title>
	<description><![CDATA[<p>NGS data are just a bunch of sequences, you have no idea which region in the genome each sequences comes from, which gene it represents...<br>To know that you have to align the sequences to the reference sequence. The reference sequence is in most cases the full genome sequence but sometimes, a library of EST sequences is used.<br>In either way, aligning your sequence reads to the reference sequence is called mapping.</p>
<p>The most used mappers of DNA-seq data are&nbsp;<a href="http://bio-bwa.sourceforge.net/" target="_blank">BWA</a>&nbsp;and&nbsp;<a href="http://bowtie-bio.sourceforge.net/bowtie2/index.shtml" target="_blank">Bowtie</a>&nbsp;for DNA-Seq data and&nbsp;<a href="http://tophat.cbcb.umd.edu/" target="_blank">Tophat</a>,&nbsp;<a href="https://github.com/alexdobin/STAR" target="_blank">STAR</a>&nbsp;or&nbsp;<a href="http://www.ccb.jhu.edu/software/hisat/index.shtml" target="_blank">HISAT</a>&nbsp;for RNA-Seq data. Mappers differ in which options they can take in, how fast and how accurate they are. Bowtie is faster than BWA, but looses some sensitivity (does not map an equal amount of reads to the correct position in the genome).</p><p>Address of the bookmark: <a href="http://wiki.bits.vib.be/index.php/Mapping_of_NGS_data" rel="nofollow">http://wiki.bits.vib.be/index.php/Mapping_of_NGS_data</a></p>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/43022/a-simple-tutorial-for-a-complex-complexheatmap</guid>
	<pubDate>Fri, 02 Apr 2021 06:18:32 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/43022/a-simple-tutorial-for-a-complex-complexheatmap</link>
	<title><![CDATA[A simple tutorial for a complex ComplexHeatmap]]></title>
	<description><![CDATA[<p><em>ComplexHeatmap</em>&nbsp;(Gu, Eils, and Schlesner (2016)) is an R Programming Language (R Core Team (2020)) package that is currently listed in the&nbsp;<a href="https://bioconductor.org/">Bioconductor</a>&nbsp;package repository.</p>
<p><a href="https://github.com/kevinblighe/E-MTAB-6141#2-install-and-load-required-packages">install and load required packages</a></p>
<div>
<pre>  require(<span>RColorBrewer</span>)
  require(<span>ComplexHeatmap</span>)
  require(<span>circlize</span>)
  require(<span>digest</span>)
  require(<span>cluster</span>)</pre>
</div>
<p>If all load successfully, proceed to&nbsp;<span>Part 3</span>. Otherwise, go through the following code chunks in order to ensure that each package is installed and loaded properly.</p>
<p><em>BiocManager</em>&nbsp;(Morgan (2019))</p><p>Address of the bookmark: <a href="https://github.com/kevinblighe/E-MTAB-6141" rel="nofollow">https://github.com/kevinblighe/E-MTAB-6141</a></p>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/blog/view/39307/awk-for-beginners</guid>
	<pubDate>Fri, 26 Apr 2019 16:19:41 -0500</pubDate>
	<link>https://bioinformaticsonline.com/blog/view/39307/awk-for-beginners</link>
	<title><![CDATA[AWK for beginners !]]></title>
	<description><![CDATA[<p>AWK is a standard tool on every POSIX-compliant UNIX system. It&rsquo;s like flex/lex, from the command-line, perfect for text-processing tasks and other scripting needs. It has a C-like syntax, but without mandatory semicolons (although, you should use them anyway, because they are required when you&rsquo;re writing one-liners, something AWK excels at), manual memory management, or static typing. It excels at text processing. You can call to it from a shell script, or you can use it as a stand-alone scripting language.</p><p>Why use AWK instead of Perl? Readability. AWK is easier to read than Perl. For simple text-processing scripts, particularly ones that read files line by line and split on delimiters, AWK is probably the right tool for the job.</p><div><pre><span>#!/usr/bin/awk -f</span>

<span># Comments are like this</span>


<span># AWK programs consist of a collection of patterns and actions.</span>
<span>pattern1</span> <span>{</span> <span>action</span><span>;</span> <span>}</span> <span># just like lex</span>
<span>pattern2</span> <span>{</span> <span>action</span><span>;</span> <span>}</span>

<span># There is an implied loop and AWK automatically reads and parses each</span>
<span># record of each file supplied. Each record is split by the FS delimiter,</span>
<span># which defaults to white-space (multiple spaces,tabs count as one)</span>
<span># You can assign FS either on the command line (-F C) or in your BEGIN</span>
<span># pattern</span>

<span># One of the special patterns is BEGIN. The BEGIN pattern is true</span>
<span># BEFORE any of the files are read. The END pattern is true after</span>
<span># an End-of-file from the last file (or standard-in if no files specified)</span>
<span># There is also an output field separator (OFS) that you can assign, which</span>
<span># defaults to a single space</span>

<span>BEGIN</span> <span>{</span>

    <span># BEGIN will run at the beginning of the program. It's where you put all</span>
    <span># the preliminary set-up code, before you process any text files. If you</span>
    <span># have no text files, then think of BEGIN as the main entry point.</span>

    <span># Variables are global. Just set them or use them, no need to declare..</span>
    <span>count</span> <span>=</span> <span>0</span><span>;</span>

    <span># Operators just like in C and friends</span>
    <span>a</span> <span>=</span> <span>count</span> <span>+</span> <span>1</span><span>;</span>
    <span>b</span> <span>=</span> <span>count</span> <span>-</span> <span>1</span><span>;</span>
    <span>c</span> <span>=</span> <span>count</span> <span>*</span> <span>1</span><span>;</span>
    <span>d</span> <span>=</span> <span>count</span> <span>/</span> <span>1</span><span>;</span> <span># integer division</span>
    <span>e</span> <span>=</span> <span>count</span> <span>%</span> <span>1</span><span>;</span> <span># modulus</span>
    <span>f</span> <span>=</span> <span>count</span> <span>^</span> <span>1</span><span>;</span> <span># exponentiation</span>

    <span>a</span> <span>+=</span> <span>1</span><span>;</span>
    <span>b</span> <span>-=</span> <span>1</span><span>;</span>
    <span>c</span> <span>*=</span> <span>1</span><span>;</span>
    <span>d</span> <span>/=</span> <span>1</span><span>;</span>
    <span>e</span> <span>%=</span> <span>1</span><span>;</span>
    <span>f</span> <span>^=</span> <span>1</span><span>;</span>

    <span># Incrementing and decrementing by one</span>
    <span>a</span><span>++</span><span>;</span>
    <span>b</span><span>--</span><span>;</span>

    <span># As a prefix operator, it returns the incremented value</span>
    <span>++</span><span>a</span><span>;</span>
    <span>--</span><span>b</span><span>;</span>

    <span># Notice, also, no punctuation such as semicolons to terminate statements</span>

    <span># Control statements</span>
    <span>if</span> <span>(</span><span>count</span> <span>==</span> <span>0</span><span>)</span>
        <span>print</span> <span>"Starting with count of 0"</span><span>;</span>
    <span>else</span>
        <span>print</span> <span>"Huh?"</span><span>;</span>

    <span># Or you could use the ternary operator</span>
    <span>print</span> <span>(</span><span>count</span> <span>==</span> <span>0</span><span>)</span> <span>?</span> <span>"Starting with count of 0"</span> <span>:</span> <span>"Huh?"</span><span>;</span>

    <span># Blocks consisting of multiple lines use braces</span>
    <span>while</span> <span>(</span><span>a</span> <span>&lt;</span> <span>10</span><span>)</span> <span>{</span>
        <span>print</span> <span>"String concatenation is done"</span> <span>" with a series"</span> <span>" of"</span>
            <span>" space-separated strings"</span><span>;</span>
        <span>print</span> <span>a</span><span>;</span>

        <span>a</span><span>++</span><span>;</span>
    <span>}</span>

    <span>for</span> <span>(</span><span>i</span> <span>=</span> <span>0</span><span>;</span> <span>i</span> <span>&lt;</span> <span>10</span><span>;</span> <span>i</span><span>++</span><span>)</span>
        <span>print</span> <span>"Good ol' for loop"</span><span>;</span>

    <span># As for comparisons, they're the standards:</span>
    <span># a &lt; b   # Less than</span>
    <span># a &lt;= b  # Less than or equal</span>
    <span># a != b  # Not equal</span>
    <span># a == b  # Equal</span>
    <span># a &gt; b   # Greater than</span>
    <span># a &gt;= b  # Greater than or equal</span>

    <span># Logical operators as well</span>
    <span># a &amp;&amp; b  # AND</span>
    <span># a || b  # OR</span>

    <span># In addition, there's the super useful regular expression match</span>
    <span>if</span> <span>(</span><span>"foo"</span> <span>~</span> <span>"^fo+$"</span><span>)</span>
        <span>print</span> <span>"Fooey!"</span><span>;</span>
    <span>if</span> <span>(</span><span>"boo"</span> <span>!~</span> <span>"^fo+$"</span><span>)</span>
        <span>print</span> <span>"Boo!"</span><span>;</span>

    <span># Arrays</span>
    <span>arr</span><span>[</span><span>0</span><span>]</span> <span>=</span> <span>"foo"</span><span>;</span>
    <span>arr</span><span>[</span><span>1</span><span>]</span> <span>=</span> <span>"bar"</span><span>;</span>

    <span># You can also initialize an array with the built-in function split()</span>

    <span>n</span> <span>=</span> <span>split</span><span>(</span><span>"foo:bar:baz"</span><span>,</span> <span>arr</span><span>,</span> <span>":"</span><span>);</span>

    <span># You also have associative arrays (actually, they're all associative arrays)</span>
    <span>assoc</span><span>[</span><span>"foo"</span><span>]</span> <span>=</span> <span>"bar"</span><span>;</span>
    <span>assoc</span><span>[</span><span>"bar"</span><span>]</span> <span>=</span> <span>"baz"</span><span>;</span>

    <span># And multi-dimensional arrays, with some limitations I won't mention here</span>
    <span>multidim</span><span>[</span><span>0</span><span>,</span><span>0</span><span>]</span> <span>=</span> <span>"foo"</span><span>;</span>
    <span>multidim</span><span>[</span><span>0</span><span>,</span><span>1</span><span>]</span> <span>=</span> <span>"bar"</span><span>;</span>
    <span>multidim</span><span>[</span><span>1</span><span>,</span><span>0</span><span>]</span> <span>=</span> <span>"baz"</span><span>;</span>
    <span>multidim</span><span>[</span><span>1</span><span>,</span><span>1</span><span>]</span> <span>=</span> <span>"boo"</span><span>;</span>

    <span># You can test for array membership</span>
    <span>if</span> <span>(</span><span>"foo"</span> <span>in</span> <span>assoc</span><span>)</span>
        <span>print</span> <span>"Fooey!"</span><span>;</span>

    <span># You can also use the 'in' operator to traverse the keys of an array</span>
    <span>for</span> <span>(</span><span>key</span> <span>in</span> <span>assoc</span><span>)</span>
        <span>print</span> <span>assoc</span><span>[</span><span>key</span><span>];</span>

    <span># The command line is in a special array called ARGV</span>
    <span>for</span> <span>(</span><span>argnum</span> <span>in</span> <span>ARGV</span><span>)</span>
        <span>print</span> <span>ARGV</span><span>[</span><span>argnum</span><span>];</span>

    <span># You can remove elements of an array</span>
    <span># This is particularly useful to prevent AWK from assuming the arguments</span>
    <span># are files for it to process</span>
    <span>delete</span> <span>ARGV</span><span>[</span><span>1</span><span>];</span>

    <span># The number of command line arguments is in a variable called ARGC</span>
    <span>print</span> <span>ARGC</span><span>;</span>

    <span># AWK has several built-in functions. They fall into three categories. I'll</span>
    <span># demonstrate each of them in their own functions, defined later.</span>

    <span>return_value</span> <span>=</span> <span>arithmetic_functions</span><span>(</span><span>a</span><span>,</span> <span>b</span><span>,</span> <span>c</span><span>);</span>
    <span>string_functions</span><span>();</span>
    <span>io_functions</span><span>();</span>
<span>}</span>

<span># Here's how you define a function</span>
<span>function</span> <span>arithmetic_functions</span><span>(</span><span>a</span><span>,</span> <span>b</span><span>,</span> <span>c</span><span>,</span>     <span>d</span><span>)</span> <span>{</span>

    <span># Probably the most annoying part of AWK is that there are no local</span>
    <span># variables. Everything is global. For short scripts, this is fine, even</span>
    <span># useful, but for longer scripts, this can be a problem.</span>

    <span># There is a work-around (ahem, hack). Function arguments are local to the</span>
    <span># function, and AWK allows you to define more function arguments than it</span>
    <span># needs. So just stick local variable in the function declaration, like I</span>
    <span># did above. As a convention, stick in some extra whitespace to distinguish</span>
    <span># between actual function parameters and local variables. In this example,</span>
    <span># a, b, and c are actual parameters, while d is merely a local variable.</span>

    <span># Now, to demonstrate the arithmetic functions</span>

    <span># Most AWK implementations have some standard trig functions</span>
    <span>localvar</span> <span>=</span> <span>sin</span><span>(</span><span>a</span><span>);</span>
    <span>localvar</span> <span>=</span> <span>cos</span><span>(</span><span>a</span><span>);</span>
    <span>localvar</span> <span>=</span> <span>atan2</span><span>(</span><span>b</span><span>,</span> <span>a</span><span>);</span> <span># arc tangent of b / a</span>

    <span># And logarithmic stuff</span>
    <span>localvar</span> <span>=</span> <span>exp</span><span>(</span><span>a</span><span>);</span>
    <span>localvar</span> <span>=</span> <span>log</span><span>(</span><span>a</span><span>);</span>

    <span># Square root</span>
    <span>localvar</span> <span>=</span> <span>sqrt</span><span>(</span><span>a</span><span>);</span>

    <span># Truncate floating point to integer</span>
    <span>localvar</span> <span>=</span> <span>int</span><span>(</span><span>5.34</span><span>);</span> <span># localvar =&gt; 5</span>

    <span># Random numbers</span>
    <span>srand</span><span>();</span> <span># Supply a seed as an argument. By default, it uses the time of day</span>
    <span>localvar</span> <span>=</span> <span>rand</span><span>();</span> <span># Random number between 0 and 1.</span>

    <span># Here's how to return a value</span>
    <span>return</span> <span>localvar</span><span>;</span>
<span>}</span>

<span>function</span> <span>string_functions</span><span>(</span>    <span>localvar</span><span>,</span> <span>arr</span><span>)</span> <span>{</span>

    <span># AWK, being a string-processing language, has several string-related</span>
    <span># functions, many of which rely heavily on regular expressions.</span>

    <span># Search and replace, first instance (sub) or all instances (gsub)</span>
    <span># Both return number of matches replaced</span>
    <span>localvar</span> <span>=</span> <span>"fooooobar"</span><span>;</span>
    <span>sub</span><span>(</span><span>"fo+"</span><span>,</span> <span>"Meet me at the "</span><span>,</span> <span>localvar</span><span>);</span> <span># localvar =&gt; "Meet me at the bar"</span>
    <span>gsub</span><span>(</span><span>"e+"</span><span>,</span> <span>"."</span><span>,</span> <span>localvar</span><span>);</span> <span># localvar =&gt; "m..t m. at th. bar"</span>

    <span># Search for a string that matches a regular expression</span>
    <span># index() does the same thing, but doesn't allow a regular expression</span>
    <span>match</span><span>(</span><span>localvar</span><span>,</span> <span>"t"</span><span>);</span> <span># =&gt; 4, since the 't' is the fourth character</span>

    <span># Split on a delimiter</span>
    <span>n</span> <span>=</span> <span>split</span><span>(</span><span>"foo-bar-baz"</span><span>,</span> <span>arr</span><span>,</span> <span>"-"</span><span>);</span> <span># a[1] = "foo"; a[2] = "bar"; a[3] = "baz"; n = 3</span>

    <span># Other useful stuff</span>
    <span>sprintf</span><span>(</span><span>"%s %d %d %d"</span><span>,</span> <span>"Testing"</span><span>,</span> <span>1</span><span>,</span> <span>2</span><span>,</span> <span>3</span><span>);</span> <span># =&gt; "Testing 1 2 3"</span>
    <span>substr</span><span>(</span><span>"foobar"</span><span>,</span> <span>2</span><span>,</span> <span>3</span><span>);</span> <span># =&gt; "oob"</span>
    <span>substr</span><span>(</span><span>"foobar"</span><span>,</span> <span>4</span><span>);</span> <span># =&gt; "bar"</span>
    <span>length</span><span>(</span><span>"foo"</span><span>);</span> <span># =&gt; 3</span>
    <span>tolower</span><span>(</span><span>"FOO"</span><span>);</span> <span># =&gt; "foo"</span>
    <span>toupper</span><span>(</span><span>"foo"</span><span>);</span> <span># =&gt; "FOO"</span>
<span>}</span>

<span>function</span> <span>io_functions</span><span>(</span>    <span>localvar</span><span>)</span> <span>{</span>

    <span># You've already seen print</span>
    <span>print</span> <span>"Hello world"</span><span>;</span>

    <span># There's also printf</span>
    <span>printf</span><span>(</span><span>"%s %d %d %d\n"</span><span>,</span> <span>"Testing"</span><span>,</span> <span>1</span><span>,</span> <span>2</span><span>,</span> <span>3</span><span>);</span>

    <span># AWK doesn't have file handles, per se. It will automatically open a file</span>
    <span># handle for you when you use something that needs one. The string you used</span>
    <span># for this can be treated as a file handle, for purposes of I/O. This makes</span>
    <span># it feel sort of like shell scripting, but to get the same output, the string</span>
    <span># must match exactly, so use a variable:</span>

    <span>outfile</span> <span>=</span> <span>"/tmp/foobar.txt"</span><span>;</span>

    <span>print</span> <span>"foobar"</span> <span>&gt;</span> <span>outfile</span><span>;</span>

    <span># Now the string outfile is a file handle. You can close it:</span>
    <span>close</span><span>(</span><span>outfile</span><span>);</span>

    <span># Here's how you run something in the shell</span>
    <span>system</span><span>(</span><span>"echo foobar"</span><span>);</span> <span># =&gt; prints foobar</span>

    <span># Reads a line from standard input and stores in localvar</span>
    <span>getline</span> <span>localvar</span><span>;</span>

    <span># Reads a line from a pipe (again, use a string so you close it properly)</span>
    <span>cmd</span> <span>=</span> <span>"echo foobar"</span><span>;</span>
    <span>cmd</span> <span>|</span> <span>getline</span> <span>localvar</span><span>;</span> <span># localvar =&gt; "foobar"</span>
    <span>close</span><span>(</span><span>cmd</span><span>);</span>

    <span># Reads a line from a file and stores in localvar</span>
    <span>infile</span> <span>=</span> <span>"/tmp/foobar.txt"</span><span>;</span>
    <span>getline</span> <span>localvar</span> <span>&lt;</span> <span>infile</span><span>;</span> 
    <span>close</span><span>(</span><span>infile</span><span>);</span>
<span>}</span>

<span># As I said at the beginning, AWK programs consist of a collection of patterns</span>
<span># and actions. You've already seen the BEGIN pattern. Other</span>
<span># patterns are used only if you're processing lines from files or standard</span>
<span># input.</span>
<span>#</span>
<span># When you pass arguments to AWK, they are treated as file names to process.</span>
<span># It will process them all, in order. Think of it like an implicit for loop,</span>
<span># iterating over the lines in these files. these patterns and actions are like</span>
<span># switch statements inside the loop. </span>

<span>/^fo+bar$/</span> <span>{</span>

    <span># This action will execute for every line that matches the regular</span>
    <span># expression, /^fo+bar$/, and will be skipped for any line that fails to</span>
    <span># match it. Let's just print the line:</span>

    <span>print</span><span>;</span>

    <span># Whoa, no argument! That's because print has a default argument: $0.</span>
    <span># $0 is the name of the current line being processed. It is created</span>
    <span># automatically for you.</span>

    <span># You can probably guess there are other $ variables. Every line is</span>
    <span># implicitly split before every action is called, much like the shell</span>
    <span># does. And, like the shell, each field can be access with a dollar sign</span>

    <span># This will print the second and fourth fields in the line</span>
    <span>print</span> <span>$</span><span>2</span><span>,</span> <span>$</span><span>4</span><span>;</span>

    <span># AWK automatically defines many other variables to help you inspect and</span>
    <span># process each line. The most important one is NF</span>

    <span># Prints the number of fields on this line</span>
    <span>print</span> <span>NF</span><span>;</span>

    <span># Print the last field on this line</span>
    <span>print</span> <span>$</span><span>NF</span><span>;</span>
<span>}</span>

<span># Every pattern is actually a true/false test. The regular expression in the</span>
<span># last pattern is also a true/false test, but part of it was hidden. If you</span>
<span># don't give it a string to test, it will assume $0, the line that it's</span>
<span># currently processing. Thus, the complete version of it is this:</span>

<span>$</span><span>0</span> <span>~</span> <span>/^fo+bar$/</span> <span>{</span>
    <span>print</span> <span>"Equivalent to the last pattern"</span><span>;</span>
<span>}</span>

<span>a</span> <span>&gt;</span> <span>0</span> <span>{</span>
    <span># This will execute once for each line, as long as a is positive</span>
<span>}</span>

<span># You get the idea. Processing text files, reading in a line at a time, and</span>
<span># doing something with it, particularly splitting on a delimiter, is so common</span>
<span># in UNIX that AWK is a scripting language that does all of it for you, without</span>
<span># you needing to ask. All you have to do is write the patterns and actions</span>
<span># based on what you expect of the input, and what you want to do with it.</span>

<span># Here's a quick example of a simple script, the sort of thing AWK is perfect</span>
<span># for. It will read a name from standard input and then will print the average</span>
<span># age of everyone with that first name. Let's say you supply as an argument the</span>
<span># name of a this data file:</span>
<span>#</span>
<span># Bob Jones 32</span>
<span># Jane Doe 22</span>
<span># Steve Stevens 83</span>
<span># Bob Smith 29</span>
<span># Bob Barker 72</span>
<span>#</span>
<span># Here's the script:</span>

<span>BEGIN</span> <span>{</span>

    <span># First, ask the user for the name</span>
    <span>print</span> <span>"What name would you like the average age for?"</span><span>;</span>

    <span># Get a line from standard input, not from files on the command line</span>
    <span>getline</span> <span>name</span> <span>&lt;</span> <span>"/dev/stdin"</span><span>;</span>
<span>}</span>

<span># Now, match every line whose first field is the given name</span>
<span>$</span><span>1</span> <span>==</span> <span>name</span> <span>{</span>

    <span># Inside here, we have access to a number of useful variables, already</span>
    <span># pre-loaded for us:</span>
    <span># $0 is the entire line</span>
    <span># $3 is the third field, the age, which is what we're interested in here</span>
    <span># NF is the number of fields, which should be 3</span>
    <span># NR is the number of records (lines) seen so far</span>
    <span># FILENAME is the name of the file being processed</span>
    <span># FS is the field separator being used, which is " " here</span>
    <span># ...etc. There are plenty more, documented in the man page.</span>

    <span># Keep track of a running total and how many lines matched</span>
    <span>sum</span> <span>+=</span> <span>$</span><span>3</span><span>;</span>
    <span>nlines</span><span>++</span><span>;</span>
<span>}</span>

<span># Another special pattern is called END. It will run after processing all the</span>
<span># text files. Unlike BEGIN, it will only run if you've given it input to</span>
<span># process. It will run after all the files have been read and processed</span>
<span># according to the rules and actions you've provided. The purpose of it is</span>
<span># usually to output some kind of final report, or do something with the</span>
<span># aggregate of the data you've accumulated over the course of the script.</span>

<span>END</span> <span>{</span>
    <span>if</span> <span>(</span><span>nlines</span><span>)</span>
        <span>print</span> <span>"The average age for "</span> <span>name</span> <span>" is "</span> <span>sum</span> <span>/</span> <span>nlines</span><span>;</span>
<span>}</span>
</pre><p><span>&nbsp;</span></p></div>]]></description>
	<dc:creator>BioJoker</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/43863/snakemake-tutorials</guid>
	<pubDate>Mon, 09 May 2022 05:20:41 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/43863/snakemake-tutorials</link>
	<title><![CDATA[Snakemake Tutorials !]]></title>
	<description><![CDATA[<p>A lesson introducing the Snakemake workflow system for bioinformatics analysis.</p>
<blockquote>
<h2 id="prerequisites">Prerequisites<a href="https://carpentries-incubator.github.io/snakemake-novice-bioinformatics/index.html#prerequisites"></a></h2>
<p>This is an intermediate lesson and assumes learners have already done some bioinformatics:</p>
<ul>
<li>Familiarity with the BASH command shell, including concepts like pipes, variables and loops.</li>
<li>Knowledge of bioinformatics fundamentals like the FASTQ file format and transcriptome sequencing, in order to understand the example workflow.</li>
</ul>
<p>No previous knowledge of Snakemake or workflow systems is required.</p>
<p>https://carpentries-incubator.github.io/snakemake-novice-bioinformatics/index.html</p>
</blockquote><p>Address of the bookmark: <a href="https://carpentries-incubator.github.io/snakemake-novice-bioinformatics/aio/index.html" rel="nofollow">https://carpentries-incubator.github.io/snakemake-novice-bioinformatics/aio/index.html</a></p>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/41222/best-practices-for-variant-calling-with-the-gatk</guid>
	<pubDate>Sat, 22 Feb 2020 03:07:31 -0600</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/41222/best-practices-for-variant-calling-with-the-gatk</link>
	<title><![CDATA[Best Practices for Variant Calling with the GATK]]></title>
	<description><![CDATA[<p>The presentations below were filmed during the March 2015 GATK Workshop, part of the BroadE Workshop series. At the time of this workshop, the current version of Broad&rsquo;s Genome Analysis Toolkit (GATK) was version 3.3.</p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<ul>
<li><a href="https://software.broadinstitute.org/gatk/">Genome Analysis Toolkit</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<table>
<tbody style="vertical-align: top;">
<tr>
<td>03/19/15</td>
<td>Introduction to High-Throughput Sequencing data formats and methods</td>
<td>Joel Thibault</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeY3g1M1ZjVjFrZ2s/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6696">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Introduction to the GATK</td>
<td>Geraldine Van der Auwera</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeVEJ1Z1pXUF9Ib3M/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6707">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Mapping, processing, and duplicate marking with Picard tools</td>
<td>Matt Sooknah</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeaGVrbE1GVV9SQkE/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6706">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Mapping and processing RNAseq</td>
<td>Ami Levy-Moonshine</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeLUkwUm5vTGl4bG8/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6705">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Indel realignment</td>
<td>Mark Fleharty</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeLTFzNndsNDBuVms/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6704">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Base quality score recalibration</td>
<td>David Roazen</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeZk1rMXpTYmZzTXc/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6703">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Introduction to variant discovery: calling cohorts</td>
<td>Louis Bergelson</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeQUFYUFRmM1hhRUE/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6702">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Variant calling and joint genotyping</td>
<td>Sheila Chandran</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeYzVTUGs0bjM3M1E/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6701">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Variant quality score recalibration</td>
<td>Bertrand Haas</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeSEpwRkNVQm4wdkE/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6700">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Introduction to working with variants</td>
<td>Yossi Farjoun</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWec0NqUTN2WTRuWWs/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6699">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Genotype refinement</td>
<td>Laura Gauthier</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeMzFldVF5SUp4dWM/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6698">Video</a></td>
</tr>
<tr>
<td>03/19/15</td>
<td>Annotation and variant evaluation</td>
<td>David Benjamin</td>
<td><a href="https://docs.google.com/file/d/0B2dK2q40HDWeWi1YMm42bWdpRE0/preview" target="_blank">PDF</a></td>
<td><a href="https://www.broadinstitute.org/node/6697">Video</a></td>
</tr>
</tbody>
</table><p>Address of the bookmark: <a href="https://www.broadinstitute.org/partnerships/education/broade/best-practices-variant-calling-gatk-1" rel="nofollow">https://www.broadinstitute.org/partnerships/education/broade/best-practices-variant-calling-gatk-1</a></p>]]></description>
	<dc:creator>biogeek</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/38004/vcfr-a-package-to-manipulate-and-visualize-vcf-data-in-r</guid>
	<pubDate>Thu, 25 Oct 2018 09:05:59 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/38004/vcfr-a-package-to-manipulate-and-visualize-vcf-data-in-r</link>
	<title><![CDATA[vcfR:  a package to manipulate and visualize VCF data in R]]></title>
	<description><![CDATA[<p><span>VcfR is an R package intended to allow easy manipulation and visualization of variant call format (VCF) data. Functions are provided to rapidly read from and write to VCF files. Once VCF data is read into R a parser function extracts matrices from the VCF data for use with typical R functions. This information can then be used for quality control or other purposes. Additional functions provide visualization of genomic data. Once processing is complete data may be written to a VCF file or converted into other popular R objects (e.g., genlight, DNAbin). VcfR provides a link between VCF data and the R environment connecting familiar software with genomic data.</span></p><p>Address of the bookmark: <a href="https://github.com/knausb/vcfR" rel="nofollow">https://github.com/knausb/vcfR</a></p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>