Goal

Accuracy as a function of isotope incorporation

Variable parameters:

  • atom % isotope incorporation
    • 0, 25, 50, 100
  • % taxa that incorporate
    • 1, 5, 10, 25, 50
  • n-reps (stocastic: taxon abundances & which incorporate)
    • 10

Setting paths


In [138]:
# paths
import os

workDir = '/home/nick/notebook/SIPSim/dev/bac_genome1147/'
buildDir = os.path.join(workDir, 'atomIncorp_taxaIncorp')
R_dir = '/home/nick/notebook/SIPSim/lib/R/'

fragFile = '/home/nick/notebook/SIPSim/dev/bac_genome1147/validation/ampFrags_kde.pkl'
genome_index = '/var/seq_data/ncbi_db/genome/Jan2016/bac_complete_spec-rep1_rn/genome_index.txt'

Init


In [139]:
import glob
import itertools
import nestly

In [140]:
%load_ext rpy2.ipython
%load_ext pushnote


The rpy2.ipython extension is already loaded. To reload it, use:
  %reload_ext rpy2.ipython
The pushnote extension is already loaded. To reload it, use:
  %reload_ext pushnote

In [141]:
%%R
library(ggplot2)
library(dplyr)
library(tidyr)
library(gridExtra)

In [142]:
if not os.path.isdir(buildDir):
    os.makedirs(buildDir)
%cd $buildDir


/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp

BD min/max


In [143]:
## min G+C cutoff
min_GC = 13.5
## max G+C cutoff
max_GC = 80
## max G+C shift
max_13C_shift_in_BD = 0.036


min_BD = min_GC/100.0 * 0.098 + 1.66    
max_BD = max_GC/100.0 * 0.098 + 1.66    

max_BD = max_BD + max_13C_shift_in_BD

print 'Min BD: {}'.format(min_BD)
print 'Max BD: {}'.format(max_BD)


Min BD: 1.67323
Max BD: 1.7744

Nestly

  • assuming fragments already simulated

In [144]:
# making an experimental design file for qSIP
x = range(1,7)
y = ['control', 'treatment']

expDesignFile = os.path.join(buildDir, 'qSIP_exp_design.txt')
with open(expDesignFile, 'wb') as outFH:
    for i,z in itertools.izip(x,itertools.cycle(y)):
        line = '\t'.join([str(i),z])
        outFH.write(line + '\n')

!head $expDesignFile


1	control
2	treatment
3	control
4	treatment
5	control
6	treatment

Nestly params


In [170]:
# building tree structure
nest = nestly.Nest()

# varying params: test
#nest.add('percIncorp', [100])
#nest.add('percTaxa', [10])
#nest.add('rep', range(1,4))

# varying params
nest.add('percIncorp', [0, 15, 25, 50, 100])
nest.add('percTaxa', [1, 5, 10, 25, 50])
nest.add('rep', range(1,11))

## set params
nest.add('abs', ['1e9'], create_dir=False)
nest.add('np', [10], create_dir=False)
nest.add('Monte_rep', [100000], create_dir=False)
nest.add('subsample_dist', ['lognormal'], create_dir=False)
nest.add('subsample_mean', [9.432], create_dir=False)
nest.add('subsample_scale', [0.5], create_dir=False)
nest.add('subsample_min', [10000], create_dir=False)
nest.add('subsample_max', [30000], create_dir=False)
nest.add('min_BD', [min_BD], create_dir=False)
nest.add('max_BD', [max_BD], create_dir=False)
nest.add('DBL_scaling', [0.5], create_dir=False)
nest.add('bandwidth', [0.8], create_dir=False)
nest.add('heavy_BD_min', [1.71], create_dir=False)
nest.add('heavy_BD_max', [1.75], create_dir=False)
nest.add('topTaxaToPlot', [100], create_dir=False)
nest.add('padj', [0.1], create_dir=False)
nest.add('log2', [0.25], create_dir=False)

### input/output files
nest.add('buildDir', [buildDir], create_dir=False)
nest.add('R_dir', [R_dir], create_dir=False)
nest.add('genome_index', [genome_index], create_dir=False)
nest.add('fragFile', [fragFile], create_dir=False)
nest.add('exp_design', [expDesignFile], create_dir=False)


# building directory tree
nest.build(buildDir)

# bash file to run
bashFile = os.path.join(buildDir, 'SIPSimRun.sh')

Experimental design


In [179]:
bashFileTmp = os.path.splitext(bashFile)[0] + '_expDesign.sh'
bashFileTmp


Out[179]:
'/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_expDesign.sh'

In [180]:
%%writefile $bashFileTmp
#!/bin/bash

echo '#-- Experimental design --#'

echo '# Making an isotope incorporation config file'
echo '## 3 replicate gradients for control & treatment'
SIPSim incorpConfigExample \
  --percIncorpUnif {percIncorp} \
  --n_reps 3 \
  > incorp.config

echo '# Selecting incorporator taxa'
echo '## This is to make the gradient replicates consistent (qSIP finds mean among replicates)'
SIPSim KDE_selectTaxa \
    -p {percTaxa} \
    {fragFile} \
    > incorporators.txt

echo '# Creating a community file (3 replicate control, 3 replicate treatment)'
SIPSim communities \
    --config incorp.config \
    {genome_index} \
    > comm.txt    

echo '# simulating gradient fractions'
SIPSim gradient_fractions \
    --BD_min {min_BD} \
    --BD_max {max_BD} \
    comm.txt \
    > fracs.txt


Writing /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_expDesign.sh

In [51]:
!chmod 777 $bashFileTmp
!cd $workDir; \
    nestrun --template-file $bashFileTmp -d $buildDir --log-file exp_design.log -j 10


2016-03-28 06:59:24,041 * INFO * Template: ./SIPSimRun.sh
2016-03-28 06:59:24,043 * INFO * [145094] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/7
2016-03-28 06:59:24,044 * INFO * [145095] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/9
2016-03-28 06:59:24,045 * INFO * [145097] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/8
2016-03-28 06:59:24,047 * INFO * [145099] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/3
2016-03-28 06:59:24,048 * INFO * [145101] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/10
2016-03-28 06:59:24,050 * INFO * [145103] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/2
2016-03-28 06:59:24,052 * INFO * [145105] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/1
2016-03-28 06:59:24,054 * INFO * [145107] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/4
2016-03-28 06:59:24,056 * INFO * [145109] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/5
2016-03-28 06:59:24,058 * INFO * [145111] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/6
2016-03-28 06:59:31,558 * INFO * [145109] atomIncorp_taxaIncorp/50/50/5 Finished with 0
2016-03-28 06:59:31,560 * INFO * [146304] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/7
2016-03-28 06:59:31,560 * INFO * [145094] atomIncorp_taxaIncorp/50/50/7 Finished with 0
2016-03-28 06:59:31,562 * INFO * [146305] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/9
2016-03-28 06:59:31,562 * INFO * [145095] atomIncorp_taxaIncorp/50/50/9 Finished with 0
2016-03-28 06:59:31,563 * INFO * [146307] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/8
2016-03-28 06:59:31,563 * INFO * [145097] atomIncorp_taxaIncorp/50/50/8 Finished with 0
2016-03-28 06:59:31,565 * INFO * [146309] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/3
2016-03-28 06:59:31,565 * INFO * [145099] atomIncorp_taxaIncorp/50/50/3 Finished with 0
2016-03-28 06:59:31,566 * INFO * [146311] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/10
2016-03-28 06:59:31,566 * INFO * [145101] atomIncorp_taxaIncorp/50/50/10 Finished with 0
2016-03-28 06:59:31,568 * INFO * [146313] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/2
2016-03-28 06:59:31,568 * INFO * [145103] atomIncorp_taxaIncorp/50/50/2 Finished with 0
2016-03-28 06:59:31,569 * INFO * [146315] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/1
2016-03-28 06:59:31,569 * INFO * [145105] atomIncorp_taxaIncorp/50/50/1 Finished with 0
2016-03-28 06:59:31,570 * INFO * [146317] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/4
2016-03-28 06:59:31,571 * INFO * [145111] atomIncorp_taxaIncorp/50/50/6 Finished with 0
2016-03-28 06:59:31,572 * INFO * [146319] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/5
2016-03-28 06:59:31,573 * INFO * [145107] atomIncorp_taxaIncorp/50/50/4 Finished with 0
2016-03-28 06:59:31,574 * INFO * [146321] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/6
2016-03-28 06:59:36,359 * INFO * [146309] atomIncorp_taxaIncorp/50/25/3 Finished with 0
2016-03-28 06:59:36,361 * INFO * [147422] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/7
2016-03-28 06:59:36,383 * INFO * [146319] atomIncorp_taxaIncorp/50/25/5 Finished with 0
2016-03-28 06:59:36,385 * INFO * [147424] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/9
2016-03-28 06:59:36,404 * INFO * [146321] atomIncorp_taxaIncorp/50/25/6 Finished with 0
2016-03-28 06:59:36,406 * INFO * [147426] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/8
2016-03-28 06:59:36,456 * INFO * [146317] atomIncorp_taxaIncorp/50/25/4 Finished with 0
2016-03-28 06:59:36,457 * INFO * [147439] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/3
2016-03-28 06:59:36,470 * INFO * [146305] atomIncorp_taxaIncorp/50/25/9 Finished with 0
2016-03-28 06:59:36,471 * INFO * [147441] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/10
2016-03-28 06:59:36,488 * INFO * [146315] atomIncorp_taxaIncorp/50/25/1 Finished with 0
2016-03-28 06:59:36,490 * INFO * [147443] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/2
2016-03-28 06:59:36,540 * INFO * [146307] atomIncorp_taxaIncorp/50/25/8 Finished with 0
2016-03-28 06:59:36,541 * INFO * [147447] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/1
2016-03-28 06:59:36,550 * INFO * [146313] atomIncorp_taxaIncorp/50/25/2 Finished with 0
2016-03-28 06:59:36,552 * INFO * [147449] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/4
2016-03-28 06:59:36,604 * INFO * [146304] atomIncorp_taxaIncorp/50/25/7 Finished with 0
2016-03-28 06:59:36,606 * INFO * [147452] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/5
2016-03-28 06:59:36,783 * INFO * [146311] atomIncorp_taxaIncorp/50/25/10 Finished with 0
2016-03-28 06:59:36,784 * INFO * [147526] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/6
2016-03-28 06:59:41,169 * INFO * [147424] atomIncorp_taxaIncorp/50/10/9 Finished with 0
2016-03-28 06:59:41,170 * INFO * [148493] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/7
2016-03-28 06:59:41,303 * INFO * [147441] atomIncorp_taxaIncorp/50/10/10 Finished with 0
2016-03-28 06:59:41,304 * INFO * [148534] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/9
2016-03-28 06:59:41,412 * INFO * [147422] atomIncorp_taxaIncorp/50/10/7 Finished with 0
2016-03-28 06:59:41,413 * INFO * [148554] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/8
2016-03-28 06:59:41,455 * INFO * [147439] atomIncorp_taxaIncorp/50/10/3 Finished with 0
2016-03-28 06:59:41,456 * INFO * [148567] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/3
2016-03-28 06:59:41,462 * INFO * [147426] atomIncorp_taxaIncorp/50/10/8 Finished with 0
2016-03-28 06:59:41,465 * INFO * [148569] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/10
2016-03-28 06:59:41,573 * INFO * [147447] atomIncorp_taxaIncorp/50/10/1 Finished with 0
2016-03-28 06:59:41,575 * INFO * [148576] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/2
2016-03-28 06:59:41,640 * INFO * [147452] atomIncorp_taxaIncorp/50/10/5 Finished with 0
2016-03-28 06:59:41,642 * INFO * [148588] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/1
2016-03-28 06:59:41,665 * INFO * [147443] atomIncorp_taxaIncorp/50/10/2 Finished with 0
2016-03-28 06:59:41,667 * INFO * [148592] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/4
2016-03-28 06:59:41,786 * INFO * [147449] atomIncorp_taxaIncorp/50/10/4 Finished with 0
2016-03-28 06:59:41,787 * INFO * [148643] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/5
2016-03-28 06:59:42,050 * INFO * [147526] atomIncorp_taxaIncorp/50/10/6 Finished with 0
2016-03-28 06:59:42,052 * INFO * [148706] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/1/6
2016-03-28 06:59:45,927 * INFO * [148493] atomIncorp_taxaIncorp/50/1/7 Finished with 0
2016-03-28 06:59:45,928 * INFO * [149529] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/7
2016-03-28 06:59:46,311 * INFO * [148534] atomIncorp_taxaIncorp/50/1/9 Finished with 0
2016-03-28 06:59:46,313 * INFO * [149631] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/9
2016-03-28 06:59:46,318 * INFO * [148554] atomIncorp_taxaIncorp/50/1/8 Finished with 0
2016-03-28 06:59:46,320 * INFO * [149634] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/8
2016-03-28 06:59:46,544 * INFO * [148592] atomIncorp_taxaIncorp/50/1/4 Finished with 0
2016-03-28 06:59:46,545 * INFO * [149698] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/3
2016-03-28 06:59:46,684 * INFO * [148569] atomIncorp_taxaIncorp/50/1/10 Finished with 0
2016-03-28 06:59:46,686 * INFO * [149755] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/10
2016-03-28 06:59:46,735 * INFO * [148643] atomIncorp_taxaIncorp/50/1/5 Finished with 0
2016-03-28 06:59:46,737 * INFO * [149757] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/2
2016-03-28 06:59:46,782 * INFO * [148706] atomIncorp_taxaIncorp/50/1/6 Finished with 0
2016-03-28 06:59:46,784 * INFO * [149759] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/1
2016-03-28 06:59:46,854 * INFO * [148567] atomIncorp_taxaIncorp/50/1/3 Finished with 0
2016-03-28 06:59:46,855 * INFO * [149776] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/4
2016-03-28 06:59:46,890 * INFO * [148576] atomIncorp_taxaIncorp/50/1/2 Finished with 0
2016-03-28 06:59:46,891 * INFO * [149778] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/5
2016-03-28 06:59:46,935 * INFO * [148588] atomIncorp_taxaIncorp/50/1/1 Finished with 0
2016-03-28 06:59:46,936 * INFO * [149781] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/5/6
2016-03-28 06:59:50,644 * INFO * [149529] atomIncorp_taxaIncorp/50/5/7 Finished with 0
2016-03-28 06:59:50,646 * INFO * [150608] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/50/7
2016-03-28 06:59:51,097 * INFO * [149631] atomIncorp_taxaIncorp/50/5/9 Finished with 0
2016-03-28 06:59:51,098 * INFO * [150719] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/50/9
2016-03-28 06:59:51,317 * INFO * [149634] atomIncorp_taxaIncorp/50/5/8 Finished with 0
2016-03-28 06:59:51,319 * INFO * [150782] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/50/8
2016-03-28 06:59:51,536 * INFO * [149759] atomIncorp_taxaIncorp/50/5/1 Finished with 0
2016-03-28 06:59:51,538 * INFO * [150821] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/50/3
2016-03-28 06:59:51,602 * INFO * [149757] atomIncorp_taxaIncorp/50/5/2 Finished with 0
2016-03-28 06:59:51,604 * INFO * [150846] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/50/10
2016-03-28 06:59:51,653 * INFO * [149778] atomIncorp_taxaIncorp/50/5/5 Finished with 0
2016-03-28 06:59:51,655 * INFO * [150859] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/50/2
2016-03-28 06:59:51,769 * INFO * [149698] atomIncorp_taxaIncorp/50/5/3 Finished with 0
2016-03-28 06:59:51,771 * INFO * [150878] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/50/1
2016-03-28 06:59:51,976 * INFO * [149755] atomIncorp_taxaIncorp/50/5/10 Finished with 0
2016-03-28 06:59:51,978 * INFO * [150955] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/50/4
**OUTPUT MUTED**

In [52]:
%pushnote exp_design complete: $buildDir

SIPSim pipeline


In [182]:
bashFileTmp = os.path.splitext(bashFile)[0] + '_SIPSim-pipeline.sh'
bashFileTmp


Out[182]:
'/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_SIPSim-pipeline.sh'

In [183]:
%%writefile $bashFileTmp
#!/bin/bash

echo '#-- SIPSim pipeline --#'    
    
echo '# Adding diffusion'    
SIPSim diffusion \
    -n {Monte_rep} \
    --bw {bandwidth} \
    --np {np} \
    {fragFile} \
    > ampFrags_KDE_dif.pkl    

echo '# Adding DBL contamination; abundance-weighted smearing'
SIPSim DBL \
    -n {Monte_rep} \
    --comm comm.txt \
    --commx {DBL_scaling} \
    --np {np} \
    ampFrags_KDE_dif.pkl \
    > ampFrags_KDE_dif_DBL.pkl 

echo '# Adding isotope incorporation to BD distribution'
SIPSim isotope_incorp \
    -n {Monte_rep} \
    --comm comm.txt \
    --taxa incorporators.txt \
    --np {np} \
    ampFrags_KDE_dif_DBL.pkl \
    incorp.config \
    > ampFrags_KDE_dif_DBL_inc.pkl

echo '# Simulating an OTU table'
SIPSim OTU_table \
    --abs {abs} \
    --np {np} \
    ampFrags_KDE_dif_DBL_inc.pkl \
    comm.txt \
    fracs.txt \
    > OTU_abs{abs}.txt
    
echo '# Simulating PCR'
SIPSim OTU_PCR \
    OTU_abs{abs}.txt \
    > OTU_abs{abs}_PCR.txt    
    
echo '# Subsampling from the OTU table (simulating sequencing of the DNA pool)'
SIPSim OTU_subsample \
    --dist {subsample_dist} \
    --dist_params mean:{subsample_mean},sigma:{subsample_scale} \
    --min_size {subsample_min} \
    --max_size {subsample_max} \
    OTU_abs{abs}_PCR.txt \
    > OTU_abs{abs}_PCR_sub.txt
        
echo '# Making a wide-formatted table'
SIPSim OTU_wideLong -w \
    OTU_abs{abs}_PCR_sub.txt \
    > OTU_abs{abs}_PCR_sub_w.txt
    
echo '# Making metadata (phyloseq: sample_data)'
SIPSim OTU_sampleData \
    OTU_abs{abs}_PCR_sub.txt \
    > OTU_abs{abs}_PCR_sub_meta.txt
       

#-- removing large intermediate files --#
rm -f ampFrags_KDE_dif.pkl
rm -f ampFrags_KDE_dif_DBL.pkl
rm -f ampFrags_KDE_dif_DBL_inc.pkl


Writing /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_SIPSim-pipeline.sh

In [ ]:
!chmod 777 $bashFileTmp
!cd $workDir; \
    nestrun --template-file $bashFileTmp -d $buildDir --log-file SIPSim_pipeline.log -j 2


2016-03-28 07:01:04,305 * INFO * Template: ./SIPSimRun.sh
2016-03-28 07:01:04,307 * INFO * [167960] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/7
2016-03-28 07:01:04,308 * INFO * [167961] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/9
2016-03-28 07:32:58,553 * INFO * [167961] atomIncorp_taxaIncorp/50/50/9 Finished with 0
2016-03-28 07:32:58,631 * INFO * [168813] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/8
2016-03-28 07:38:10,926 * INFO * [167960] atomIncorp_taxaIncorp/50/50/7 Finished with 0
2016-03-28 07:38:10,952 * INFO * [169053] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/3
2016-03-28 08:06:02,932 * INFO * [168813] atomIncorp_taxaIncorp/50/50/8 Finished with 0
2016-03-28 08:06:02,954 * INFO * [170001] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/10
2016-03-28 08:08:42,327 * INFO * [169053] atomIncorp_taxaIncorp/50/50/3 Finished with 0
2016-03-28 08:08:42,345 * INFO * [170196] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/2
2016-03-28 08:39:03,498 * INFO * [170001] atomIncorp_taxaIncorp/50/50/10 Finished with 0
2016-03-28 08:39:03,540 * INFO * [172697] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/1
2016-03-28 08:42:20,119 * INFO * [170196] atomIncorp_taxaIncorp/50/50/2 Finished with 0
2016-03-28 08:42:20,144 * INFO * [172903] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/4
2016-03-28 09:11:29,884 * INFO * [172697] atomIncorp_taxaIncorp/50/50/1 Finished with 0
2016-03-28 09:11:29,930 * INFO * [174904] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/5
2016-03-28 09:17:00,806 * INFO * [172903] atomIncorp_taxaIncorp/50/50/4 Finished with 0
2016-03-28 09:17:00,828 * INFO * [175238] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/50/6
2016-03-28 09:42:28,383 * INFO * [174904] atomIncorp_taxaIncorp/50/50/5 Finished with 0
2016-03-28 09:42:28,440 * INFO * [177635] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/7
2016-03-28 09:51:10,453 * INFO * [175238] atomIncorp_taxaIncorp/50/50/6 Finished with 0
2016-03-28 09:51:10,470 * INFO * [178973] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/9
2016-03-28 10:14:14,309 * INFO * [177635] atomIncorp_taxaIncorp/50/25/7 Finished with 0
2016-03-28 10:14:14,323 * INFO * [180787] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/8
2016-03-28 10:23:30,493 * INFO * [178973] atomIncorp_taxaIncorp/50/25/9 Finished with 0
2016-03-28 10:23:30,520 * INFO * [181770] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/3
2016-03-28 10:48:40,206 * INFO * [180787] atomIncorp_taxaIncorp/50/25/8 Finished with 0
2016-03-28 10:48:40,227 * INFO * [184107] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/10
2016-03-28 10:52:40,062 * INFO * [181770] atomIncorp_taxaIncorp/50/25/3 Finished with 0
2016-03-28 10:52:40,075 * INFO * [184731] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/2
2016-03-28 11:18:14,366 * INFO * [184107] atomIncorp_taxaIncorp/50/25/10 Finished with 0
2016-03-28 11:18:14,402 * INFO * [185986] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/1
2016-03-28 11:23:56,213 * INFO * [184731] atomIncorp_taxaIncorp/50/25/2 Finished with 0
2016-03-28 11:23:56,215 * INFO * [186585] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/4
2016-03-28 11:51:12,603 * INFO * [185986] atomIncorp_taxaIncorp/50/25/1 Finished with 0
2016-03-28 11:51:12,635 * INFO * [187437] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/5
2016-03-28 11:56:17,298 * INFO * [186585] atomIncorp_taxaIncorp/50/25/4 Finished with 0
2016-03-28 11:56:17,300 * INFO * [187618] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/25/6
2016-03-28 12:23:02,834 * INFO * [187437] atomIncorp_taxaIncorp/50/25/5 Finished with 0
2016-03-28 12:23:02,879 * INFO * [188816] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/7
2016-03-28 12:28:43,567 * INFO * [187618] atomIncorp_taxaIncorp/50/25/6 Finished with 0
2016-03-28 12:28:43,569 * INFO * [189023] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/9
2016-03-28 12:54:16,127 * INFO * [188816] atomIncorp_taxaIncorp/50/10/7 Finished with 0
2016-03-28 12:54:16,136 * INFO * [190833] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/8
2016-03-28 13:02:31,121 * INFO * [189023] atomIncorp_taxaIncorp/50/10/9 Finished with 0
2016-03-28 13:02:31,148 * INFO * [191102] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/50/10/3
2016-03-29 07:06:36,686 * INFO * [228676] atomIncorp_taxaIncorp/0/1/5 Finished with 0
2016-03-29 07:06:36,688 * INFO * [231931] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/7
2016-03-29 07:13:50,275 * INFO * [229034] atomIncorp_taxaIncorp/0/1/6 Finished with 0
2016-03-29 07:13:50,297 * INFO * [232285] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/9
2016-03-29 07:40:20,328 * INFO * [231931] atomIncorp_taxaIncorp/0/5/7 Finished with 0
2016-03-29 07:40:20,374 * INFO * [233543] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/8
2016-03-29 07:47:19,857 * INFO * [232285] atomIncorp_taxaIncorp/0/5/9 Finished with 0
2016-03-29 07:47:19,887 * INFO * [233740] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/3
2016-03-29 08:16:14,651 * INFO * [233543] atomIncorp_taxaIncorp/0/5/8 Finished with 0
2016-03-29 08:16:14,718 * INFO * [234489] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/10
2016-03-29 08:24:10,756 * INFO * [233740] atomIncorp_taxaIncorp/0/5/3 Finished with 0
2016-03-29 08:24:10,770 * INFO * [234721] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/2
2016-03-29 08:50:49,669 * INFO * [234489] atomIncorp_taxaIncorp/0/5/10 Finished with 0
2016-03-29 08:50:49,731 * INFO * [235565] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/1
2016-03-29 08:57:11,648 * INFO * [234721] atomIncorp_taxaIncorp/0/5/2 Finished with 0
2016-03-29 08:57:11,663 * INFO * [235763] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/4
2016-03-29 09:21:34,748 * INFO * [235565] atomIncorp_taxaIncorp/0/5/1 Finished with 0
2016-03-29 09:21:34,783 * INFO * [236454] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/5
2016-03-29 09:26:49,715 * INFO * [235763] atomIncorp_taxaIncorp/0/5/4 Finished with 0
2016-03-29 09:26:49,718 * INFO * [236630] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/0/5/6
2016-03-29 09:52:04,756 * INFO * [236454] atomIncorp_taxaIncorp/0/5/5 Finished with 0
2016-03-29 09:52:04,775 * INFO * [237192] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/100/50/7
2016-03-29 09:55:02,245 * INFO * [236630] atomIncorp_taxaIncorp/0/5/6 Finished with 0
2016-03-29 09:55:02,260 * INFO * [237351] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/100/50/9
2016-03-29 10:23:46,918 * INFO * [237192] atomIncorp_taxaIncorp/100/50/7 Finished with 0
2016-03-29 10:23:46,931 * INFO * [237876] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/100/50/8
2016-03-29 10:24:06,294 * INFO * [237351] atomIncorp_taxaIncorp/100/50/9 Finished with 0
2016-03-29 10:24:06,311 * INFO * [238012] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/100/50/3
2016-03-29 10:54:35,039 * INFO * [238012] atomIncorp_taxaIncorp/100/50/3 Finished with 0
2016-03-29 10:54:35,052 * INFO * [239073] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/100/50/10
2016-03-29 10:56:01,736 * INFO * [237876] atomIncorp_taxaIncorp/100/50/8 Finished with 0
2016-03-29 10:56:01,749 * INFO * [239249] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/100/50/2
2016-03-29 11:22:36,439 * INFO * [239073] atomIncorp_taxaIncorp/100/50/10 Finished with 0
2016-03-29 11:22:36,453 * INFO * [239804] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/100/50/1
2016-03-29 11:29:09,128 * INFO * [239249] atomIncorp_taxaIncorp/100/50/2 Finished with 0
2016-03-29 11:29:09,143 * INFO * [240743] Started ./SIPSimRun.sh in atomIncorp_taxaIncorp/100/50/4

In [ ]:
%pushnote SIPSim pipeline complete: $buildDir

Summary of simulated data


In [198]:
bashFileTmp = os.path.splitext(bashFile)[0] + '_SIPSim-summary.sh'
bashFileTmp


Out[198]:
'/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_SIPSim-summary.sh'

In [199]:
%%writefile $bashFileTmp
#!/bin/bash
   
# plotting 'raw' taxon abundances
SIPSimR OTU_taxonAbund \
    OTU_abs{abs}.txt \
    -r {topTaxaToPlot} \
    -o OTU_abs{abs}

# plotting 'sequenced' taxon abundances
SIPSimR OTU_taxonAbund \
    OTU_abs{abs}_PCR_sub.txt \
    -r {topTaxaToPlot} \
    -o OTU_abs{abs}_PCR_sub


Writing /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_SIPSim-summary.sh

In [ ]:
!chmod 777 $bashFileTmp
!cd $workDir; \
    nestrun --template-file $bashFileTmp -d $buildDir --log-file SIPSim_summary.log -j 10

HR-SIP: DESeq2


In [176]:
bashFileTmp = os.path.splitext(bashFile)[0] + '_HRSIP.sh'
bashFileTmp


Out[176]:
'/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_HRSIP.sh'

In [177]:
%%writefile $bashFileTmp
#!/bin/bash

# phyloseq
## making phyloseq object from OTU table
SIPSimR phyloseq_make \
    OTU_abs{abs}_PCR_sub_w.txt \
    -s OTU_abs{abs}_PCR_sub_meta.txt \
    > OTU_abs{abs}_PCR_sub.physeq

## filtering phyloseq object to just 'heavy' fractions
SIPSimR phyloseq_edit \
    OTU_abs{abs}_PCR_sub.physeq \
    --BD_min {heavy_BD_min} \
    --BD_max {heavy_BD_max} \
    > OTU_abs{abs}_PCR_sub_filt.physeq

## making ordination
SIPSimR phyloseq_ordination \
    OTU_abs{abs}_PCR_sub_filt.physeq \
    OTU_abs{abs}_PCR_sub_filt_bray-NMDS.pdf

# DESeq2
SIPSimR phyloseq_DESeq2 \
    --log2 {log2} \
    --hypo greater \
    --cont 1,3,5 \
    --treat 2,4,6 \
    OTU_abs{abs}_PCR_sub_filt.physeq \
    > OTU_abs{abs}_PCR_sub_filt_DESeq2


Overwriting /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_HRSIP.sh

In [178]:
!chmod 777 $bashFileTmp
!cd $workDir; \
    nestrun --template-file $bashFileTmp -d $buildDir --log-file HR-SIP.log -j 14


2016-05-15 09:40:23,227 * INFO * Template: ./SIPSimRun_HRSIP.sh
2016-05-15 09:40:23,247 * INFO * [22025] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/7
2016-05-15 09:40:23,268 * INFO * [22027] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/9
2016-05-15 09:40:23,269 * INFO * [22028] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/8
2016-05-15 09:40:23,271 * INFO * [22030] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/3
2016-05-15 09:40:23,274 * INFO * [22032] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/10
2016-05-15 09:40:23,297 * INFO * [22035] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/2
2016-05-15 09:40:23,299 * INFO * [22036] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/1
2016-05-15 09:40:23,302 * INFO * [22038] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/4
2016-05-15 09:40:23,332 * INFO * [22041] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/5
2016-05-15 09:40:23,334 * INFO * [22042] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/6
2016-05-15 09:40:23,337 * INFO * [22044] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/7
2016-05-15 09:40:23,339 * INFO * [22046] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/9
2016-05-15 09:40:23,342 * INFO * [22048] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/8
2016-05-15 09:40:23,344 * INFO * [22049] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/3
2016-05-15 09:41:16,867 * INFO * [22044] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/7 Finished with 0
2016-05-15 09:41:16,869 * INFO * [23767] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/10
2016-05-15 09:41:17,020 * INFO * [22049] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/3 Finished with 0
2016-05-15 09:41:17,023 * INFO * [23771] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/2
2016-05-15 09:41:17,180 * INFO * [22041] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/5 Finished with 0
2016-05-15 09:41:17,181 * INFO * [23779] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/1
2016-05-15 09:41:17,303 * INFO * [22038] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/4 Finished with 0
2016-05-15 09:41:17,305 * INFO * [23783] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/4
2016-05-15 09:41:17,730 * INFO * [22036] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/1 Finished with 0
2016-05-15 09:41:17,732 * INFO * [23850] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/5
2016-05-15 09:41:17,798 * INFO * [22025] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/7 Finished with 0
2016-05-15 09:41:17,800 * INFO * [23856] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/6
2016-05-15 09:41:17,800 * INFO * [22048] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/8 Finished with 0
2016-05-15 09:41:17,802 * INFO * [23857] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/7
2016-05-15 09:41:18,023 * INFO * [22027] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/9 Finished with 0
2016-05-15 09:41:18,027 * INFO * [23876] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/9
2016-05-15 09:41:18,163 * INFO * [22032] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/10 Finished with 0
2016-05-15 09:41:18,166 * INFO * [23903] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/8
2016-05-15 09:41:18,244 * INFO * [22028] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/8 Finished with 0
2016-05-15 09:41:18,245 * INFO * [23916] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/3
2016-05-15 09:41:18,592 * INFO * [22035] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/2 Finished with 0
2016-05-15 09:41:18,594 * INFO * [23964] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/10
2016-05-15 09:41:18,983 * INFO * [22046] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/9 Finished with 0
2016-05-15 09:41:18,997 * INFO * [24011] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/2
2016-05-15 09:41:19,265 * INFO * [22042] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/6 Finished with 0
2016-05-15 09:41:19,267 * INFO * [24039] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/1
2016-05-15 09:41:19,898 * INFO * [22030] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/3 Finished with 0
2016-05-15 09:41:19,900 * INFO * [24081] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/4
2016-05-15 09:42:05,937 * INFO * [23767] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/10 Finished with 0
2016-05-15 09:42:05,938 * INFO * [25563] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/5
2016-05-15 09:42:06,363 * INFO * [23916] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/3 Finished with 0
2016-05-15 09:42:06,365 * INFO * [25569] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/6
2016-05-15 09:42:06,828 * INFO * [23783] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/4 Finished with 0
2016-05-15 09:42:06,830 * INFO * [25605] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/7
2016-05-15 09:42:07,110 * INFO * [23903] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/8 Finished with 0
2016-05-15 09:42:07,114 * INFO * [25623] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/9
2016-05-15 09:42:07,143 * INFO * [23857] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/7 Finished with 0
2016-05-15 09:42:07,145 * INFO * [25625] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/8
2016-05-15 09:42:07,427 * INFO * [23779] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/1 Finished with 0
2016-05-15 09:42:07,428 * INFO * [25647] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/3
2016-05-15 09:42:07,490 * INFO * [23771] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/2 Finished with 0
2016-05-15 09:42:07,493 * INFO * [25650] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/10
2016-05-15 09:42:07,822 * INFO * [23876] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/9 Finished with 0
2016-05-15 09:42:07,824 * INFO * [25707] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/2
2016-05-15 09:42:07,836 * INFO * [24011] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/2 Finished with 0
2016-05-15 09:42:07,838 * INFO * [25709] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/1
2016-05-15 09:42:08,280 * INFO * [23850] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/5 Finished with 0
2016-05-15 09:42:08,282 * INFO * [25761] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/4
2016-05-15 09:42:08,637 * INFO * [23964] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/10 Finished with 0
2016-05-15 09:42:08,643 * INFO * [25800] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/5
2016-05-15 09:42:09,131 * INFO * [24039] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/1 Finished with 0
2016-05-15 09:42:09,133 * INFO * [25842] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/6
2016-05-15 09:42:09,267 * INFO * [23856] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/6 Finished with 0
2016-05-15 09:42:09,269 * INFO * [25848] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/5/7
2016-05-15 09:42:09,309 * INFO * [24081] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/4 Finished with 0
2016-05-15 09:42:09,311 * INFO * [25850] Started ./SIPSimRun_HRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/5/9
**OUTPUT MUTED**

In [179]:
%pushnote HR-SIP complete: $buildDir

MW-HR-SIP

  • BD windows: 1.70-1.73,1.72-1.75,1.74-1.77

In [161]:
bashFileTmp = os.path.splitext(bashFile)[0] + '_MWHRSIP.sh'
bashFileTmp


Out[161]:
'/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_MWHRSIP.sh'

In [162]:
%%writefile $bashFileTmp
#!/bin/bash

## HR SIP pipeline
SIPSimR phyloseq_DESeq2 \
    --log2 {log2} \
    --hypo greater \
    --cont 1,3,5 \
    --treat 2,4,6 \
    --occur_all 0.0,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5 \
    -w 1.70-1.73,1.72-1.75,1.74-1.77 \
    --all OTU_abs1e9_PCR_sub_MW-all.txt \
    OTU_abs{abs}_PCR_sub.physeq \
    > OTU_abs{abs}_PCR_sub_filt_MW_DESeq2


Writing /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_MWHRSIP.sh

In [163]:
!chmod 777 $bashFileTmp
!cd $workDir; \
    nestrun --template-file $bashFileTmp -d $buildDir --log-file MW-HR-SIP.log -j 14


2016-05-15 08:34:42,203 * INFO * Template: ./SIPSimRun_MWHRSIP.sh
2016-05-15 08:34:42,225 * INFO * [195697] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/7
2016-05-15 08:34:42,227 * INFO * [195698] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/9
2016-05-15 08:34:42,231 * INFO * [195700] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/8
2016-05-15 08:34:42,235 * INFO * [195702] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/3
2016-05-15 08:34:42,239 * INFO * [195704] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/10
2016-05-15 08:34:42,243 * INFO * [195706] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/2
2016-05-15 08:34:42,245 * INFO * [195708] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/1
2016-05-15 08:34:42,247 * INFO * [195710] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/4
2016-05-15 08:34:42,249 * INFO * [195713] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/5
2016-05-15 08:34:42,250 * INFO * [195714] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/6
2016-05-15 08:34:42,255 * INFO * [195717] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/7
2016-05-15 08:34:42,257 * INFO * [195718] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/9
2016-05-15 08:34:42,258 * INFO * [195720] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/8
2016-05-15 08:34:42,260 * INFO * [195722] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/3
2016-05-15 08:36:24,204 * INFO * [195720] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/8 Finished with 0
2016-05-15 08:36:24,206 * INFO * [196145] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/10
2016-05-15 08:36:24,986 * INFO * [195706] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/2 Finished with 0
2016-05-15 08:36:24,988 * INFO * [196170] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/2
2016-05-15 08:36:29,417 * INFO * [195714] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/6 Finished with 0
2016-05-15 08:36:29,418 * INFO * [196209] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/1
2016-05-15 08:36:29,761 * INFO * [195713] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/5 Finished with 0
2016-05-15 08:36:29,763 * INFO * [196226] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/4
2016-05-15 08:36:32,257 * INFO * [195698] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/9 Finished with 0
2016-05-15 08:36:32,258 * INFO * [196269] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/5
2016-05-15 08:36:32,288 * INFO * [195697] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/7 Finished with 0
2016-05-15 08:36:32,290 * INFO * [196271] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/6
2016-05-15 08:36:35,355 * INFO * [195708] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/1 Finished with 0
2016-05-15 08:36:35,357 * INFO * [196331] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/7
2016-05-15 08:36:35,365 * INFO * [195710] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/4 Finished with 0
2016-05-15 08:36:35,367 * INFO * [196333] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/9
2016-05-15 08:36:36,324 * INFO * [195717] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/7 Finished with 0
2016-05-15 08:36:36,326 * INFO * [196377] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/8
2016-05-15 08:36:37,290 * INFO * [195722] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/3 Finished with 0
2016-05-15 08:36:37,291 * INFO * [196414] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/3
2016-05-15 08:36:38,733 * INFO * [195704] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/10 Finished with 0
2016-05-15 08:36:38,735 * INFO * [196439] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/10
2016-05-15 08:36:39,045 * INFO * [195700] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/8 Finished with 0
2016-05-15 08:36:39,047 * INFO * [196445] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/2
2016-05-15 08:36:40,010 * INFO * [195718] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/9 Finished with 0
2016-05-15 08:36:40,012 * INFO * [196489] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/1
2016-05-15 08:36:41,169 * INFO * [195702] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/3 Finished with 0
2016-05-15 08:36:41,171 * INFO * [196526] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/4
2016-05-15 08:38:10,199 * INFO * [196145] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/10 Finished with 0
2016-05-15 08:38:10,200 * INFO * [196604] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/5
2016-05-15 08:38:10,370 * INFO * [196170] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/2 Finished with 0
2016-05-15 08:38:10,371 * INFO * [196610] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/6
2016-05-15 08:38:12,813 * INFO * [196377] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/8 Finished with 0
2016-05-15 08:38:12,814 * INFO * [196654] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/7
2016-05-15 08:38:15,380 * INFO * [196209] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/1 Finished with 0
2016-05-15 08:38:15,382 * INFO * [196691] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/9
2016-05-15 08:38:18,713 * INFO * [196269] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/5 Finished with 0
2016-05-15 08:38:18,714 * INFO * [196722] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/8
2016-05-15 08:38:19,561 * INFO * [196226] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/4 Finished with 0
2016-05-15 08:38:19,563 * INFO * [196755] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/3
2016-05-15 08:38:21,744 * INFO * [196271] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/6 Finished with 0
2016-05-15 08:38:21,746 * INFO * [196786] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/10
2016-05-15 08:38:22,477 * INFO * [196333] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/9 Finished with 0
2016-05-15 08:38:22,478 * INFO * [196811] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/2
2016-05-15 08:38:26,247 * INFO * [196331] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/7 Finished with 0
2016-05-15 08:38:26,249 * INFO * [196856] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/1
2016-05-15 08:38:26,292 * INFO * [196489] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/1 Finished with 0
2016-05-15 08:38:26,294 * INFO * [196858] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/4
2016-05-15 08:38:26,298 * INFO * [196414] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/3 Finished with 0
2016-05-15 08:38:26,300 * INFO * [196860] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/5
2016-05-15 08:38:28,310 * INFO * [196526] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/4 Finished with 0
2016-05-15 08:38:28,312 * INFO * [196967] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/6
2016-05-15 08:38:29,005 * INFO * [196439] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/10 Finished with 0
2016-05-15 08:38:29,007 * INFO * [196992] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/5/7
2016-05-15 08:38:30,146 * INFO * [196445] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/2 Finished with 0
2016-05-15 08:38:30,147 * INFO * [197017] Started ./SIPSimRun_MWHRSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/5/9
**OUTPUT MUTED**

In [164]:
%pushnote MW-HR-SIP complete: $buildDir

qSIP


In [105]:
bashFileTmp = os.path.splitext(bashFile)[0] + '_qSIP.sh'
bashFileTmp


Out[105]:
'/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_qSIP.sh'

In [106]:
%%writefile $bashFileTmp
#!/bin/bash


# qSIP
SIPSim qSIP \
    OTU_abs{abs}.txt \
    OTU_abs{abs}_PCR_sub.txt \
    > OTU_abs{abs}_PCR_sub_qSIP.txt
        

# qSIP: atom excess
SIPSim qSIP_atomExcess \
    --np {np} \
    OTU_abs{abs}_PCR_sub_qSIP.txt \
    {exp_design} \
    > OTU_abs{abs}_PCR_sub_qSIP_atom.txt


Overwriting /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_qSIP.sh

In [ ]:
!chmod 777 $bashFileTmp
!cd $workDir; \
    nestrun --template-file $bashFileTmp -d $buildDir --log-file qSIP.log -j 2


2016-04-07 13:06:21,844 * INFO * Template: ./SIPSimRun_qSIP.sh
2016-04-07 13:06:21,867 * INFO * [116857] Started ./SIPSimRun_qSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/7
2016-04-07 13:06:21,874 * INFO * [116859] Started ./SIPSimRun_qSIP.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/9

In [ ]:
%pushnote qSIP complete: $buildDir

deltaBD


In [86]:
bashFileTmp = os.path.splitext(bashFile)[0] + '_dBD.sh'
bashFileTmp


Out[86]:
'/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_dBD.sh'

In [87]:
%%writefile $bashFileTmp
#!/bin/bash

#deltaBD 
SIPSim deltaBD \
    OTU_abs{abs}_PCR_sub.txt \
    {exp_design} \
    > OTU_abs{abs}_PCR_sub_dBD.txt


Writing /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_dBD.sh

In [89]:
!chmod 777 $bashFileTmp
!cd $workDir; \
    nestrun --template-file $bashFileTmp -d $buildDir --log-file deltaBD.log -j 10


2016-04-26 11:44:36,592 * INFO * Template: ./SIPSimRun_dBD.sh
2016-04-26 11:44:36,594 * INFO * [223246] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/7
2016-04-26 11:44:36,596 * INFO * [223247] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/9
2016-04-26 11:44:36,599 * INFO * [223249] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/8
2016-04-26 11:44:36,603 * INFO * [223251] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/3
2016-04-26 11:44:36,606 * INFO * [223253] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/10
2016-04-26 11:44:36,608 * INFO * [223256] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/2
2016-04-26 11:44:36,610 * INFO * [223257] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/1
2016-04-26 11:44:36,611 * INFO * [223259] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/4
2016-04-26 11:44:36,613 * INFO * [223261] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/5
2016-04-26 11:44:36,614 * INFO * [223263] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/6
2016-04-26 11:44:40,779 * INFO * [223257] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/1 Finished with 0
2016-04-26 11:44:40,781 * INFO * [223536] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/7
2016-04-26 11:44:40,886 * INFO * [223249] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/8 Finished with 0
2016-04-26 11:44:40,888 * INFO * [223538] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/9
2016-04-26 11:44:41,007 * INFO * [223263] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/6 Finished with 0
2016-04-26 11:44:41,009 * INFO * [223540] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/8
2016-04-26 11:44:41,062 * INFO * [223261] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/5 Finished with 0
2016-04-26 11:44:41,065 * INFO * [223542] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/3
2016-04-26 11:44:41,074 * INFO * [223256] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/2 Finished with 0
2016-04-26 11:44:41,076 * INFO * [223544] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/10
2016-04-26 11:44:41,076 * INFO * [223246] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/7 Finished with 0
2016-04-26 11:44:41,077 * INFO * [223545] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/2
2016-04-26 11:44:41,088 * INFO * [223251] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/3 Finished with 0
2016-04-26 11:44:41,089 * INFO * [223548] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/1
2016-04-26 11:44:41,170 * INFO * [223259] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/4 Finished with 0
2016-04-26 11:44:41,172 * INFO * [223551] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/4
2016-04-26 11:44:41,709 * INFO * [223253] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/10 Finished with 0
2016-04-26 11:44:41,711 * INFO * [223667] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/5
2016-04-26 11:44:42,177 * INFO * [223247] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/9 Finished with 0
2016-04-26 11:44:42,179 * INFO * [223772] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/6
2016-04-26 11:44:44,860 * INFO * [223538] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/9 Finished with 0
2016-04-26 11:44:44,862 * INFO * [223835] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/7
2016-04-26 11:44:45,108 * INFO * [223536] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/7 Finished with 0
2016-04-26 11:44:45,130 * INFO * [223837] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/9
2016-04-26 11:44:45,130 * INFO * [223540] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/8 Finished with 0
2016-04-26 11:44:45,132 * INFO * [223838] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/8
2016-04-26 11:44:45,209 * INFO * [223542] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/3 Finished with 0
2016-04-26 11:44:45,212 * INFO * [223852] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/3
2016-04-26 11:44:45,227 * INFO * [223548] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/1 Finished with 0
2016-04-26 11:44:45,229 * INFO * [223854] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/10
2016-04-26 11:44:45,243 * INFO * [223545] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/2 Finished with 0
2016-04-26 11:44:45,244 * INFO * [223856] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/2
2016-04-26 11:44:45,333 * INFO * [223544] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/10 Finished with 0
2016-04-26 11:44:45,335 * INFO * [223860] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/1
2016-04-26 11:44:45,447 * INFO * [223551] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/4 Finished with 0
2016-04-26 11:44:45,448 * INFO * [223863] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/4
2016-04-26 11:44:45,741 * INFO * [223667] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/5 Finished with 0
2016-04-26 11:44:45,743 * INFO * [223943] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/5
2016-04-26 11:44:46,227 * INFO * [223772] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/6 Finished with 0
2016-04-26 11:44:46,229 * INFO * [224031] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/6
2016-04-26 11:44:49,251 * INFO * [223838] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/8 Finished with 0
2016-04-26 11:44:49,253 * INFO * [224141] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/7
2016-04-26 11:44:49,311 * INFO * [223837] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/9 Finished with 0
2016-04-26 11:44:49,313 * INFO * [224143] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/9
2016-04-26 11:44:49,389 * INFO * [223856] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/2 Finished with 0
2016-04-26 11:44:49,391 * INFO * [224145] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/8
2016-04-26 11:44:49,459 * INFO * [223852] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/3 Finished with 0
2016-04-26 11:44:49,461 * INFO * [224147] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/3
2016-04-26 11:44:49,511 * INFO * [223835] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/7 Finished with 0
2016-04-26 11:44:49,513 * INFO * [224149] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/10
2016-04-26 11:44:49,523 * INFO * [223854] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/10 Finished with 0
2016-04-26 11:44:49,525 * INFO * [224151] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/2
2016-04-26 11:44:49,576 * INFO * [223863] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/4 Finished with 0
2016-04-26 11:44:49,578 * INFO * [224164] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/1
2016-04-26 11:44:49,805 * INFO * [223943] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/5 Finished with 0
2016-04-26 11:44:49,807 * INFO * [224192] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/4
2016-04-26 11:44:50,387 * INFO * [223860] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/1 Finished with 0
2016-04-26 11:44:50,389 * INFO * [224292] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/5
2016-04-26 11:44:50,395 * INFO * [224031] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/6 Finished with 0
2016-04-26 11:44:50,397 * INFO * [224294] Started ./SIPSimRun_dBD.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/6
**OUTPUT MUTED**

In [90]:
%pushnote deltaBD complete: $buildDir

Making confusion matrices


In [185]:
bashFileTmp = os.path.splitext(bashFile)[0] + '_cMtx.sh'
bashFileTmp


Out[185]:
'/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_cMtx.sh'

In [186]:
%%writefile $bashFileTmp
#!/bin/bash

# HR-SIP
SIPSimR DESeq2_confuseMtx \
    --libs 2,4,6 \
    --padj {padj} \
    BD-shift_stats.txt \
    OTU_abs{abs}_PCR_sub_filt_DESeq2

# HR-SIP multiple 'heavy' BD windows
SIPSimR DESeq2_confuseMtx \
    --libs 2,4,6 \
    --padj {padj} \
    -o DESeq2_multi-cMtx \
    BD-shift_stats.txt \
    OTU_abs{abs}_PCR_sub_filt_MW_DESeq2
    
# qSIP    
SIPSimR qSIP_confuseMtx \
    --libs 2,4,6 \
    BD-shift_stats.txt \
    OTU_abs{abs}_PCR_sub_qSIP_atom.txt

# heavy-SIP    
SIPSimR heavy_confuseMtx \
    --libs 2,4,6 \
    BD-shift_stats.txt \
    OTU_abs{abs}_PCR_sub.txt


Overwriting /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/SIPSimRun_cMtx.sh

In [187]:
!chmod 777 $bashFileTmp
!cd $workDir; \
    nestrun --template-file $bashFileTmp -d $buildDir --log-file cMtx.log -j 14


2016-05-15 10:01:55,408 * INFO * Template: ./SIPSimRun_cMtx.sh
2016-05-15 10:01:55,410 * INFO * [113052] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/7
2016-05-15 10:01:55,412 * INFO * [113053] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/9
2016-05-15 10:01:55,414 * INFO * [113055] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/8
2016-05-15 10:01:55,415 * INFO * [113057] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/3
2016-05-15 10:01:55,417 * INFO * [113059] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/10
2016-05-15 10:01:55,419 * INFO * [113061] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/2
2016-05-15 10:01:55,420 * INFO * [113063] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/1
2016-05-15 10:01:55,421 * INFO * [113065] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/4
2016-05-15 10:01:55,423 * INFO * [113067] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/5
2016-05-15 10:01:55,424 * INFO * [113069] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/6
2016-05-15 10:01:55,426 * INFO * [113071] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/7
2016-05-15 10:01:55,427 * INFO * [113073] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/9
2016-05-15 10:01:55,429 * INFO * [113075] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/8
2016-05-15 10:01:55,431 * INFO * [113077] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/3
2016-05-15 10:02:15,143 * INFO * [113073] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/9 Finished with 0
2016-05-15 10:02:15,145 * INFO * [114353] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/10
2016-05-15 10:02:15,319 * INFO * [113059] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/10 Finished with 0
2016-05-15 10:02:15,322 * INFO * [114357] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/2
2016-05-15 10:02:15,480 * INFO * [113065] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/4 Finished with 0
2016-05-15 10:02:15,483 * INFO * [114361] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/1
2016-05-15 10:02:15,741 * INFO * [113067] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/5 Finished with 0
2016-05-15 10:02:15,743 * INFO * [114389] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/4
2016-05-15 10:02:15,772 * INFO * [113057] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/3 Finished with 0
2016-05-15 10:02:15,774 * INFO * [114393] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/5
2016-05-15 10:02:16,134 * INFO * [113063] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/1 Finished with 0
2016-05-15 10:02:16,136 * INFO * [114424] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/6
2016-05-15 10:02:16,137 * INFO * [113069] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/6 Finished with 0
2016-05-15 10:02:16,139 * INFO * [114427] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/7
2016-05-15 10:02:16,164 * INFO * [113052] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/7 Finished with 0
2016-05-15 10:02:16,166 * INFO * [114434] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/9
2016-05-15 10:02:16,199 * INFO * [113061] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/2 Finished with 0
2016-05-15 10:02:16,201 * INFO * [114458] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/8
2016-05-15 10:02:16,349 * INFO * [113071] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/7 Finished with 0
2016-05-15 10:02:16,352 * INFO * [114467] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/3
2016-05-15 10:02:16,517 * INFO * [113055] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/8 Finished with 0
2016-05-15 10:02:16,519 * INFO * [114501] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/10
2016-05-15 10:02:16,531 * INFO * [113075] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/8 Finished with 0
2016-05-15 10:02:16,534 * INFO * [114507] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/2
2016-05-15 10:02:16,535 * INFO * [113077] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/3 Finished with 0
2016-05-15 10:02:16,537 * INFO * [114509] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/1
2016-05-15 10:02:16,611 * INFO * [113053] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/50/9 Finished with 0
2016-05-15 10:02:16,615 * INFO * [114525] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/4
2016-05-15 10:02:35,205 * INFO * [114393] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/5 Finished with 0
2016-05-15 10:02:35,208 * INFO * [115627] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/5
2016-05-15 10:02:35,687 * INFO * [114353] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/10 Finished with 0
2016-05-15 10:02:35,689 * INFO * [115646] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/6
2016-05-15 10:02:35,693 * INFO * [114357] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/2 Finished with 0
2016-05-15 10:02:35,695 * INFO * [115648] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/7
2016-05-15 10:02:35,740 * INFO * [114361] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/1 Finished with 0
2016-05-15 10:02:35,742 * INFO * [115650] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/9
2016-05-15 10:02:35,873 * INFO * [114389] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/4 Finished with 0
2016-05-15 10:02:35,875 * INFO * [115656] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/8
2016-05-15 10:02:35,999 * INFO * [114458] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/8 Finished with 0
2016-05-15 10:02:36,001 * INFO * [115662] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/3
2016-05-15 10:02:36,068 * INFO * [114467] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/3 Finished with 0
2016-05-15 10:02:36,070 * INFO * [115673] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/10
2016-05-15 10:02:36,135 * INFO * [114427] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/7 Finished with 0
2016-05-15 10:02:36,137 * INFO * [115698] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/2
2016-05-15 10:02:36,215 * INFO * [114507] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/2 Finished with 0
2016-05-15 10:02:36,216 * INFO * [115716] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/1
2016-05-15 10:02:36,218 * INFO * [114424] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/25/6 Finished with 0
2016-05-15 10:02:36,219 * INFO * [115718] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/4
2016-05-15 10:02:36,491 * INFO * [114501] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/10 Finished with 0
2016-05-15 10:02:36,493 * INFO * [115770] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/5
2016-05-15 10:02:36,696 * INFO * [114525] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/4 Finished with 0
2016-05-15 10:02:36,698 * INFO * [115832] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/1/6
2016-05-15 10:02:37,174 * INFO * [114434] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/9 Finished with 0
2016-05-15 10:02:37,179 * INFO * [115900] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/5/7
2016-05-15 10:02:37,261 * INFO * [114509] /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/10/1 Finished with 0
2016-05-15 10:02:37,264 * INFO * [115904] Started ./SIPSimRun_cMtx.sh in /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/50/5/9
**OUTPUT MUTED**

Aggregating the confusion matrix data


In [537]:
def agg_cMtx(prefix):
    # all data
    x = prefix + '-cMtx_data.txt'
    !nestagg delim \
       -d $buildDir \
       -k percIncorp,percTaxa,rep \
       -o $x \
       --tab \
       $x

    # overall
    x = prefix + '-cMtx_overall.txt'
    !nestagg delim \
        -d $buildDir \
        -k percIncorp,percTaxa,rep \
        -o $x \
        --tab \
        $x

    # by class
    x = prefix + '-cMtx_byClass.txt'
    !nestagg delim \
        -d $buildDir \
        -k percIncorp,percTaxa,rep \
        -o $x \
        --tab \
        $x
        
agg_cMtx('DESeq2')
agg_cMtx('DESeq2_multi')
agg_cMtx('qSIP') 
agg_cMtx('heavy')

In [189]:
%pushnote atomIncorp_taxaIncorp complete!

--End of simulation--


Plotting results


In [190]:
F = os.path.join(buildDir, '*-cMtx_byClass.txt')
files = glob.glob(F)
files


Out[190]:
['/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/DESeq2-cMtx_byClass.txt',
 '/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/qSIP-cMtx_byClass.txt',
 '/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/heavy-cMtx_byClass.txt',
 '/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/DESeq2_multi-cMtx_byClass.txt']

In [191]:
%%R -i files

df_byClass = list()
for (f in files){
    ff = strsplit(f, '/') %>% unlist
    fff = ff[length(ff)]
    df_byClass[[fff]] = read.delim(f, sep='\t')
}

df_byClass = do.call(rbind, df_byClass)
df_byClass$file = gsub('\\.[0-9]+$', '', rownames(df_byClass))
df_byClass$method = gsub('-.+', '', df_byClass$file)
rownames(df_byClass) = 1:nrow(df_byClass)

df_byClass %>% head(n=3)


  library      variables    values percIncorp percTaxa rep
1       2    Sensitivity 0.2805755         50       50   7
2       2    Specificity 1.0000000         50       50   7
3       2 Pos Pred Value 1.0000000         50       50   7
                     file method
1 DESeq2-cMtx_byClass.txt DESeq2
2 DESeq2-cMtx_byClass.txt DESeq2
3 DESeq2-cMtx_byClass.txt DESeq2

In [192]:
%%R
# renaming method
rename = data.frame(method = c('DESeq2', 'DESeq2_multi', 'heavy', 'qSIP'), 
                   method_new = c('HR-SIP', 'MW-HR-SIP', 'Heavy-SIP', 'qSIP'))

df_byClass = inner_join(df_byClass, rename, c('method'='method')) %>%
    select(-method) %>%
    rename('method' = method_new) 

df_byClass %>% head(n=3)


  library      variables    values percIncorp percTaxa rep
1       2    Sensitivity 0.2805755         50       50   7
2       2    Specificity 1.0000000         50       50   7
3       2 Pos Pred Value 1.0000000         50       50   7
                     file method
1 DESeq2-cMtx_byClass.txt HR-SIP
2 DESeq2-cMtx_byClass.txt HR-SIP
3 DESeq2-cMtx_byClass.txt HR-SIP

In [269]:
%%R -w 800 -h 550
# summarize by SIPSim rep & library rep
df_byClass.s = df_byClass %>%
    group_by(method, percIncorp, percTaxa, variables) %>%
    summarize(mean_value = mean(values, na.rm=TRUE),
              sd_value = sd(values, na.rm=TRUE))

# plotting
ggplot(df_byClass.s, aes(variables, mean_value, color=method,
                         ymin=mean_value-sd_value,
                         ymax=mean_value+sd_value)) +
    geom_pointrange(alpha=0.8, size=0.2) +
    labs(y='Value') +
    facet_grid(percTaxa ~ percIncorp) +
    theme_bw() +
    theme(
        text = element_text(size=16),
        axis.title.x = element_blank(),
        axis.text.x = element_text(angle=45, hjust=1)
    )



In [270]:
%%R -w 800 -h 600
# summarize by SIPSim rep & library rep
vars = c('Balanced Accuracy', 'Sensitivity', 'Specificity')
df_byClass.s.f = df_byClass.s %>%
    filter(variables %in% vars) 

# plotting
ggplot(df_byClass.s.f, aes(variables, mean_value, fill=method,
                         ymin=mean_value-sd_value,
                         ymax=mean_value+sd_value)) +
    #geom_pointrange(alpha=0.8, size=0.2) +
    geom_bar(stat='identity', position='dodge', width=0.8) +
    geom_errorbar(stat='identity', position='dodge', width=0.8) +
    scale_y_continuous(breaks=seq(0, 1, 0.2)) +
    labs(y='Value') +
    facet_grid(percTaxa ~ percIncorp) +
    theme_bw() +
    theme(
        text = element_text(size=16),
        axis.title.x = element_blank(),
        axis.text.x = element_text(angle=50, hjust=1)
    )



In [272]:
%%R -w 600 -h 350
# check of qSIP
df_byClass.f = df_byClass %>%
    filter(method=='qSIP', 
           variables %in% c('Specificity', 'Sensitivity')) %>%
    mutate(percTaxa = percTaxa %>% as.character,
           percTaxa = percTaxa %>% reorder(percTaxa %>% as.numeric),
           percIncorp = percIncorp %>% as.character,
           percIncorp = percIncorp %>% reorder(percIncorp %>% as.numeric))


# plotting
ggplot(df_byClass.f, aes(percIncorp, values, color=percTaxa)) +
    geom_boxplot() +
    scale_color_discrete('% taxa as\nincorporators') +
    labs(x='13C atom % excess', y='value') +
    facet_grid(variables ~ .) +
    theme_bw() +
    theme(
        text = element_text(size=16)
    )



In [620]:
%%R -w 800 -h 450
# summarize by SIPSim rep & library rep
vars = c('Balanced Accuracy', 'Sensitivity', 'Specificity')
df_byClass.s.f = df_byClass.s %>%
    filter(variables %in% vars) %>%
    ungroup() %>%
    mutate(percTaxa = percTaxa %>% as.character,
           percTaxa = percTaxa %>% reorder(percTaxa %>% as.numeric))


# plotting
p.pnt = ggplot(df_byClass.s.f, aes(percIncorp, mean_value, 
                           color=percTaxa, 
                           group=percTaxa,
                           ymin=mean_value-sd_value,
                           ymax=mean_value+sd_value)) +
    geom_point(alpha=0.8) +
    geom_linerange(alpha=0.8, size=0.5) +
    geom_line() +
    scale_color_discrete('% incorp-\norators') +
    labs(x='13C atom % excess') +
    facet_grid(variables ~ method, scale='free_y') +
    theme_bw() +
    theme(
        text = element_text(size=16),
        axis.title.y = element_blank()
    )
p.pnt



In [621]:
%%R 
outFile = 'atomIncorp_taxaIncorp_acc.pdf'
ggsave(outFile, p.pnt, width=10, height=5.63)
cat('File written:', file.path(getwd(), outFile), '\n')


File written: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/atomIncorp_taxaIncorp_acc.pdf 

Plotting fraction of false positives (of total estimated positives)

  • FP / (FP + TP)

In [622]:
F = os.path.join(buildDir, '*-cMtx_data.txt')
files = glob.glob(F)
files


Out[622]:
['/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/qSIP-cMtx_data.txt',
 '/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/DESeq2-cMtx_data.txt',
 '/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/DESeq2_multi-cMtx_data.txt',
 '/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/heavy-cMtx_data.txt']

In [623]:
%%R -i files
# calling TP,FP,TN,FN
Clsfy = function(known, pred){
    #print(known == TRUE)
    #print(pred == TRUE)
    if(known == TRUE & pred == TRUE){
        return('TP')
    } else
    if(known == TRUE & pred == FALSE){
        return('FN')
    } else
    if(known == FALSE & pred == FALSE){
        return('TN')
    } else
    if(known == FALSE & pred == TRUE){
        return('FP')
    } else {
        stop('logic error')
    }        
}

# loading data
df_data = list()
for (f in files){
    ff = strsplit(f, '/') %>% unlist
    fff = ff[length(ff)]
    df_data[[fff]] = read.delim(f, sep='\t') %>%
        rowwise() %>%
        mutate(clsfy = Clsfy(incorp.known, incorp.pred)) %>%
        dplyr::select(library, taxon, incorp.known, incorp.pred,
                       clsfy, percIncorp, percTaxa, rep) %>%
        group_by(library, percIncorp, percTaxa, rep, clsfy) %>%
        summarize(n_clsfy = n()) %>%
        ungroup()
}

# combining data
df_data = do.call(rbind, df_data)
df_data$file = gsub('\\.[0-9]+$', '', rownames(df_data))
df_data$method = gsub('-.+', '', df_data$file)
rownames(df_data) = 1:nrow(df_data)

# status
df_data %>% head(n=3)


Source: local data frame [3 x 8]

  library percIncorp percTaxa   rep clsfy n_clsfy               file method
    (int)      (int)    (int) (int) (chr)   (int)              (chr)  (chr)
1       2          0        1     1    FP      90 qSIP-cMtx_data.txt   qSIP
2       2          0        1     1    TN    1012 qSIP-cMtx_data.txt   qSIP
3       2          0        1     2    FP      88 qSIP-cMtx_data.txt   qSIP

In [624]:
%%R
# renaming method
rename = data.frame(method = c('DESeq2', 'DESeq2_multi', 'heavy', 'qSIP'), 
                   method_new = c('HR-SIP', 'MW-HR-SIP', 'Heavy-SIP', 'qSIP'))

df_data = inner_join(df_data, rename, c('method'='method')) %>%
    select(-method) %>%
    rename('method' = method_new) 

# status
df_data %>% head(n=3)


Source: local data frame [3 x 8]

  library percIncorp percTaxa   rep clsfy n_clsfy               file method
    (int)      (int)    (int) (int) (chr)   (int)              (chr) (fctr)
1       2          0        1     1    FP      90 qSIP-cMtx_data.txt   qSIP
2       2          0        1     1    TN    1012 qSIP-cMtx_data.txt   qSIP
3       2          0        1     2    FP      88 qSIP-cMtx_data.txt   qSIP

In [634]:
%%R -w 800 -h 250
as.Num = function(x) x %>% as.character %>% as.numeric

# summarizing
df_data_s = df_data %>%
    spread(clsfy, n_clsfy, fill=0) %>%
    mutate(FP = FP %>% as.Num,
           TP = TP %>% as.Num) %>%
    rowwise %>% 
    mutate(FP = ifelse(FP < 5, 0, FP), 
           FP_frac = FP / (FP + TP),
           FP_frac = ifelse(is.na(FP_frac), 0, FP_frac)) %>%
    group_by(method, percIncorp, percTaxa) %>%
    summarize(mean_FP_frac = mean(FP_frac, na.rm=TRUE),
              sd_FP_frac = sd(FP_frac, na.rm=TRUE)) %>%
    ungroup() %>%
    mutate(percTaxa = percTaxa %>% as.character,
           percTaxa = percTaxa %>% reorder(percTaxa %>% as.numeric))
#df_data_s %>% tail %>% as.data.frame

y.lab = expression(frac('False incorporators', 'Total incorporators'))    
    
# plotting
p.FP = ggplot(df_data_s, aes(percIncorp, mean_FP_frac, 
                           color=percTaxa, group=percTaxa,
                           ymin=mean_FP_frac-sd_FP_frac,
                           ymax=mean_FP_frac+sd_FP_frac)) +
    geom_point(alpha=0.8) +
    geom_linerange(alpha=0.8, size=0.5) +
    geom_line() +
    scale_y_continuous(limits=c(-0.16,1.00)) +
    scale_color_discrete('% incorp-\norators') +
    labs(x='13C atom % excess',
         y=y.lab) +
         #y='false incorporators\nthat are false') +
    facet_grid( ~ method, scales='free_y') +
    theme_bw() +
    theme(
        text = element_text(size=16)
    )
p.FP


Plot number of false positives

  • emphasize the issue of specificity

In [626]:
%%R -w 800 -h 250
# # theoretical number of taxa
# df.ntaxa = data.frame(
#     'variables' = rep('Specificity', 3),
#     'ntaxa' = c(500, 1100, 2000)
# )

# df_byClass.j = inner_join(df_byClass, df.ntaxa, c('variables'='variables')) %>%
#     mutate(nFP = (1-values) * ntaxa) %>%
#     group_by(method, percIncorp, percTaxa, ntaxa) %>%
#     summarize(mean_nFP = mean(nFP, na.rm=TRUE),
#               sd_nFP = sd(nFP, na.rm=TRUE)) %>%
#     ungroup() %>%
#     mutate(percTaxa = percTaxa %>% as.character,
#            percTaxa = percTaxa %>% reorder(percTaxa %>% as.numeric),
#            ntaxa = ntaxa %>% as.character) %>%
#     filter(ntaxa == 1100)

# # plotting
# p.FP = ggplot(df_byClass.j, aes(percIncorp, mean_nFP, 
#                            color=percTaxa, group=percTaxa,
#                            ymin=mean_nFP-sd_nFP,
#                            ymax=mean_nFP+sd_nFP)) +
#     geom_point(alpha=0.8) +
#     geom_linerange(alpha=0.8, size=0.5) +
#     geom_line() +
#     scale_color_discrete('% incorp-\norators') +
#     labs(x='13C atom % excess',
#          y='False incorporators') +
#     facet_grid( ~ method, scales='free_y') +
#     theme_bw() +
#     theme(
#         text = element_text(size=16)
#     )
# p.FP


NULL

Combined figure


In [635]:
%%R
g_legend = function(a.gplot){ 
  tmp = ggplot_gtable(ggplot_build(a.gplot)) 
  leg = which(sapply(tmp$grobs, function(x) x$name) == "guide-box") 
  legend = tmp$grobs[[leg]] 
  return(legend)
  }
                     
p.leg = g_legend(p.pnt)

In [643]:
%%R -w 800 -h 650

p.pnt.e = p.pnt + theme(legend.position='none')
p.FP.e = p.FP + theme(legend.position='none')

p.comb = cowplot::ggdraw() +
    geom_rect(aes(xmin=0, ymin=0, xmax=1, ymax=1), color='white', fill='white') +
    cowplot::draw_plot(p.pnt.e, 0.055, 0.31, 0.84, 0.69) +
    cowplot::draw_plot(p.FP.e, 0, 0, 0.87, 0.3) +
    cowplot::draw_plot(p.leg, 0.90, 0.38, 0.08, 0.3) +
    cowplot::draw_plot_label(c('A)', 'B)'), c(0, 0), c(1, 0.32))
p.comb



In [644]:
%%R
outFile = 'atomIncorp_taxaIncorp_acc-FP.pdf'
ggsave(outFile, p.comb, width=10, height=8.5)
cat('File written:', file.path(getwd(), outFile), '\n')


File written: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/atomIncorp_taxaIncorp_acc-FP.pdf 

atom excess estimates

qSIP


In [423]:
atomX_files = glob.glob('*/*/*/*_atom.txt')
len(atomX_files)


Out[423]:
250

In [424]:
%%R -i atomX_files

df_atomX = list()
for(F in atomX_files){
    tmp = read.delim(F, sep='\t') 
    FF = strsplit(F, '/') %>% unlist
    tmp$percIncorp = FF[1]
    tmp$percTaxa = FF[2]
    tmp$rep = FF[3]
    tmp$file = FF[4]
    df_atomX[[F]] = tmp
}

df_atomX = do.call(rbind, df_atomX)
rownames(df_atomX) = 1:nrow(df_atomX)
df_atomX %>% head(n=3)


                                 taxon  control treatment      BD_diff
1       Acaryochloris_marina_MBIC11017       NA  1.735000           NA
2 Acetobacter_pasteurianus_IFO_3283-03 1.711478  1.730446  0.018967947
3       Acetobacterium_woodii_DSM_1030 1.706348  1.698732 -0.007615707
  control_GC control_MW treatment_max_MW treatment_MW atom_fraction_excess
1         NA         NA               NA           NA                   NA
2  0.7834275   308.0796         317.6634     311.4940            0.3523052
3  0.7219901   308.0491         317.6636     306.6742           -0.1414111
  atom_CI_low atom_CI_high percIncorp percTaxa rep
1          NA           NA         50       50   7
2   0.3287802   0.37572502         50       50   7
3  -0.2018421  -0.07953983         50       50   7
                              file
1 OTU_abs1e9_PCR_sub_qSIP_atom.txt
2 OTU_abs1e9_PCR_sub_qSIP_atom.txt
3 OTU_abs1e9_PCR_sub_qSIP_atom.txt

In [425]:
BDshift_files = glob.glob('*/*/*/BD-shift_stats.txt')
len(BDshift_files)


Out[425]:
250

In [426]:
%%R -i BDshift_files

df_shift = list()
for(F in BDshift_files){
    tmp = read.delim(F, sep='\t') 
    FF = strsplit(F, '/') %>% unlist
    tmp$percIncorp = FF[1]
    tmp$percTaxa = FF[2]
    tmp$rep = FF[3]
    tmp$file = FF[4]
    df_shift[[F]] = tmp
}

df_shift = do.call(rbind, df_shift)
rownames(df_shift) = 1:nrow(df_shift)

df_shift = df_shift %>%
    filter(library %in% c(2,4,6)) %>%
    group_by(taxon, percIncorp, percTaxa, rep) %>%
    summarize(median = median(median)) %>%
    ungroup() %>%
    rename('median_true_BD_shift' = median)

df_shift %>% head(n=3)


Source: local data frame [3 x 5]

                           taxon percIncorp percTaxa   rep median_true_BD_shift
                          (fctr)      (chr)    (chr) (chr)                (dbl)
1 Acaryochloris_marina_MBIC11017          0        1     1                    0
2 Acaryochloris_marina_MBIC11017          0        1    10                    0
3 Acaryochloris_marina_MBIC11017          0        1     2                    0

In [427]:
%%R
# table join
df_atomX %>% nrow %>% print

df.j = left_join(df_atomX, df_shift, c('taxon' = 'taxon',
                                       'percIncorp'='percIncorp',
                                       'percTaxa'='percTaxa',
                                       'rep'='rep')) %>%
   filter(!is.na(BD_diff)) %>%
   mutate(true_incorporator = ifelse(median_true_BD_shift > 0.002, TRUE, FALSE),
          true_atom_fraction_excess = median_true_BD_shift / 0.036,
          atom_fraction_excess = ifelse(is.na(atom_CI_low), 0, atom_fraction_excess))

df.j %>% nrow %>% print
df.j %>% head(n=3)


[1] 286750
[1] 272007
                                 taxon  control treatment       BD_diff
1 Acetobacter_pasteurianus_IFO_3283-03 1.711478  1.730446  0.0189679469
2       Acetobacterium_woodii_DSM_1030 1.706348  1.698732 -0.0076157075
3    Acetohalobium_arabaticum_DSM_5501 1.700596  1.699750 -0.0008456435
  control_GC control_MW treatment_max_MW treatment_MW atom_fraction_excess
1  0.7834275   308.0796         317.6634     311.4940           0.35230520
2  0.7219901   308.0491         317.6636     306.6742          -0.14141112
3  0.6531156   308.0149         317.6638     307.8618          -0.01569748
  atom_CI_low atom_CI_high percIncorp percTaxa rep
1  0.32878016  0.375725017         50       50   7
2 -0.20184210 -0.079539834         50       50   7
3 -0.03989405  0.007993522         50       50   7
                              file median_true_BD_shift true_incorporator
1 OTU_abs1e9_PCR_sub_qSIP_atom.txt                0.018              TRUE
2 OTU_abs1e9_PCR_sub_qSIP_atom.txt                0.000             FALSE
3 OTU_abs1e9_PCR_sub_qSIP_atom.txt                0.000             FALSE
  true_atom_fraction_excess
1                       0.5
2                       0.0
3                       0.0

In [428]:
%%R
# free memory
df_shift = df_atomX = NULL

# saving dataframe (if needed)
df.j.qSIP = df.j

In [429]:
%%R -h 250 
# difference between true and estimated
df.j.dis.qSIP = df.j %>%
    mutate(delta_excess = atom_fraction_excess * 100 - true_atom_fraction_excess * 100) %>%
    group_by(percIncorp, percTaxa, true_incorporator) %>%
    summarize(mean_delta_excess = mean(delta_excess),
              sd_delta_excess = sd(delta_excess)) %>%
    ungroup() %>%
    mutate(percIncorp = percIncorp %>% reorder(percIncorp %>% as.numeric),
           percTaxa = percTaxa %>% reorder(percTaxa %>% as.numeric)) %>%
    filter(true_incorporator == TRUE)
   
# plotting
ggplot(df.j.dis.qSIP, aes(percIncorp, mean_delta_excess, 
                      color=percTaxa, group=percTaxa,
                      ymin=mean_delta_excess-sd_delta_excess,
                     ymax=mean_delta_excess+sd_delta_excess)) +
    geom_pointrange(alpha=0.8, size=0.2) +
    geom_line() +
    scale_color_discrete('% taxa as\nincorporators') +
    labs(x='13C atom % excess (truth)', 
         y='13C atom % excess\n(truth - estimate)') +
    theme_bw() +
    theme(
        text = element_text(size=16)
    )



In [531]:
%%R
# how much of an under-estimate?
tmp = df.j.dis.qSIP %>%
    mutate(percIncorp = percIncorp %>% as.character %>% as.numeric) %>%
    mutate(X = (-mean_delta_excess)/percIncorp * 100) 
tmp$X %>% summary


   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  30.27   35.65   35.89   35.86   36.65   39.25 

Chk: qSIP sensitivity/specificty


In [430]:
%%R -w 600 -h 300

df.j.s = df.j %>% 
    #filter(!is.na(atom_CI_low)) %>%
    mutate(pred_incorp = ifelse(atom_CI_low > 0, TRUE, FALSE),
           pred_incorp = ifelse(is.na(pred_incorp), FALSE, pred_incorp),
           FP = ifelse((pred_incorp==TRUE & true_incorporator==FALSE), 1, 0),
           TP = ifelse((pred_incorp==TRUE & true_incorporator==TRUE), 1, 0),
           FN = ifelse((pred_incorp==FALSE & true_incorporator==TRUE), 1, 0),
           TN = ifelse((pred_incorp==FALSE & true_incorporator==FALSE), 1, 0)) %>%
    group_by(percIncorp,percTaxa,rep) %>%
    summarize(n_FP = sum(FP),
              n_TP = sum(TP),
              n_FN = sum(FN),
              n_TN = sum(TN),
              n = n(),
              specificity = n_TN / (n_TN+n_FP),
              sensitivity = n_TP / (n_TP+n_FN)) %>%
    ungroup() %>%
    mutate(percIncorp = percIncorp %>% as.character,
           percIncorp = percIncorp %>% reorder(percIncorp %>% as.numeric),
           percTaxa = percTaxa %>% reorder(percTaxa %>% as.numeric))

# plotting
ggplot(df.j.s, aes(percIncorp, specificity, color=percTaxa)) +
    geom_boxplot() +
    scale_y_continuous(limits=c(0.55, 1)) +
    scale_color_discrete('% taxa as\nincorporators') +
    labs(x='13C atom % excess', y='specificity') +
    theme_bw() +
    theme(
        text = element_text(size=16)
    )


deltaBD


In [431]:
dBD_files = glob.glob('*/*/*/*_dBD.txt')
len(dBD_files)


Out[431]:
250

In [432]:
%%R -i dBD_files

df_dBD = list()
for(F in dBD_files){
    tmp = read.delim(F, sep='\t') 
    FF = strsplit(F, '/') %>% unlist
    tmp$percIncorp = FF[1]
    tmp$percTaxa = FF[2]
    tmp$rep = FF[3]
    tmp$file = FF[4]
    df_dBD[[F]] = tmp
}

df_dBD = do.call(rbind, df_dBD)
rownames(df_dBD) = 1:nrow(df_dBD)
df_dBD %>% head(n=3)


                                 taxon mean_CM_control mean_CM_treatment
1       Acaryochloris_marina_MBIC11017        1.742474          1.738216
2 Acetobacter_pasteurianus_IFO_3283-03        1.715840          1.732343
3       Acetobacterium_woodii_DSM_1030        1.713479          1.695490
  stdev_CM_control stdev_CM_treatment     delta_BD percIncorp percTaxa rep
1      0.000000000        0.003112361 -0.004257915         50       50   7
2      0.003060431        0.003842456  0.016502104         50       50   7
3      0.006503952        0.001694501 -0.017989063         50       50   7
                        file
1 OTU_abs1e9_PCR_sub_dBD.txt
2 OTU_abs1e9_PCR_sub_dBD.txt
3 OTU_abs1e9_PCR_sub_dBD.txt

In [433]:
BDshift_files = glob.glob('*/*/*/BD-shift_stats.txt')
len(BDshift_files)


Out[433]:
250

In [434]:
%%R -i BDshift_files

df_shift = list()
for(F in BDshift_files){
    tmp = read.delim(F, sep='\t') 
    FF = strsplit(F, '/') %>% unlist
    tmp$percIncorp = FF[1]
    tmp$percTaxa = FF[2]
    tmp$rep = FF[3]
    tmp$file = FF[4]
    df_shift[[F]] = tmp
}

df_shift = do.call(rbind, df_shift)
rownames(df_shift) = 1:nrow(df_shift)

df_shift = df_shift %>%
    filter(library %in% c(2,4,6)) %>%
    group_by(taxon, percIncorp, percTaxa, rep) %>%
    summarize(median = median(median)) %>%
    ungroup() %>%
    rename('median_true_BD_shift' = median)

df_shift %>% head(n=3)


Source: local data frame [3 x 5]

                           taxon percIncorp percTaxa   rep median_true_BD_shift
                          (fctr)      (chr)    (chr) (chr)                (dbl)
1 Acaryochloris_marina_MBIC11017          0        1     1                    0
2 Acaryochloris_marina_MBIC11017          0        1    10                    0
3 Acaryochloris_marina_MBIC11017          0        1     2                    0

In [435]:
%%R
df.j = inner_join(df_dBD, df_shift, c('taxon' = 'taxon',
                                       'percIncorp'='percIncorp',
                                       'percTaxa'='percTaxa',
                                       'rep'='rep')) %>%
    filter(!is.na(delta_BD)) %>%
    mutate(true_incorporator = ifelse(median_true_BD_shift > 0.002, TRUE, FALSE),
           true_atom_fraction_excess = median_true_BD_shift / 0.036,
           atom_fraction_excess = delta_BD / 0.036)
df.j %>% head(n=3)


                                 taxon mean_CM_control mean_CM_treatment
1       Acaryochloris_marina_MBIC11017        1.742474          1.738216
2 Acetobacter_pasteurianus_IFO_3283-03        1.715840          1.732343
3       Acetobacterium_woodii_DSM_1030        1.713479          1.695490
  stdev_CM_control stdev_CM_treatment     delta_BD percIncorp percTaxa rep
1      0.000000000        0.003112361 -0.004257915         50       50   7
2      0.003060431        0.003842456  0.016502104         50       50   7
3      0.006503952        0.001694501 -0.017989063         50       50   7
                        file median_true_BD_shift true_incorporator
1 OTU_abs1e9_PCR_sub_dBD.txt                0.018              TRUE
2 OTU_abs1e9_PCR_sub_dBD.txt                0.018              TRUE
3 OTU_abs1e9_PCR_sub_dBD.txt                0.000             FALSE
  true_atom_fraction_excess atom_fraction_excess
1                       0.5           -0.1182754
2                       0.5            0.4583918
3                       0.0           -0.4996962

In [436]:
%%R
# free memory
df_shift = df_dBD = NULL
# saving dataframe (if needed)
df.j.dBD = df.j

In [437]:
%%R -h 250 
# difference between true and estimated
df.j.dis.dBD = df.j %>%
    mutate(delta_excess = atom_fraction_excess * 100 - true_atom_fraction_excess * 100) %>%
    group_by(percIncorp, percTaxa, true_incorporator) %>%
    summarize(mean_delta_excess = mean(delta_excess),
              sd_delta_excess = sd(delta_excess)) %>%
    ungroup() %>%
    mutate(percIncorp = percIncorp %>% reorder(percIncorp %>% as.numeric),
           percTaxa = percTaxa %>% reorder(percTaxa %>% as.numeric)) %>%
    filter(true_incorporator == TRUE)
   
# plotting
ggplot(df.j.dis.dBD, aes(percIncorp, mean_delta_excess, 
                      color=percTaxa, group=percTaxa,
                      ymin=mean_delta_excess-sd_delta_excess,
                     ymax=mean_delta_excess+sd_delta_excess)) +
    geom_pointrange(alpha=0.8, size=0.2) +
    geom_line() +
    scale_color_discrete('% taxa as\nincorporators') +
    labs(x='13C atom % excess (truth)', y='13C atom % excess\n(truth - estimate)') +
    theme_bw() +
    theme(
        text = element_text(size=16)
    )



In [533]:
%%R
# how much of an under-estimate?
tmp = df.j.dis.dBD %>%
    filter(percIncorp==100) %>%
    mutate(percIncorp = percIncorp %>% as.character %>% as.numeric) %>%
    mutate(X = (-mean_delta_excess)/percIncorp * 100) 
tmp$X %>% summary


   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  15.03   15.10   15.55   16.38   17.85   18.36 

qSIP+deltaBD


In [518]:
%%R -w 650 -h 250
df.jj = rbind(df.j.dis.qSIP %>% mutate(method='qSIP'),
              df.j.dis.dBD %>% mutate(method='Delta BD'))

# plotting
p.comb = ggplot(df.jj, aes(percIncorp, mean_delta_excess, 
                      color=percTaxa, group=percTaxa,
                      ymin=mean_delta_excess-sd_delta_excess,
                     ymax=mean_delta_excess+sd_delta_excess)) +
    geom_point() +
    geom_linerange(alpha=0.5, size=1) +
    geom_line() +
    scale_color_discrete('% taxa as\nincorporators') +
    labs(x='13C atom % excess (truth)', y='13C atom % excess\n(truth - estimate)') +
    facet_grid(. ~ method) +
    theme_bw() +
    theme(
        text = element_text(size=16)
    )
p.comb


Density plots


In [519]:
%%R
df.jj = rbind(df.j.qSIP %>% 
                  dplyr::select(atom_fraction_excess, true_atom_fraction_excess, percIncorp,
                                true_incorporator, percTaxa) %>%
                  mutate(method='qSIP'),
              df.j.dBD %>% 
                  dplyr::select(atom_fraction_excess, true_atom_fraction_excess, percIncorp,
                                true_incorporator, percTaxa) %>%
                  mutate(method='Delta BD')) %>%
    filter(percTaxa == '10',
           true_incorporator==TRUE,
           atom_fraction_excess!=0) %>%
    mutate(delta_excess = atom_fraction_excess * 100 - true_atom_fraction_excess * 100,
           percIncorp = percIncorp %>% reorder(percIncorp %>% as.numeric),
           percTaxa = percTaxa %>% reorder(percTaxa %>% as.numeric), 
           atom_perc_excess = atom_fraction_excess * 100,
           true_atom_perc_excess = true_atom_fraction_excess * 100) 

df.jj %>% head(n=3)


  atom_fraction_excess true_atom_fraction_excess percIncorp true_incorporator
1            0.3329134                       0.5         50              TRUE
2            0.3518201                       0.5         50              TRUE
3            0.3171024                       0.5         50              TRUE
  percTaxa method delta_excess atom_perc_excess true_atom_perc_excess
1       10   qSIP    -16.70866         33.29134                    50
2       10   qSIP    -14.81799         35.18201                    50
3       10   qSIP    -18.28976         31.71024                    50

In [520]:
%%R -w 700 -h 300

tmp = df.jj %>%
    dplyr::select(true_atom_perc_excess, percIncorp, method) %>%
    distinct(percIncorp, method) 

p.dens = ggplot(df.jj, aes(atom_perc_excess)) +
    geom_density(fill='grey70') +
    geom_vline(data=tmp, aes(xintercept=true_atom_perc_excess), linetype='dashed', alpha=0.5) +
    scale_x_continuous(limits=c(-20, 120)) +
    labs(x='13C atom % excess', y='Probability density') +
    facet_grid(method ~ percIncorp) +
    theme_bw() +
    theme(
        text = element_text(size=16)
    )
p.dens


Combined plot


In [521]:
%%R -w 700 -h 500

p.comb2 = cowplot::ggdraw() +
    geom_rect(aes(xmin=0, ymin=0, xmax=1, ymax=1), color='white', fill='white') +
    cowplot::draw_plot(p.comb, 0, 0.61, 1, 0.38) +
    cowplot::draw_plot(p.dens, 0, 0, 1, 0.60) +
    cowplot::draw_plot_label(c('A)', 'B)'), c(0, 0), c(1, 0.61))
p.comb2



In [522]:
%%R
outFile = 'atomIncorp_taxaIncorp_qSIP-dBD.pdf'
ggsave(outFile, p.comb2, width=10, height=7.15)
cat('File written:', file.path(getwd(), outFile), '\n')


File written: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/atomIncorp_taxaIncorp_qSIP-dBD.pdf 

--re-run--

  • for all simulations that died due to a memory error

In [93]:
import glob

Function for detecting missing/empty files


In [194]:
def find_missing_files(filepath, empty_cut=10000):
    # directories
    dirpath = os.path.split(filepath)[0]
    chk = os.path.join(buildDir, dirpath) + '/'
    D = set([os.path.split(x)[0] for x in glob.glob(chk)])
    
    # files
    chk = os.path.join(buildDir, filepath)
    F = glob.glob(chk)
    
    # check for missing files
    Fd = set([os.path.split(f)[0] for f in F])
    missing = D - Fd    
    print 'Union length: {}'.format(len(D | Fd))
    print 'Number of missing: {}'.format(len(missing))

    # check for empty files
    empties = [os.path.split(f)[0] for f in F if os.path.getsize(f) < empty_cut]
    print 'Number of empties: {}'.format(len(empties))
    
    # ret
    return {'missing' : list(missing), 'empty' : empties}
    
find_missing_files('*/*/*/OTU_abs1e9.txt')


Union length: 200
Number of missing: 0
Number of empties: 1
Out[194]:
{'empty': ['/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6'],
 'missing': []}

Finding all SIPSim pipeline incompletes


In [195]:
pipeline_me = find_missing_files('*/*/*/OTU_abs1e9.txt')


Union length: 200
Number of missing: 0
Number of empties: 1

In [196]:
pipeline_me


Out[196]:
{'empty': ['/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6'],
 'missing': []}

In [197]:
# rerunning 
exe = '/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6/SIPSimRun_SIPSim-pipeline.sh'
exe += ' 2> /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6/SIPSim_pipeline.log'
!$exe 
%pushnote SIPSim pipeline rerun complete


#-- SIPSim pipeline --#
# Adding diffusion
# Adding DBL contamination; abundance-weighted smearing
# Adding isotope incorporation to BD distribution
# Simulating an OTU table
# Simulating PCR
# Subsampling from the OTU table (simulating sequencing of the DNA pool)
# Making a wide-formatted table
# Making metadata (phyloseq: sample_data)

In [205]:
exe = '/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6/SIPSimRun_SIPSim-summary.sh'
exe += ' 2> /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6/SIPSim_summary.log'
!$exe 
%pushnote pipeline summary rerun complete

In [202]:
# exe = '/home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6/SIPSimRun_HRSIP.sh'
# exe += ' 2> /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6/HR-SIP.log'
# !$exe 
# %pushnote HRSIP rerun complete

In [203]:
pipeline_me = find_missing_files('*/*/*/OTU_abs1e9.txt')


Union length: 200
Number of missing: 0
Number of empties: 1

Finding all HR-SIP incompletes


In [231]:
HRSIP_me = find_missing_files('*/*/*/OTU_abs1e9_PCR_sub_filt_DESeq2')


Union length: 200
Number of missing: 75
Number of empties: 0

In [238]:
def run_HRSIP(dirpath):
    cmd = 'cd {}; {} 2> {}'.format(dirpath, './SIPSimRun_HRSIP.sh', 'HR-SIP.log')
    !$cmd

for FL in HRSIP_me.values():
    for D in FL:
        print 'Processing: {}'.format(D)
        run_HRSIP(D)


Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/1
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1306591 
Run 1 stress 0.1303777 
... New best solution
... procrustes: rmse 0.007102089  max resid 0.0444321 
Run 2 stress 0.1948695 
Run 3 stress 0.1306245 
... procrustes: rmse 0.007451967  max resid 0.04495998 
Run 4 stress 0.130682 
... procrustes: rmse 0.006855106  max resid 0.04451128 
Run 5 stress 0.2935093 
Run 6 stress 0.2017967 
Run 7 stress 0.1302226 
... New best solution
... procrustes: rmse 0.003597437  max resid 0.01851154 
Run 8 stress 0.1835123 
Run 9 stress 0.130223 
... procrustes: rmse 4.537866e-05  max resid 0.0001128968 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/3
Square root transformation
Wisconsin double standardization
Run 0 stress 0.08853476 
Run 1 stress 0.08856917 
... procrustes: rmse 0.001831047  max resid 0.01022147 
Run 2 stress 0.08856917 
... procrustes: rmse 0.001836033  max resid 0.01029533 
Run 3 stress 0.08856933 
... procrustes: rmse 0.001816577  max resid 0.01000817 
Run 4 stress 0.08856948 
... procrustes: rmse 0.001810952  max resid 0.01005284 
Run 5 stress 0.08853466 
... New best solution
... procrustes: rmse 3.687737e-05  max resid 0.0002295488 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/3
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1106961 
Run 1 stress 0.1106961 
... New best solution
... procrustes: rmse 3.162156e-05  max resid 0.0001619347 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/2
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1347496 
Run 1 stress 0.1347496 
... New best solution
... procrustes: rmse 3.508869e-06  max resid 1.440743e-05 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/5
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1203735 
Run 1 stress 0.1551046 
Run 2 stress 0.1845447 
Run 3 stress 0.1203154 
... New best solution
... procrustes: rmse 0.003830316  max resid 0.0265058 
Run 4 stress 0.1203154 
... New best solution
... procrustes: rmse 6.026132e-06  max resid 2.813622e-05 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/4
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1134243 
Run 1 stress 0.2015223 
Run 2 stress 0.1134133 
... New best solution
... procrustes: rmse 0.001119014  max resid 0.006327094 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/7
Square root transformation
Wisconsin double standardization
Run 0 stress 0.112631 
Run 1 stress 0.183573 
Run 2 stress 0.1479789 
Run 3 stress 0.1128627 
... procrustes: rmse 0.01213448  max resid 0.06714753 
Run 4 stress 0.112631 
... New best solution
... procrustes: rmse 1.279183e-05  max resid 4.305486e-05 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/6
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1331264 
Run 1 stress 0.1331264 
... New best solution
... procrustes: rmse 4.535944e-06  max resid 1.407154e-05 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/9
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1244531 
Run 1 stress 0.1248421 
... procrustes: rmse 0.008808623  max resid 0.02972768 
Run 2 stress 0.1248422 
... procrustes: rmse 0.008837484  max resid 0.02979646 
Run 3 stress 0.1244607 
... procrustes: rmse 0.01575284  max resid 0.05489619 
Run 4 stress 0.1593665 
Run 5 stress 0.1248421 
... procrustes: rmse 0.00880284  max resid 0.02971 
Run 6 stress 0.1931544 
Run 7 stress 0.1856622 
Run 8 stress 0.1745682 
Run 9 stress 0.1539621 
Run 10 stress 0.1244607 
... procrustes: rmse 0.01575155  max resid 0.05489122 
Run 11 stress 0.1593665 
Run 12 stress 0.1635021 
Run 13 stress 0.1244533 
... procrustes: rmse 0.0001718541  max resid 0.0006560815 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/8
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1240794 
Run 1 stress 0.1713324 
Run 2 stress 0.1246767 
Run 3 stress 0.1236839 
... New best solution
... procrustes: rmse 0.01243634  max resid 0.05753224 
Run 4 stress 0.1240687 
... procrustes: rmse 0.01294737  max resid 0.05852382 
Run 5 stress 0.1242769 
Run 6 stress 0.1240677 
... procrustes: rmse 0.01292224  max resid 0.05845632 
Run 7 stress 0.1240685 
... procrustes: rmse 0.01292835  max resid 0.05845659 
Run 8 stress 0.1242769 
Run 9 stress 0.1834162 
Run 10 stress 0.1240793 
... procrustes: rmse 0.01248793  max resid 0.05821776 
Run 11 stress 0.1374477 
Run 12 stress 0.1242769 
Run 13 stress 0.1242769 
Run 14 stress 0.1895549 
Run 15 stress 0.123687 
... procrustes: rmse 0.002090789  max resid 0.0134433 
Run 16 stress 0.123687 
... procrustes: rmse 0.002090931  max resid 0.01344554 
Run 17 stress 0.1240677 
... procrustes: rmse 0.01292356  max resid 0.05846123 
Run 18 stress 0.1921161 
Run 19 stress 0.1373245 
Run 20 stress 0.1240677 
... procrustes: rmse 0.01293267  max resid 0.05849495 
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/9
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1107951 
Run 1 stress 0.1107951 
... procrustes: rmse 4.085169e-05  max resid 0.0002500245 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/10
Square root transformation
Wisconsin double standardization
Run 0 stress 0.07875643 
Run 1 stress 0.1792806 
Run 2 stress 0.07875673 
... procrustes: rmse 4.427152e-05  max resid 0.0002313388 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/3
Square root transformation
Wisconsin double standardization
Run 0 stress 0.09022194 
Run 1 stress 0.1237548 
Run 2 stress 0.1173634 
Run 3 stress 0.09022194 
... procrustes: rmse 9.755399e-06  max resid 6.275165e-05 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/10
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1126639 
Run 1 stress 0.1126639 
... New best solution
... procrustes: rmse 9.302003e-06  max resid 5.451662e-05 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/8
Square root transformation
Wisconsin double standardization
Run 0 stress 0.08773048 
Run 1 stress 0.1709648 
Run 2 stress 0.08773049 
... procrustes: rmse 6.796153e-06  max resid 4.134755e-05 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/6
Square root transformation
Wisconsin double standardization
Run 0 stress 0.09573879 
Run 1 stress 0.09584208 
... procrustes: rmse 0.003182333  max resid 0.0132016 
Run 2 stress 0.1784272 
Run 3 stress 0.09573869 
... New best solution
... procrustes: rmse 9.105396e-05  max resid 0.0004967772 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/5
Square root transformation
Wisconsin double standardization
Run 0 stress 0.08112191 
Run 1 stress 0.08112191 
... procrustes: rmse 5.091931e-06  max resid 2.429293e-05 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/4
Square root transformation
Wisconsin double standardization
Run 0 stress 0.0983163 
Run 1 stress 0.09831449 
... New best solution
... procrustes: rmse 0.001815793  max resid 0.0126965 
Run 2 stress 0.09831732 
... procrustes: rmse 0.001014557  max resid 0.005381796 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/4
Square root transformation
Wisconsin double standardization
Run 0 stress 0.09043094 
Run 1 stress 0.09043094 
... New best solution
... procrustes: rmse 1.357128e-06  max resid 7.363228e-06 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/8
Square root transformation
Wisconsin double standardization
Run 0 stress 0.09670357 
Run 1 stress 0.09675156 
... procrustes: rmse 0.001239911  max resid 0.007523251 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/5
Square root transformation
Wisconsin double standardization
Run 0 stress 0.09067075 
Run 1 stress 0.1702241 
Run 2 stress 0.09105925 
... procrustes: rmse 0.004367738  max resid 0.02382829 
Run 3 stress 0.09105925 
... procrustes: rmse 0.00436775  max resid 0.02382645 
Run 4 stress 0.09131854 
Run 5 stress 0.1750379 
Run 6 stress 0.09105925 
... procrustes: rmse 0.004368944  max resid 0.02385645 
Run 7 stress 0.09131854 
Run 8 stress 0.09131854 
Run 9 stress 0.09067075 
... New best solution
... procrustes: rmse 7.404192e-06  max resid 3.200759e-05 
*** Solution reached
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/7
Square root transformation
Wisconsin double standardization
Run 0 stress 0.08930792 
Run 1 stress 0.08937975 
... procrustes: rmse 0.002153854  max resid 0.0113435 
Run 2 stress 0.1229354 
Run 3 stress 0.1400184 
Run 4 stress 0.08957023 
... procrustes: rmse 0.004427693  max resid 0.02591182 
Run 5 stress 0.122919 
Run 6 stress 0.08930156 
... New best solution
... procrustes: rmse 0.0008481135  max resid 0.004945288 
*** Solution reached
**OUTPUT MUTED**

In [239]:
HRSIP_me = find_missing_files('*/*/*/OTU_abs1e9_PCR_sub_filt_DESeq2')


Union length: 200
Number of missing: 0
Number of empties: 0

Finding all qSIP pipeline incompletes


In [212]:
qSIP_me = find_missing_files('*/*/*/*qSIP_atom.txt')


Union length: 200
Number of missing: 80
Number of empties: 1

re-running qSIP


In [ ]:
def run_qSIP(dirpath):
    #cmd = os.path.join(dirpath, 'SIPSimRun_qSIP.sh')
    #log = os.path.join(dirpath, 'qSIP.log')
    cmd = 'cd {}; perl -pi -e "s/--np 10/--np 20/" {}'.format(dirpath, 'SIPSimRun_qSIP.sh')
    !$cmd
    cmd = 'cd {}; {} 2> {}'.format(dirpath, './SIPSimRun_qSIP.sh', 'qSIP.log')
    !$cmd

for FL in qSIP_me.values():
    for D in FL:
        print 'Processing: {}'.format(D)
        run_qSIP(D)


Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6

In [ ]:
%pushnote qSIP rerun complete

re-running cMtx


In [228]:
cMtx_me = find_missing_files('*/*/*/qSIP-cMtx_overall.txt', empty_cut=200)


Union length: 200
Number of missing: 82
Number of empties: 0

In [242]:
def run_cMtx(dirpath):
    cmd = 'cd {}; {} 2> {}'.format(dirpath, './SIPSimRun_cMtx.sh', 'cMtx.log')
    !$cmd

for FL in cMtx_me.values():
    for D in FL:
        print 'Processing: {}'.format(D)
        run_cMtx(D)


Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/1
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/3
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/3
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/2
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/5
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/4
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/7
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/6
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/9
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/8
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/9
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/10
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/10
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/10
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/3
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/10
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/8
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/6
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/5
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/4
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/4
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/8
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/5
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/7
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/7
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/6
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/1
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/8
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/3
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/2
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/5
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/4
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/7
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/6
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/9
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/8
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/3
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/2
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/1/10
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/2
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/10
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/50/10
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/1
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/10
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/5
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/4
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/7
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/6
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/1
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/9
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/6
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/2
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/4
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/5
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/6
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/7
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/10/9
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/1
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/2
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/3
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/9
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/8
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/9
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/1
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/25/1
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/3
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/2
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/5
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/4
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/7
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/5/6
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/2
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/3
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/1
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/6
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/8
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/4
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/5
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/10/8
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/1/7
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/25/5/9
Processing: /home/nick/notebook/SIPSim/dev/bac_genome1147/atomIncorp_taxaIncorp/100/25/5

In [243]:
cMtx_me = find_missing_files('*/*/*/qSIP-cMtx_overall.txt', empty_cut=200)


Union length: 200
Number of missing: 0
Number of empties: 0

In [244]:
%pushnote cMtx rerun complete

In [ ]:


In [ ]: