Description

  • Calculating summary tables (eg., shannon index) on trimmed fullCyc 12C-con dataset
  • These tables can be used for regression/correlation analysis against simulation data

Setting variables


In [1]:
workDir = '/home/nick/notebook/SIPSim/dev/fullCyc_trim/'

emp_data = 'SIP-core_unk_trm'
emp_data_preFrac = 'bulk-core_trm'

Init


In [2]:
import os
import sys
%load_ext rpy2.ipython
%load_ext pushnote

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


/home/nick/notebook/SIPSim/dev/fullCyc_trim

Making a table of shannon index for each fraction community


In [10]:
!/home/nick/notebook/SIPSim/lib/R/shannon_calc.r -l \
    $emp_data > SIP-core_unk_shan.txt

!echo; head SIP-core_unk_shan.txt


Warning messages:
1: replacing previous import by ‘scales::alpha’ when loading ‘phyloseq’ 
2: replacing previous import by ‘ggplot2::Position’ when loading ‘DESeq2’ 
Warning message:
In inner_join_impl(x, y, by$x, by$y) :
  joining character vector and factor, coercing into character vector

library	sample	OTU	Buoyant_density	shannon
3	12C-Con.D3.R3_F20	OTU.1130	1.70126896	5.20980694316378
3	12C-Con.D3.R3_F18	OTU.1130	1.71001104	5.42097401603391
3	12C-Con.D3.R3_F11	OTU.1130	1.73733004	4.75977214585746
3	12C-Con.D3.R3_F22	OTU.1130	1.69361964	4.35824967863782
3	12C-Con.D3.R3_F8	OTU.1130	1.75153592	4.50411358862617
3	12C-Con.D3.R3_F17	OTU.1130	1.71328932	5.35473492287458
3	12C-Con.D3.R3_F15	OTU.1130	1.71984588	5.04802706630564
3	12C-Con.D3.R3_F16	OTU.1130	1.71766036	4.91284437387751
3	12C-Con.D3.R3_F19	OTU.1130	1.70564	5.41119766347407

Making a table of variance in BD spans

  • binning pre-fractionation abundances
  • calculating variance of BD span in each bin

In [8]:
!/home/nick/notebook/SIPSim/lib/R/BD_span_calc.r -l \
    $emp_data $emp_data_preFrac > SIP-core_unk_trm_BD-span.txt

!echo; head SIP-core_unk_trm_BD-span.txt


Warning messages:
1: replacing previous import by ‘scales::alpha’ when loading ‘phyloseq’ 
2: replacing previous import by ‘ggplot2::Position’ when loading ‘DESeq2’ 
Warning message:
In inner_join_impl(x, y, by$x, by$y) :
  joining character vector and factor, coercing into character vector

OTU	library	mean_preFrac_abund	min_BD	max_BD	BD_range	BD_range_perc
OTU.1	1	0.0302142952216159	1.67613548	1.77339112	0.0972556400000002	100
OTU.1	14	0.0338197822561964	1.67722824	1.7712056	0.09397736	100
OTU.1	3	0.0968542224868512	1.67504272	1.76792732	0.0928846000000001	100
OTU.1	30	0.0201618837380427	1.67504272	1.76683456	0.09179184	100
OTU.1	48	0.0132470498667682	1.67504272	1.76902008	0.09397736	100
OTU.1	6	0.0743107888963083	1.67613548	1.76902008	0.0928846000000001	100
OTU.10	1	0.00126447491015573	1.67613548	1.77339112	0.0972556400000002	100
OTU.10	14	0.00550150567523743	1.67722824	1.7712056	0.09397736	100
OTU.10	3	0.00625186067281929	1.67504272	1.76792732	0.0928846000000001	100

Making a community ~ BD correlogram


In [7]:
!/home/nick/notebook/SIPSim/lib/R/correlogram_make.r -l \
    $emp_data > SIP-core_unk_trm_corr.txt

!echo; head SIP-core_unk_trm_corr.txt


Warning messages:
1: replacing previous import by ‘scales::alpha’ when loading ‘phyloseq’ 
2: replacing previous import by ‘ggplot2::Position’ when loading ‘DESeq2’ 
Warning message:
In class(x) <- c("tbl_df", "tbl", "data.frame") :
  Setting class(x) to multiple strings ("tbl_df", "tbl", ...); result will no longer be an S4 object

library	class.index	n.dist	Mantel.corr	Pr	Pr.corr
3	0.00407508416666661	42	0.331706071854786	0.001	0.001
3	0.00785421250000005	36	0.19639324714689	0.001	0.002
3	0.0116333408333334	38	0.0530221584985681	0.145	0.145
3	0.0154124691666667	34	-0.0529265612029437	0.133	0.266
3	0.0191915975000001	38	-0.117836888575665	0.004	0.012
3	0.0229707258333334	34	-0.165359556577443	0.001	0.006
3	0.0267498541666667	32	-0.16049259338204	0.001	0.007
3	0.0305289825000001	28	-0.133471979780941	0.002	0.008
3	0.0343081108333334	28	-0.0994298276283408	0.015	0.045

In [ ]: