<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="https://rbutleriii.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://rbutleriii.github.io/" rel="alternate" type="text/html" /><updated>2021-10-09T22:41:22+00:00</updated><id>https://rbutleriii.github.io/feed.xml</id><title type="html">Rob’s Code</title><subtitle>Loosely organized analysis scripts with musings</subtitle><author><name>Robert R Butler III, PhD</name></author><entry><title type="html">Big batching your RNAseq</title><link href="https://rbutleriii.github.io/rnaseq/Big-batching-your-RNAseq.html" rel="alternate" type="text/html" title="Big batching your RNAseq" /><published>2020-10-04T00:00:00+00:00</published><updated>2020-10-04T00:00:00+00:00</updated><id>https://rbutleriii.github.io/rnaseq/Big-batching-your-RNAseq</id><content type="html" xml:base="https://rbutleriii.github.io/rnaseq/Big-batching-your-RNAseq.html">&lt;h4 id=&quot;so-did-you-do-read-alignment-or-pseudoalignment-why-not-both&quot;&gt;So did you do read alignment or pseudoalignment? Why not both?&lt;/h4&gt;

&lt;p&gt;Everyone will have an opinion on whether psuedoalignment is a good thing, so if you are going to use it, at least one collaborator will inevitably suggest you go back and try it the “other” way. Head them off and do both, since pseudoalignment costs very little compute.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;1&amp;gt;&amp;gt; command.log 2&amp;gt;&amp;amp;1
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ex&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;##################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# for running all of the trimming, alignment and alignment-free pipelines&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# does not make use of unpaired outputs&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# this script is set for a server with 100 threads and 256GB memory&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;##################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# directory where everything will go&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/path/to/base_dir
&lt;span class=&quot;c&quot;&gt;# directory of reads must have *_R1_001.fastq.gz and *_R2_001.fastq.gz filenames&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;READ_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/read_folder
&lt;span class=&quot;c&quot;&gt;# prior to running, the appropriate reference files must be generated in refs:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# an assembly gtf (must match version that built indexes below):&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;GTF&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/refs/Rattus_norvegicus.Rnor_6.0.96.gtf
&lt;span class=&quot;c&quot;&gt;# a salmon index:&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;SALMON_INDEX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/refs/Rnor6.quasi_index_21
&lt;span class=&quot;c&quot;&gt;# a STAR index:&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;STAR_INDEX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/refs/Rnor6_star
&lt;span class=&quot;c&quot;&gt;# there is a script in refs, modify for correct species and assembly&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;to-trim-or-not-to-trim&quot;&gt;to trim or not to trim&lt;/h4&gt;

&lt;p&gt;With better and better sequence quality, this is making less of a difference, but if for instance you have custom adapters, probably a good idea. trimmomatic is also good, but why deal with java when fastp is pretty fast.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;##################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# trim reads&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/trimmed
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/trimmed
&lt;span class=&quot;c&quot;&gt;# use paired end reads from read_dir&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# trying fastp, uses 2 worker threads per run (approx 250%-400% cpu)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# for quality trimming, use -5 and -3 with default window(4) and mean q(20)&lt;/span&gt;
trim&lt;span class=&quot;o&quot;&gt;(){&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;basename&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'_R1_001.fastq.gz'&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;R2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sed &lt;/span&gt;s/_R1_001.fastq.gz/_R2_001.fastq.gz/&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  fastp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--thread&lt;/span&gt; 2&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$R2&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;_R1_trim.fastq.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-O&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;_R2_trim.fastq.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--adapter_sequence&lt;/span&gt; AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--adapter_sequence_r2&lt;/span&gt; GATCGGAAGAGCACACGTCTGAACTCCAGTCACATCACGATCTCGTATGCCGTCTTCTGCTTG &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-3&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-5&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; 20 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;.html &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;.json
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; trim
parallel &lt;span class=&quot;nt&quot;&gt;-j50&lt;/span&gt; trim &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; ::: &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;READ_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;R1_001.fastq.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;salmon&quot;&gt;salmon&lt;/h4&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Salmon pipeline&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/salmon
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/salmon
&lt;span class=&quot;c&quot;&gt;# for paired end data&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# salmon counts quasi-mapping task&lt;/span&gt;
salmon_map&lt;span class=&quot;o&quot;&gt;(){&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;basename&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'_R1_trim.fastq.gz'&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;R2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/_R1_trim/_R2_trim/'&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  salmon &lt;span class=&quot;nt&quot;&gt;--no-version-check&lt;/span&gt; quant &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--seqBias&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--gcBias&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--validateMappings&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$2&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; A &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 20 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; &amp;lt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;pigz &lt;span class=&quot;nt&quot;&gt;-dc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-2&lt;/span&gt; &amp;lt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;pigz &lt;span class=&quot;nt&quot;&gt;-dc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$R2&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# run loop&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; salmon_map
parallel &lt;span class=&quot;nt&quot;&gt;-j5&lt;/span&gt; salmon_map &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SALMON_INDEX&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ::: &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/trimmed/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;_R1_trim.fastq.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;star-using-shared-memory&quot;&gt;STAR using shared memory&lt;/h4&gt;

&lt;p&gt;An advantage for using STAR is that it allows you to put the reference into shared memory and run several samples without eating up a lot of memory. Note the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;genomeLoad&lt;/code&gt; options&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# STAR-featureCounts pipeline&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/bam
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/bam
&lt;span class=&quot;c&quot;&gt;# for paired end data&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# STAR mapping task&lt;/span&gt;
star_map&lt;span class=&quot;o&quot;&gt;(){&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;basename&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'_R1_trim.fastq.gz'&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;R2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/_R1_trim/_R2_trim/'&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  STAR &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--runThreadN&lt;/span&gt; 20 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--genomeDir&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$2&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--genomeLoad&lt;/span&gt; LoadAndKeep &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--readFilesCommand&lt;/span&gt; zcat &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFileNamePrefix&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;_star &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outSAMtype&lt;/span&gt; BAM SortedByCoordinate &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outSAMmapqUnique&lt;/span&gt; 60 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outSAMattrRGline&lt;/span&gt; ID:&lt;span class=&quot;nv&quot;&gt;$out&lt;/span&gt; LB:lib1 PL:illumina PU:unit1 SM:&lt;span class=&quot;nv&quot;&gt;$out&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outBAMsortingThreadN&lt;/span&gt; 10 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outBAMsortingBinsN&lt;/span&gt; 10 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--limitBAMsortRAM&lt;/span&gt; 10000000000 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outBAMcompression&lt;/span&gt; 10 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--bamRemoveDuplicatesType&lt;/span&gt; UniqueIdentical &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFilterIntronMotifs&lt;/span&gt; RemoveNoncanonical &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFilterMismatchNmax&lt;/span&gt; 2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFilterScoreMinOverLread&lt;/span&gt; 0.30 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFilterMatchNminOverLread&lt;/span&gt; 0.30 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--alignSoftClipAtReferenceEnds&lt;/span&gt; No&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--readFilesIn&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$R2&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# add to shared memory&lt;/span&gt;
STAR &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--runThreadN&lt;/span&gt; 100 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeDir&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$STAR_INDEX&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeLoad&lt;/span&gt; LoadAndExit

&lt;span class=&quot;c&quot;&gt;# run loop&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; star_map
parallel &lt;span class=&quot;nt&quot;&gt;-j5&lt;/span&gt; star_map &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$STAR_INDEX&lt;/span&gt; ::: &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/trimmed/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;_R1_trim.fastq.gz

&lt;span class=&quot;c&quot;&gt;# remove from shared memory&lt;/span&gt;
STAR &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeDir&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$STAR_INDEX&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeLoad&lt;/span&gt; Remove

&lt;span class=&quot;c&quot;&gt;# featureCounts for all in folder (max threads 64)&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;FC_OUTFILE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;featureCounts&quot;&lt;/span&gt;
featureCounts &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-T&lt;/span&gt; 64 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-B&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; 2000 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; exon &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; gene_id &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$GTF&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;FC_OUTFILE&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;_counts.txt &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.bam

&lt;span class=&quot;c&quot;&gt;########################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# go home&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;BASE_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;next-time&quot;&gt;Next time&lt;/h4&gt;
&lt;p&gt;There it is, that script with 100 threads and 256GB memory can run a hundred samples easily overnight. In the future I can speed test the actual throughput.&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="rnaseq" /><category term="rnaseq" /><category term="salmon" /><category term="STAR" /><summary type="html">So did you do read alignment or pseudoalignment? Why not both?</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/pca-1.png" /><media:content medium="image" url="https://rbutleriii.github.io/pca-1.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Deploying R in conda</title><link href="https://rbutleriii.github.io/misc/deploying-R-in-conda.html" rel="alternate" type="text/html" title="Deploying R in conda" /><published>2020-09-24T00:00:00+00:00</published><updated>2020-09-24T00:00:00+00:00</updated><id>https://rbutleriii.github.io/misc/deploying-R-in-conda</id><content type="html" xml:base="https://rbutleriii.github.io/misc/deploying-R-in-conda.html">&lt;h2 id=&quot;a-solution-to-the-problem-of-portability&quot;&gt;a solution to the problem of portability&lt;/h2&gt;

&lt;p&gt;Working with R, you may have come across the frustration of figuring out where are put stuff, or the more frustrating ‘trying to install R as user’. Conda has spent a fair but of time setting it up so that conda virtual environments can store all of the necessary files, and access local libraries very efficiently.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;conda create &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; r4.0 &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;python&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;3 r-base r-essentials r-devtools
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;so-now-we-are-done-right&quot;&gt;So now we are done right?&lt;/h4&gt;

&lt;p&gt;Not exactly, as a plus, you can specify your R version with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;r-base==3.6.3&lt;/code&gt; and if you are wondering about bioconductor, then simply &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bioconductor-package&lt;/code&gt; will install any package in the right place. However, you will eventually run into the problem that there is an R package that isn’t available in conda. In this case, you can do as below, where I build a custom r-tigris and r-gg.gap package for a shiny app with maps. You can actually push these to your private conda channel in the cloud if you register for one, but more often, you will build it where you want it, and specify &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--use-local&lt;/code&gt; in your install to have conda check the locally built things. Also, you can clear out the temo build files with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conda build purge&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;1&amp;gt;&amp;gt; dashboard_build.log 2&amp;gt;&amp;amp;1
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ex&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# construct tigris&lt;/span&gt;
conda skeleton cran tigris
conda-build r-tigris

&lt;span class=&quot;c&quot;&gt;# construct gg.gap&lt;/span&gt;
conda skeleton cran gg.gap
conda-build r-gg.gap

&lt;span class=&quot;c&quot;&gt;# cleanup after builds&lt;/span&gt;
conda-build purge
&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; r-tigris/
&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; r-gg.gap/

&lt;span class=&quot;c&quot;&gt;# build initial&lt;/span&gt;
conda create &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; shiny &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--use-local&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;python&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;3 r-tigris r-gg.gap r-shiny &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  r-readr r-tidyr r-dplyr r-ggplot2 r-data.table r-shinyalert &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  r-rcolorbrewer r-gridextra r-stringr r-shinydashboard r-ggpubr r-ggplotify &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  r-leaflet r-units r-sf r-rgdal r-leafsync r-reshape2

&lt;span class=&quot;c&quot;&gt;# # Can be launched from Rscript (run in background screen)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# screen -S covid&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# source $(conda info --base)/etc/profile.d/conda.sh&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# conda activate shiny || { echo &quot;shiny Conda environment not activated&quot;; exit; }&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Rscript covid_19_data_viz_v6.R&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;next-time&quot;&gt;Next time&lt;/h4&gt;
&lt;p&gt;One of the things this doesn’t address is installing github packages. If they are simple, then hopefully after you are done installing R (include &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;r-devtools&lt;/code&gt;), you can run R and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;install_github('', dependencies=FALSE)&lt;/code&gt; from inside. However, beware, because if it has dependencies, R will try to install them where it knows to: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/local&lt;/code&gt; and this will create some havoc. Instead, you may have to research those dependencies and install them prior with conda, as I did here with r-units, r-sf, r-rgdal. Then, go back into R and try again. Repeat until done. Ugh, never an easy answer is there.&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="misc" /><category term="misc" /><category term="R" /><category term="conda" /><summary type="html">a solution to the problem of portability</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/condaR-1.png" /><media:content medium="image" url="https://rbutleriii.github.io/condaR-1.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Release the kraken(2)!</title><link href="https://rbutleriii.github.io/microbial/Release-the-kraken.html" rel="alternate" type="text/html" title="Release the kraken(2)!" /><published>2020-09-23T00:00:00+00:00</published><updated>2020-09-23T00:00:00+00:00</updated><id>https://rbutleriii.github.io/microbial/Release-the-kraken</id><content type="html" xml:base="https://rbutleriii.github.io/microbial/Release-the-kraken.html">&lt;h2 id=&quot;just-a-little-bit&quot;&gt;…just a little bit&lt;/h2&gt;

&lt;p&gt;Getting &lt;a href=&quot;https://ccb.jhu.edu/software/kraken2/&quot;&gt;kraken2&lt;/a&gt; to be set up for both &lt;a href=&quot;https://ccb.jhu.edu/software/bracken/&quot;&gt;Braken&lt;/a&gt; and &lt;a href=&quot;https://qiime2.org/&quot;&gt;qiime2&lt;/a&gt; takes a little bit of work. First, you need to have the standard report for Braken, and you need the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--mpa-report&lt;/code&gt; to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;parse_kraken_to_biom.py&lt;/code&gt; from this helpful &lt;a href=&quot;https://www.nature.com/articles/s41586-020-2095-1&quot;&gt;analysis&lt;/a&gt;. In order to get that going, its best to start small and test your first 10 samples. My samples are not ordered, so the first 10 included a mix of all experimental groups. Check that, otherwise you may threshold incorrectly.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;1&amp;gt;&amp;gt; command.log 2&amp;gt;&amp;amp;1
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ex&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;####KRAKEN&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;kdb&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'/path/to/db/minikraken2_v2_8GB_201904_UPDATE'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; kraken
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; kraken_test

&lt;span class=&quot;c&quot;&gt;# test run (species richness vs confidence)&lt;/span&gt;
parallel &lt;span class=&quot;nt&quot;&gt;-j10&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--plus&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--rpl&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{qq} s:.*/::; s:_R1.fastq.gz::;'&lt;/span&gt; kraken2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--threads&lt;/span&gt; 10 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--db&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$kdb&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--paired&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--confidence&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;2&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--report&lt;/span&gt; kraken_test/&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;1qq&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;2&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;.mpa_report&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--use-mpa-style&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; kraken_test/&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;1qq&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;2&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;.kraken &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;1&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;1/_R1.f/_R2.f&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ::: &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'FS=&quot;,&quot; {print $2}'&lt;/span&gt; 20200905_manifest.csv | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n11&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ::: 0 0.05 0.1 0.15 0.2 0.25 0.3 0.4 0.5 0.6 0.7 0.8 0.9

&lt;span class=&quot;c&quot;&gt;# calculate richness graph for confidence threshold&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;wc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; kraken_test/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.mpa_report &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; richness_test.txt
python kraken_test.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;note-the-range-of-confidence-thresholds&quot;&gt;Note the range of confidence thresholds&lt;/h4&gt;

&lt;p&gt;You are looking for the elbow of the curve, but go too far right and you end up removing all your OTUs. &lt;a href=&quot;https://github.com/DerrickWood/kraken2/issues/265&quot;&gt;Here&lt;/a&gt; is a much better thread on it. Well, lets see what I have:&lt;/p&gt;

&lt;div class=&quot;language-py highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/env python
&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;numpy&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;seaborn&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sns&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pandas&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# import data, split filenames into samples &amp;amp; confidence
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'richness_test.txt'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sep&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'\s+'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;kraken_test/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;.mpa_report&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'sample'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'confidence'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rsplit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;_&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expand&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rename&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;columns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'richness'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inplace&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# make plot
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sns&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lineplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'confidence'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'richness'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'sample'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set_ylabel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Crude richness&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;14&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set_xlabel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Confidence threshold&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;figure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;savefig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'richness_test.pdf'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;will-give-you-a-plot-of&quot;&gt;Will give you a plot of&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;../assets/img/kraken-2.png&quot; alt=&quot;Behold the elbows&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So, looks like 0.1 would be a good threshold to avoid noise. If you have too sparse data later on, you could dial it back closer to 0.05. So, lets break the server!&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# with only 256GB of RAM, limit to 24 simultaneous instances(x4 = 96 threads)&lt;/span&gt;
parallel &lt;span class=&quot;nt&quot;&gt;-j24&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--plus&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--rpl&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{qq} s:.*/::; s:_R1.fastq.gz::'&lt;/span&gt; kraken2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--threads&lt;/span&gt; 4 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--db&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$kdb&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--paired&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--confidence&lt;/span&gt; 0.1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--report&lt;/span&gt; kraken/&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;qq&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;.mpa_report &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--use-mpa-style&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; kraken/&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;qq&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;.kraken &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;/_R1.f/_R2.f&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ::: &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'FS=&quot;,&quot; {print $2}'&lt;/span&gt; 20200905_manifest.csv&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# make standard report for braken&lt;/span&gt;
parallel &lt;span class=&quot;nt&quot;&gt;-j24&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--plus&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--rpl&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{qq} s:.*/::; s:_R1.fastq.gz::'&lt;/span&gt; kraken2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--threads&lt;/span&gt; 4 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--db&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$kdb&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--paired&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--confidence&lt;/span&gt; 0.1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--report&lt;/span&gt; kraken/&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;qq&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;.report &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; kraken/&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;qq&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;.kraken &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;/_R1.f/_R2.f&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ::: &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'FS=&quot;,&quot; {print $2}'&lt;/span&gt; 20200905_manifest.csv&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# calculate richness graph for rough estimate&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;wc&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; kraken/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.mpa_report &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; richness.txt
python kraken_richness.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;lets-do-a-quick-check&quot;&gt;Lets do a quick check&lt;/h4&gt;

&lt;div class=&quot;language-py highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/env python
&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;numpy&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;seaborn&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sns&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pandas&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;plt&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# import raw richness data
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'richness.txt'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sep&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'\s+'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;kraken/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;.mpa_report&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rename&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;columns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'richness'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'specimen'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inplace&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# merge with manifest
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_csv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'20200905_manifest.csv'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merge&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# plot raw richness (with four variables)
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;axs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;plt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;subplots&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nrows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ncols&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;figsize&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;blist&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'braaksc'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'ceradsc'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'cerIO'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;'cogIO'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sns&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stripplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;blist&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'richness'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'apoe_genotype'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
        &lt;span class=&quot;n&quot;&gt;dodge&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;zorder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ax&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;axs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sns&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;boxplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;blist&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'richness'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;boxprops&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'facecolor'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'None'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; 
        &lt;span class=&quot;n&quot;&gt;showfliers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ax&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;axs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set_ylabel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'Crude richness'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# fig.show()
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tight_layout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;fig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;savefig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'richness_raw.pdf'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;next-time&quot;&gt;Next time&lt;/h4&gt;

&lt;p&gt;That worked out pretty well, the plot at the top is the crude result. I have much more analysis to do, but something has caught my eye. Next up lets get that data in biom format with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;parse_kraken_to_biom.py&lt;/code&gt;&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="microbial" /><category term="microbial" /><category term="metatranscriptomic" /><category term="Alzheimer's" /><category term="kraken" /><summary type="html">…just a little bit</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/kraken-1.png" /><media:content medium="image" url="https://rbutleriii.github.io/kraken-1.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Installing geneshot (via conda)</title><link href="https://rbutleriii.github.io/microbial/installing-geneshot.html" rel="alternate" type="text/html" title="Installing geneshot (via conda)" /><published>2020-09-22T00:00:00+00:00</published><updated>2020-09-22T00:00:00+00:00</updated><id>https://rbutleriii.github.io/microbial/installing-geneshot</id><content type="html" xml:base="https://rbutleriii.github.io/microbial/installing-geneshot.html">&lt;h2 id=&quot;installing-geneshot-via-conda&quot;&gt;Installing geneshot (via conda)&lt;/h2&gt;

&lt;p&gt;So sometimes you can’t use docker (it happens to the best of us). In some cases, like high security environments. &lt;a href=&quot;https://github.com/Golob-Minot/geneshot/wiki&quot;&gt;Geneshot&lt;/a&gt; is one of those neat looking new things I have been itching to try out. Luckily, miniconda is pretty flexible these days. Use an install script like:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;1&amp;gt;&amp;gt; command.log 2&amp;gt;&amp;amp;1
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ex&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# build conda environment (r-breakaway built for 3.6.3)&lt;/span&gt;
conda create &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; geneshot &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-vv&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;python&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;3 nextflow r-tidyverse r-devtools &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  r-vroom bioconductor-phyloseq cutadapt bwa megahit prodigal metaphlan2 diamond &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  biopython &lt;span class=&quot;nv&quot;&gt;mmseqs2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;7.4e23d zarr pytables pyarrow
&lt;span class=&quot;c&quot;&gt;# --max-seqs option dropped in mmseqs2 &amp;gt;7&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# pyarrow downgrades diamond quite a bit&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# activate&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;conda info &lt;span class=&quot;nt&quot;&gt;--base&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;/etc/profile.d/conda.sh
conda activate geneshot &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;geneshot Conda environment not activated&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;exit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# install non-conda components (required older python-dateutil for famli)&lt;/span&gt;
pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;barcodecop
pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;git+https://github.com/FredHutch/FAMLI.git@v1.5
pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;git+https://github.com/FredHutch/find-cags.git@v0.13.0

git clone https://github.com/Golob-Minot/geneshot.git &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; v0.8.6
&lt;span class=&quot;c&quot;&gt;# need some fastatools to run, put them in the conda env bin folder&lt;/span&gt;
git clone https://github.com/Golob-Minot/fastatools.git
&lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;a+x fastatools/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.py
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;k &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;fastatools/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.py
  &lt;span class=&quot;k&quot;&gt;do
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;basename&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$k&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$k&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;conda info &lt;span class=&quot;nt&quot;&gt;--base&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;/envs/geneshot/bin/&lt;span class=&quot;nv&quot;&gt;$j&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; fastatools

&lt;span class=&quot;c&quot;&gt;# need github R packages, for now install with R script (fix later)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#####R code&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#devtools::install_github(c(&quot;adw96/breakaway&quot;, &quot;bryandmartin/corncob&quot;), upgrade=&quot;never&quot;)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#####&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'devtools::install_github(c(&quot;adw96/breakaway&quot;, &quot;bryandmartin/corncob&quot;), upgrade=&quot;never&quot;)'&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; devtools.R
Rscript devtools.R
&lt;span class=&quot;nb&quot;&gt;rm &lt;/span&gt;devtools.R
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;did-it-work&quot;&gt;Did it work?&lt;/h4&gt;
&lt;p&gt;As far as testing goes, these seem to be good to go mostly, but I get some issues running corncob. Luckily, that can be run separately with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;run_corncob.nf&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;##PASS w/o formula&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NXF_VER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;20.04.1 nextflow run main.nf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; nextflow.config &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-profile&lt;/span&gt; testing &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--manifest&lt;/span&gt; data/mock.manifest.csv &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--nopreprocess&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; output &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--hg_index&lt;/span&gt; data/hg_chr_21_bwa_index.tar.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--distance_threshold&lt;/span&gt; 0.5 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# -w work/ \&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# --noannot \&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# --formula &quot;label1 + label2&quot; \&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;##FAIL&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NXF_VER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;20.04.1 nextflow run main.nf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; nextflow.config &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-profile&lt;/span&gt; testing &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--manifest&lt;/span&gt; data/mock.manifest.csv &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--preprocess_output&lt;/span&gt; output/preprocess_output &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; output1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--hg_index&lt;/span&gt; data/hg_chr_21_bwa_index.tar.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--formula&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;label1 + label2&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--distance_threshold&lt;/span&gt; 0.1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; work/ &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--noannot&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--savereads&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-resume&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# PASS # Test with preprocessing and no formula&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NXF_VER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;20.04.1 nextflow run main.nf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; nextflow.config &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-profile&lt;/span&gt; testing &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--manifest&lt;/span&gt; data/mock.manifest.csv &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--preprocess_output&lt;/span&gt; output/preprocess_output &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; output2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--hg_index&lt;/span&gt; data/hg_chr_21_bwa_index.tar.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--distance_threshold&lt;/span&gt; 0.1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; work/ &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--noannot&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-resume&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# FAIL # Test with formula and no preprocessing&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NXF_VER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;20.04.1 nextflow run main.nf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; nextflow.config &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-profile&lt;/span&gt; testing &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--nopreprocess&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--manifest&lt;/span&gt; data/mock.manifest.csv &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; output3 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--hg_index&lt;/span&gt; data/hg_chr_21_bwa_index.tar.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--formula&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;label1 + label2&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--distance_threshold&lt;/span&gt; 0.1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; work/ &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--noannot&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-resume&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# PASS # Test with no formula and no preprocessing&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NXF_VER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;20.04.1 nextflow run main.nf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; nextflow.config &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-profile&lt;/span&gt; testing &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--nopreprocess&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--manifest&lt;/span&gt; data/mock.manifest.csv &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; output4 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--hg_index&lt;/span&gt; data/hg_chr_21_bwa_index.tar.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; work/ &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--noannot&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-resume&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# PASS # Test with the gene catalog made in a previous round&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;NXF_VER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;20.04.1 nextflow run main.nf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; nextflow.config &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-profile&lt;/span&gt; testing &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--gene_fasta&lt;/span&gt; data/genes.fasta.2.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--nopreprocess&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--manifest&lt;/span&gt; data/mock.manifest.csv &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; output5 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--hg_index&lt;/span&gt; data/hg_chr_21_bwa_index.tar.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; work/ &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--noannot&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-resume&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;so-always-good-to-check&quot;&gt;So, always good to check&lt;/h4&gt;
&lt;p&gt;Looking at the head of your data is always good, and mine runs thus far. Now to let it run through 600 samples. Even with 100 threads + 360GB memory, that will take a little bit…&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# geneshot test run&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n15&lt;/span&gt; 20200905_manifest.csv &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; test_manifest.csv
nextflow &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    run &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        geneshot &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;--manifest&lt;/span&gt; test_manifest.csv &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;--output&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;--nopreprocess&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;-with-report&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;-resume&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;next-time&quot;&gt;Next time&lt;/h4&gt;
&lt;p&gt;Its worth noting, that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-resume&lt;/code&gt; doesn’t work very well for me, it often starts over and I can’t figure out why. Also, my reads were already cleaned prior to running that, so I used &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--nopreprocess&lt;/code&gt;. However preprocessing did work in the test files, so it should be A-OK. In the future, time to solve the corncob part…&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="microbial" /><category term="microbial" /><category term="metatranscriptomic" /><category term="Alzheimer's" /><category term="geneshot" /><summary type="html">Installing geneshot (via conda)</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/geneshot-1.png" /><media:content medium="image" url="https://rbutleriii.github.io/geneshot-1.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Allelic Imbalance of Expression in Rats: Part I</title><link href="https://rbutleriii.github.io/rnaseq/aie-snps-part-I.html" rel="alternate" type="text/html" title="Allelic Imbalance of Expression in Rats: Part I" /><published>2020-09-21T00:00:00+00:00</published><updated>2020-09-21T00:00:00+00:00</updated><id>https://rbutleriii.github.io/rnaseq/aie-snps-part-I</id><content type="html" xml:base="https://rbutleriii.github.io/rnaseq/aie-snps-part-I.html">&lt;h2 id=&quot;allelic-imbalance-of-expression-part-i-getting-your-reads&quot;&gt;Allelic imbalance of expression part I: getting your reads&lt;/h2&gt;

&lt;h4 id=&quot;but-i-cant-use-wasp&quot;&gt;But I can’t use WASP…&lt;/h4&gt;
&lt;p&gt;Sometimes you want to look at allelic imbalance of expression and &lt;a href=&quot;https://www.encodeproject.org/software/wasp/&quot;&gt;WASP&lt;/a&gt; isn’t an option (like when you are looking at non-human genomes, or those for which you don’t have a personal genome). The fallback method to correct for mapping bias is &lt;em&gt;N&lt;/em&gt;-masking the SNPs in the your samples, then mapping your samples to said masked fasta [Details].&lt;/p&gt;

&lt;p&gt;First things first, you probably already have bams from your [DE analysis]. Take a subset of your sample bams, evenly distributed across your groups and merge it into a large bam:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# list of bams is two each of three tissues for A and B (12 total)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# merge bams&lt;/span&gt;
samtools merge &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; -@ &lt;span class=&quot;nv&quot;&gt;$threads&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$bams_to_merge&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$merge_bam&lt;/span&gt;
samtools index -@ &lt;span class=&quot;nv&quot;&gt;$threads&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$merge_bam&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# merge calls&lt;/span&gt;
gatk &lt;span class=&quot;nt&quot;&gt;--java-options&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;-Xmx300G&quot;&lt;/span&gt; HaplotypeCaller &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$genome_ref&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$dbSNP&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--native-pair-hmm-threads&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$threads&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-stand-call-conf&lt;/span&gt; 30 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$merge_bam&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-O&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$merge_vcf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then you can take these merged calls and mask your genome. If you are unfamiliar with loading STAR into shared memory, check out the &lt;a href=&quot;&quot;&gt;mapping post&lt;/a&gt;. Then remap:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#######################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# masking genome&lt;/span&gt;
bedtools maskfasta &lt;span class=&quot;nt&quot;&gt;-fi&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$genome_ref&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-bed&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$merge_vcf&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-fo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$mask_fa&lt;/span&gt;
samtools faidx &lt;span class=&quot;nv&quot;&gt;$mask_fa&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#######################################&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# remapping to masked fasta&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# building masked STAR index&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$STAR_INDEX&lt;/span&gt;
STAR &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--runMode&lt;/span&gt; genomeGenerate &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--runThreadN&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$threads&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeDir&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$STAR_INDEX&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeFastaFiles&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$mask_fa&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--sjdbGTFfile&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$GTF&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# STAR-featureCounts pipeline&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; masked_bams
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;masked_bams

&lt;span class=&quot;c&quot;&gt;# add index to shared memory&lt;/span&gt;
STAR &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--runThreadN&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$threads&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeDir&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$STAR_INDEX&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeLoad&lt;/span&gt; LoadAndExit

&lt;span class=&quot;c&quot;&gt;# run loop&lt;/span&gt;
parallel &lt;span class=&quot;nt&quot;&gt;-j5&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--plus&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--rpl&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{..} s:_R1_trim\.fastq\.gz::;s:/data/butlerr/nicotine_sensi/trimmed/::'&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  STAR &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--runThreadN&lt;/span&gt; 20 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--genomeDir&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$STAR_INDEX&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--genomeLoad&lt;/span&gt; LoadAndKeep &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--readFilesCommand&lt;/span&gt; zcat &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFileNamePrefix&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;..&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outSAMtype&lt;/span&gt; BAM SortedByCoordinate &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outSAMmapqUnique&lt;/span&gt; 60 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outSAMattrRGline&lt;/span&gt; ID:&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;..&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; LB:lib1 PL:illumina PU:unit1 SM:&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;..&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outBAMsortingThreadN&lt;/span&gt; 10 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outBAMsortingBinsN&lt;/span&gt; 10 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--limitBAMsortRAM&lt;/span&gt; 10000000000 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outBAMcompression&lt;/span&gt; 10 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--bamRemoveDuplicatesType&lt;/span&gt; UniqueIdentical &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFilterIntronMotifs&lt;/span&gt; RemoveNoncanonical &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFilterMismatchNmax&lt;/span&gt; 2 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFilterScoreMinOverLread&lt;/span&gt; 0.30 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--outFilterMatchNminOverLread&lt;/span&gt; 0.30 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--alignSoftClipAtReferenceEnds&lt;/span&gt; No &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--readFilesIn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;/_R1_/_R2_&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  :::: &lt;span class=&quot;nv&quot;&gt;$fasta_to_read&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# remove from shared memory&lt;/span&gt;
STAR &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeDir&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$STAR_INDEX&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomeLoad&lt;/span&gt; Remove

&lt;span class=&quot;c&quot;&gt;# indexing bams&lt;/span&gt;
parallel &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$thr_para&lt;/span&gt; samtools index &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; ::: &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.bam
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$wk_dir&lt;/span&gt; 
&lt;span class=&quot;c&quot;&gt;# you could do ../, but better to explicitly define your directories at the top&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# of the script&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;ok-now-to-do-it-all-again&quot;&gt;Ok, now to do it all again&lt;/h4&gt;
&lt;p&gt;So, with your reads aligned with &lt;em&gt;less&lt;/em&gt; mapping reference bias. STAR has implemented the WASP algorithm, but that is something for me to try in the future. Something that can save lots of time is gatk4.1 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-ERC GVCF&lt;/code&gt; option. This will give you a set of gvcfs that can be combined with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GenotypeGVCFs&lt;/code&gt; to give you an ‘all calls’ vcf with each sample called at all positions. So now you have read counts for REF and ALT everywhere (Note: I have three tissues I am looking at, so I split files up by a specific sample name pattern, then run the resulting steps in parallel -j3):&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# calling gvcfs from masked bams&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; masked_gvcfs
parallel &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$thr_para&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--plus&lt;/span&gt; gatk &lt;span class=&quot;nt&quot;&gt;--java-options&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-Xmx4G&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt; HaplotypeCaller &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$genome_ref&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$dbSNP&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-stand-call-conf&lt;/span&gt; 30 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-O&lt;/span&gt; masked_gvcfs/&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;/...&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;suffix2&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-ERC&lt;/span&gt; GVCF &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ::: &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;ls &lt;/span&gt;masked_bams/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.bam&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;masked_gvcfs

&lt;span class=&quot;c&quot;&gt;# tissue specific list files&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;Aligned_masked.g.vcf.gz | &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/(.*)Aligned/\1\t\1Aligned/'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; vta.txt
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-2&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;Aligned_masked.g.vcf.gz | &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/(.*)Aligned/\1\t\1Aligned/'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; nac.txt
&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-3&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;Aligned_masked.g.vcf.gz | &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/(.*)Aligned/\1\t\1Aligned/'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; nash.txt

&lt;span class=&quot;c&quot;&gt;# make list bed for reference genome (without patches)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'BEGIN {FS=&quot;\t&quot;}; {print $1 FS &quot;0&quot; FS $2}'&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$genome_ref&lt;/span&gt;.fai &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'^[1-9XY]'&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; chr_list.bed

&lt;span class=&quot;c&quot;&gt;# make tissue specific gdbs (makes use of all 100 threads)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /data/butlerr/tmp
parallel &lt;span class=&quot;nt&quot;&gt;-j3&lt;/span&gt; gatk &lt;span class=&quot;nt&quot;&gt;--java-options&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-Xmx100G -Xms100G&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt; GenomicsDBImport &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--genomicsdb-workspace-path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--sample-name-map&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt;.txt &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--max-num-intervals-to-import-in-parallel&lt;/span&gt; 24 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--intervals&lt;/span&gt; chr_list.bed &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--tmp-dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/data/butlerr/tmp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ::: &lt;span class=&quot;s2&quot;&gt;&quot;vta&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;nac&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;nash&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# call Joint Genotypes&lt;/span&gt;
parallel &lt;span class=&quot;nt&quot;&gt;-j3&lt;/span&gt; gatk &lt;span class=&quot;nt&quot;&gt;--java-options&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-Xmx40G&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt; GenotypeGVCFs &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$genome_ref&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$dbSNP&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-V&lt;/span&gt; gendb://&lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$BED&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--merge-input-intervals&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--tmp-dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/data/butlerr/tmp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-O&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt;_output.vcf.gz &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ::: &lt;span class=&quot;s2&quot;&gt;&quot;vta&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;nac&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;nash&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One last issue though, I cannot get gatk to properly call only snps in the specified &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--intervals&lt;/code&gt; region, it just seems to ignore the option. Oh well, bcftools can get you there.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# won't filter based on --interval/-L try bcftools&lt;/span&gt;
parallel &lt;span class=&quot;nt&quot;&gt;-j3&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--plus&lt;/span&gt; bcftools query &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$BED&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'%CHROM\t%POS\t%REF\t%ALT\t%ID[\t%AD\t%DP]\n'&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;..&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;.plot &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ::: &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;output.vcf.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;next-time&quot;&gt;Next time&lt;/h4&gt;
&lt;p&gt;What to do with all that read count data.&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="rnaseq" /><category term="rnaseq" /><category term="AIE" /><summary type="html">Allelic imbalance of expression part I: getting your reads</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/aie-1.jpg" /><media:content medium="image" url="https://rbutleriii.github.io/aie-1.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">The Genetic Relevance of Human Induced Pluripotent Stem Cell-Derived Microglia to Alzheimer’s Disease and Major Neuropsychiatric Disorders</title><link href="https://rbutleriii.github.io/pubs/theg-mole-neur.html" rel="alternate" type="text/html" title="The Genetic Relevance of Human Induced Pluripotent Stem Cell-Derived Microglia to Alzheimer’s Disease and Major Neuropsychiatric Disorders" /><published>2019-07-23T00:00:00+00:00</published><updated>2019-07-23T00:00:00+00:00</updated><id>https://rbutleriii.github.io/pubs/theg-mole-neur</id><content type="html" xml:base="https://rbutleriii.github.io/pubs/theg-mole-neur.html">&lt;h2 id=&quot;the-genetic-relevance-of-human-induced-pluripotent-stem-cell-derived-microglia-to-alzheimers-disease-and-major-neuropsychiatric-disorders&quot;&gt;The Genetic Relevance of Human Induced Pluripotent Stem Cell-Derived Microglia to Alzheimer’s Disease and Major Neuropsychiatric Disorders&lt;/h2&gt;
&lt;h4 id=&quot;robert-r-butler-iii-alena-kozlova-hanwen-zhang-siwei-zhang-michael-streit-alan-r-sanders-krzysztof-laudanski-zhiping-p-pang-pablo-v-gejman-jubao-duan&quot;&gt;Robert R Butler III, Alena Kozlova, Hanwen Zhang, Siwei Zhang, Michael Streit, Alan R Sanders, Krzysztof Laudanski, Zhiping P Pang, Pablo V Gejman, Jubao Duan&lt;/h4&gt;
&lt;p&gt;Journal: Molecular Neuropsychiatry&lt;br /&gt;
PMID: &lt;a href=&quot;https://pubmed.ncbi.nlm.nih.gov/32399472&quot;&gt;32399472&lt;/a&gt;&lt;br /&gt;
DOI: &lt;a href=&quot;https://doi.org/10.1159/000501935&quot;&gt;10.1159/000501935&lt;/a&gt;&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="pubs" /><category term="pubs" /><summary type="html">The Genetic Relevance of Human Induced Pluripotent Stem Cell-Derived Microglia to Alzheimer’s Disease and Major Neuropsychiatric Disorders Robert R Butler III, Alena Kozlova, Hanwen Zhang, Siwei Zhang, Michael Streit, Alan R Sanders, Krzysztof Laudanski, Zhiping P Pang, Pablo V Gejman, Jubao Duan Journal: Molecular Neuropsychiatry PMID: 32399472 DOI: 10.1159/000501935</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/theg-mole-neur.png" /><media:content medium="image" url="https://rbutleriii.github.io/theg-mole-neur.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Clinotator: analyzing ClinVar variation reports to prioritize reclassification efforts</title><link href="https://rbutleriii.github.io/pubs/clin-f1000.html" rel="alternate" type="text/html" title="Clinotator: analyzing ClinVar variation reports to prioritize reclassification efforts" /><published>2018-06-20T00:00:00+00:00</published><updated>2018-06-20T00:00:00+00:00</updated><id>https://rbutleriii.github.io/pubs/clin-f1000</id><content type="html" xml:base="https://rbutleriii.github.io/pubs/clin-f1000.html">&lt;h2 id=&quot;clinotator-analyzing-clinvar-variation-reports-to-prioritize-reclassification-efforts&quot;&gt;Clinotator: analyzing ClinVar variation reports to prioritize reclassification efforts&lt;/h2&gt;
&lt;h4 id=&quot;robert-r-butler-iii-pablo-v-gejman&quot;&gt;Robert R Butler III, Pablo V Gejman&lt;/h4&gt;
&lt;p&gt;Journal: F1000Research&lt;br /&gt;
PMID: &lt;a href=&quot;https://pubmed.ncbi.nlm.nih.gov/29862020&quot;&gt;29862020&lt;/a&gt;&lt;br /&gt;
DOI: &lt;a href=&quot;https://doi.org/10.12688/f1000research.14470.2&quot;&gt;10.12688/f1000research.14470.2&lt;/a&gt;&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="pubs" /><category term="pubs" /><summary type="html">Clinotator: analyzing ClinVar variation reports to prioritize reclassification efforts Robert R Butler III, Pablo V Gejman Journal: F1000Research PMID: 29862020 DOI: 10.12688/f1000research.14470.2</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/clin-f1000.png" /><media:content medium="image" url="https://rbutleriii.github.io/clin-f1000.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">PhenotypeXpression: sub-classification of disease states using public gene expression data and literature</title><link href="https://rbutleriii.github.io/pubs/phen-bior.html" rel="alternate" type="text/html" title="PhenotypeXpression: sub-classification of disease states using public gene expression data and literature" /><published>2018-01-01T00:00:00+00:00</published><updated>2018-01-01T00:00:00+00:00</updated><id>https://rbutleriii.github.io/pubs/phen-bior</id><content type="html" xml:base="https://rbutleriii.github.io/pubs/phen-bior.html">&lt;h2 id=&quot;phenotypexpression-sub-classification-of-disease-states-using-public-gene-expression-data-and-literature&quot;&gt;PhenotypeXpression: sub-classification of disease states using public gene expression data and literature&lt;/h2&gt;
&lt;h4 id=&quot;lucy-lu-wang-huaiying-lin-xiaojun-bao-subhajit-sengupta-ben-busby-robert-r-butler-iii&quot;&gt;Lucy Lu Wang, Huaiying Lin, Xiaojun Bao, Subhajit Sengupta, Ben Busby, Robert R Butler III&lt;/h4&gt;
&lt;p&gt;Journal: biorXiv&lt;br /&gt;
DOI: &lt;a href=&quot;https://doi.org/10.1101/461301&quot;&gt;10.1101/461301&lt;/a&gt;&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="pubs" /><category term="pubs" /><summary type="html">PhenotypeXpression: sub-classification of disease states using public gene expression data and literature Lucy Lu Wang, Huaiying Lin, Xiaojun Bao, Subhajit Sengupta, Ben Busby, Robert R Butler III Journal: biorXiv DOI: 10.1101/461301</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/phen-bior.png" /><media:content medium="image" url="https://rbutleriii.github.io/phen-bior.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Complete genome sequences of two human oral microbiome commensals: Streptococcus salivarius ATCC 25975 and S. salivarius ATCC 27945</title><link href="https://rbutleriii.github.io/pubs/comp-geno-anno.html" rel="alternate" type="text/html" title="Complete genome sequences of two human oral microbiome commensals: Streptococcus salivarius ATCC 25975 and S. salivarius ATCC 27945" /><published>2017-06-15T00:00:00+00:00</published><updated>2017-06-15T00:00:00+00:00</updated><id>https://rbutleriii.github.io/pubs/comp-geno-anno</id><content type="html" xml:base="https://rbutleriii.github.io/pubs/comp-geno-anno.html">&lt;h2 id=&quot;complete-genome-sequences-of-two-human-oral-microbiome-commensals-streptococcus-salivarius-atcc-25975-and-s-salivarius-atcc-27945&quot;&gt;Complete genome sequences of two human oral microbiome commensals: Streptococcus salivarius ATCC 25975 and S. salivarius ATCC 27945&lt;/h2&gt;
&lt;h4 id=&quot;robert-r-butler-jahna-ta-soomer-james-michel-frenette-jean-françois-pombert&quot;&gt;Robert R Butler, Jahna TA Soomer-James, Michel Frenette, Jean-François Pombert&lt;/h4&gt;
&lt;p&gt;Journal: Genome announcements&lt;br /&gt;
PMID: &lt;a href=&quot;https://pubmed.ncbi.nlm.nih.gov/28619805&quot;&gt;28619805&lt;/a&gt;&lt;br /&gt;
DOI: &lt;a href=&quot;https://doi.org/10.1128/genomeA.00536-17&quot;&gt;10.1128/genomeA.00536-17&lt;/a&gt;&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="pubs" /><category term="pubs" /><summary type="html">Complete genome sequences of two human oral microbiome commensals: Streptococcus salivarius ATCC 25975 and S. salivarius ATCC 27945 Robert R Butler, Jahna TA Soomer-James, Michel Frenette, Jean-François Pombert Journal: Genome announcements PMID: 28619805 DOI: 10.1128/genomeA.00536-17</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/comp-geno-anno.png" /><media:content medium="image" url="https://rbutleriii.github.io/comp-geno-anno.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Genetic characterization of the exceptionally high heat resistance of the non-toxic surrogate Clostridium sporogenes PA 3679</title><link href="https://rbutleriii.github.io/pubs/gene-fron.html" rel="alternate" type="text/html" title="Genetic characterization of the exceptionally high heat resistance of the non-toxic surrogate Clostridium sporogenes PA 3679" /><published>2017-04-03T00:00:00+00:00</published><updated>2017-04-03T00:00:00+00:00</updated><id>https://rbutleriii.github.io/pubs/gene-fron</id><content type="html" xml:base="https://rbutleriii.github.io/pubs/gene-fron.html">&lt;h2 id=&quot;genetic-characterization-of-the-exceptionally-high-heat-resistance-of-the-non-toxic-surrogate-clostridium-sporogenes-pa-3679&quot;&gt;Genetic characterization of the exceptionally high heat resistance of the non-toxic surrogate Clostridium sporogenes PA 3679&lt;/h2&gt;
&lt;h4 id=&quot;robert-r-butler-iii-kristin-m-schill-yun-wang-jean-françois-pombert&quot;&gt;Robert R Butler III, Kristin M Schill, Yun Wang, Jean-François Pombert&lt;/h4&gt;
&lt;p&gt;Journal: Frontiers in Microbiology&lt;br /&gt;
PMID: &lt;a href=&quot;https://pubmed.ncbi.nlm.nih.gov/28421047&quot;&gt;28421047&lt;/a&gt;&lt;br /&gt;
DOI: &lt;a href=&quot;https://doi.org/10.3389/fmicb.2017.00545&quot;&gt;10.3389/fmicb.2017.00545&lt;/a&gt;&lt;/p&gt;</content><author><name>RRBIII</name></author><category term="pubs" /><category term="pubs" /><summary type="html">Genetic characterization of the exceptionally high heat resistance of the non-toxic surrogate Clostridium sporogenes PA 3679 Robert R Butler III, Kristin M Schill, Yun Wang, Jean-François Pombert Journal: Frontiers in Microbiology PMID: 28421047 DOI: 10.3389/fmicb.2017.00545</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://rbutleriii.github.io/gene-fron.png" /><media:content medium="image" url="https://rbutleriii.github.io/gene-fron.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>