In [1]:
import os
workDir = '/var/seq_data/ncbi_db/genome/Jan2016/ampFrags/'
genomeDir = '/var/seq_data/ncbi_db/genome/Jan2016/bac_complete_rn/'
ampliconFile = '/var/seq_data/ncbi_db/genome/Jan2016/rnammer_aln/otusn_map_nonSingle.txt'
In [2]:
%load_ext rpy2.ipython
%load_ext pushnote
In [3]:
%%R
library(dplyr)
library(tidyr)
library(ggplot2)
In [4]:
if not os.path.isdir(workDir):
os.makedirs(workDir)
%cd $workDir
In [5]:
# simlink amplicon OTU map file
tmp = os.path.join(workDir, '../', ampliconFile)
!ln -s -f $tmp .
In [6]:
!head -n 3 $ampliconFile
In [7]:
!cut -f 13 $ampliconFile | head
In [8]:
!cut -f 13 $ampliconFile | \
sort -u | \
perl -pe 's|^|../bac_complete_rn/|' | \
xargs -I % ln -s -f % .
In [9]:
!cut -f 13 $ampliconFile | sort -u | wc -l
!find . -name "*.fna" | wc -l
In [10]:
!ls -thlc 2>/dev/null | head -n 4
In [13]:
!cut -f 13 $ampliconFile | perl -pe 's/(.+).fna/\$1\t\$1\.fna/' | sort -u > genome_index.txt
!wc -l genome_index.txt
!head genome_index.txt
In [14]:
!SIPSim genome_index \
genome_index.txt \
--fp . --np 26 \
> index_log.txt \
2> index_log_err.txt
In [17]:
!find . -name "*sqlite3.db" | wc -l
In [18]:
# copy primer file
!cp /home/nick/notebook/SIPSim/dev/515F-806R.fna ../
In [ ]:
!SIPSim fragments \
genome_index.txt \
--fp $workDir \
--fr ../515F-806R.fna \
--fld skewed-normal,9000,2500,-5 \
--flr None,None \
--nf 10000 \
--np 20 \
2> ../ampFrags.log \
> ../ampFrags.pkl
In [21]:
!ls -thlc ../ampFrags.pkl
In [23]:
!SIPSim fragment_KDE ../ampFrags.pkl > ../ampFrags_KDE.pkl
In [25]:
!ls -thlc ../ampFrags_KDE.pkl
In [ ]: