infercnv运行测试4---这个只有15步就完成了

R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R是自由软件,不带任何担保。
在某些条件下你可以将其自由散布。
用'license()'或'licence()'来看散布的详细条件。

R是个合作计划,有许多人为之做出了贡献.
用'contributors()'来看合作者的详细情况
用'citation()'会告诉你如何在出版物中正确地引用R或R程序包。

用'demo()'来看一些示范程序,用'help()'来阅读在线帮助文件,或
用'help.start()'通过HTML浏览器来看帮助文件。
用'q()'退出R.
> rm(list=ls())
> options(stringsAsFactors = F)
> library(Seurat)

Seurat v4 will be going to CRAN in the near future;
 for more details, please visit https://satijalab.org/seurat/v4_changes

> library(ggplot2)
Need help? Try Stackoverflow:
https://stackoverflow.com/tags/ggplot2
> library(infercnv)
> expFile='expFile.txt' 
> groupFiles='groupFiles.txt'  
> geneFile='geneFile.txt'
> infercnv_obj = CreateInfercnvObject(raw_counts_matrix=expFile,
+                                     annotations_file=groupFiles,
+                                     delim="\t",
+                                     gene_order_file= geneFile,
+                                     ref_group_names=c('ref-endo' ,'ref-fib'))  ## 这个取决于自己的分组信息里面的
INFO [2021-03-11 08:29:18] Parsing matrix: expFile.txt
INFO [2021-03-11 08:31:13] Parsing gene order file: geneFile.txt
INFO [2021-03-11 08:31:13] Parsing cell annotations file: groupFiles.txt
INFO [2021-03-11 08:31:13] ::order_reduce:Start.
INFO [2021-03-11 08:31:13] .order_reduce(): expr and order match.
INFO [2021-03-11 08:31:14] ::process_data:order_reduce:Reduction from positional data, new dimensions (r,c) = 23449,6903 Total=9940369717 Min=0 Max=10408713.
INFO [2021-03-11 08:31:14] num genes removed taking into account provided gene ordering list: 1102 = 4.69956074885923% removed.
INFO [2021-03-11 08:31:14] -filtering out cells < 100 or > Inf, removing 0 % of cells
INFO [2021-03-11 08:31:19] validating infercnv_obj
>  
> dir.create("data")#新建,原来没有这个文件夹
Warning message:
In dir.create("data") : 'data'已存在
> 
> ##  文献的代码:#14:58开始
> start_time <- Sys.time()
> infercnv_obj2 = infercnv::run(infercnv_obj,
+                              cutoff=1,  
+                                out_dir=  'data/' , 
+                              cluster_by_groups=T,   # cluster
+                               hclust_method="ward.D2", 
+                              plot_steps=F,
+                              denoise=F,
+                              HMM=F) 
INFO [2021-03-11 08:31:19] ::process_data:Start
INFO [2021-03-11 08:31:19] Creating output path data/
INFO [2021-03-11 08:31:19] Checking for saved results.
INFO [2021-03-11 08:31:19] 
STEP 1: incoming data

INFO [2021-03-11 08:32:18]

STEP 02: Removing lowly expressed genes

INFO [2021-03-11 08:32:18] ::above_min_mean_expr_cutoff:Start
INFO [2021-03-11 08:32:19] Removing 7313 genes from matrix as below mean expr threshold: 1
INFO [2021-03-11 08:32:20] validating infercnv_obj
INFO [2021-03-11 08:32:20] There are 15034 genes and 6903 cells remaining in the expr matrix.
INFO [2021-03-11 08:32:29] no genes removed due to min cells/gene filter
INFO [2021-03-11 08:33:29]

STEP 03: normalization by sequencing depth

INFO [2021-03-11 08:33:29] normalizing counts matrix by depth
INFO [2021-03-11 08:33:43] Computed total sum normalization factor as median libsize: 956458.000000
INFO [2021-03-11 08:34:37]

STEP 04: log transformation of data

INFO [2021-03-11 08:34:37] transforming log2xplus1()
INFO [2021-03-11 08:35:36]

STEP 08: removing average of reference data (before smoothing)

INFO [2021-03-11 08:35:36] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-11 08:35:36] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-11 08:36:02] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-11 08:37:34]

STEP 09: apply max centered expression threshold: 3

INFO [2021-03-11 08:37:34] ::process_data:setting max centered expr, threshold set to: +/-: 3
INFO [2021-03-11 08:38:49]

STEP 10: Smoothing data per cell by chromosome

INFO [2021-03-11 08:38:49] smooth_by_chromosome: chr: chr1
INFO [2021-03-11 08:39:03] smooth_by_chromosome: chr: chr10
INFO [2021-03-11 08:39:14] smooth_by_chromosome: chr: chr11
INFO [2021-03-11 08:39:25] smooth_by_chromosome: chr: chr12
INFO [2021-03-11 08:39:36] smooth_by_chromosome: chr: chr13
INFO [2021-03-11 08:39:45] smooth_by_chromosome: chr: chr14
INFO [2021-03-11 08:39:56] smooth_by_chromosome: chr: chr15
INFO [2021-03-11 08:40:06] smooth_by_chromosome: chr: chr16
INFO [2021-03-11 08:40:18] smooth_by_chromosome: chr: chr17
INFO [2021-03-11 08:40:30] smooth_by_chromosome: chr: chr18
INFO [2021-03-11 08:40:40] smooth_by_chromosome: chr: chr19
INFO [2021-03-11 08:40:53] smooth_by_chromosome: chr: chr2
INFO [2021-03-11 08:41:06] smooth_by_chromosome: chr: chr20
INFO [2021-03-11 08:41:16] smooth_by_chromosome: chr: chr21
INFO [2021-03-11 08:41:25] smooth_by_chromosome: chr: chr22
INFO [2021-03-11 08:41:36] smooth_by_chromosome: chr: chr3
INFO [2021-03-11 08:41:48] smooth_by_chromosome: chr: chr4
INFO [2021-03-11 08:41:58] smooth_by_chromosome: chr: chr5
INFO [2021-03-11 08:42:09] smooth_by_chromosome: chr: chr6
INFO [2021-03-11 08:42:20] smooth_by_chromosome: chr: chr7
INFO [2021-03-11 08:42:31] smooth_by_chromosome: chr: chr8
INFO [2021-03-11 08:42:41] smooth_by_chromosome: chr: chr9
INFO [2021-03-11 08:44:10]

STEP 11: re-centering data across chromosome after smoothing

INFO [2021-03-11 08:44:10] ::center_smooth across chromosomes per cell
INFO [2021-03-11 08:46:07]

STEP 12: removing average of reference data (after smoothing)

INFO [2021-03-11 08:46:07] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-11 08:46:07] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-11 08:46:26] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-11 08:47:47]

STEP 14: invert log2(FC) to FC

INFO [2021-03-11 08:47:47] invert_log2(), computing 2^x
INFO [2021-03-11 08:49:10]

STEP 15: Clustering samples (not defining tumor subclusters)

INFO [2021-03-11 08:49:10] define_signif_tumor_subclusters(p_val=0.1
INFO [2021-03-11 08:49:10] define_signif_tumor_subclusters(), tumor: epi
INFO [2021-03-11 11:29:43] cut tree into: 1 groups
INFO [2021-03-11 11:29:43] -processing epi,epi_s1
INFO [2021-03-11 11:29:43] define_signif_tumor_subclusters(), tumor: spike-fib
INFO [2021-03-11 11:29:55] cut tree into: 1 groups
INFO [2021-03-11 11:29:55] -processing spike-fib,spike-fib_s1
INFO [2021-03-11 11:29:55] define_signif_tumor_subclusters(), tumor: spike-endo
INFO [2021-03-11 11:30:08] cut tree into: 1 groups
INFO [2021-03-11 11:30:08] -processing spike-endo,spike-endo_s1
INFO [2021-03-11 11:30:08] define_signif_tumor_subclusters(), tumor: ref-endo
INFO [2021-03-11 11:31:00] cut tree into: 1 groups
INFO [2021-03-11 11:31:00] -processing ref-endo,ref-endo_s1
INFO [2021-03-11 11:31:00] define_signif_tumor_subclusters(), tumor: ref-fib
INFO [2021-03-11 11:31:52] cut tree into: 1 groups
INFO [2021-03-11 11:31:52] -processing ref-fib,ref-fib_s1
INFO [2021-03-11 11:34:08] ::plot_cnv:Start
INFO [2021-03-11 11:34:08] ::plot_cnv:Current data dimensions (r,c)=15034,6903 Total=104935060.812655 Min=0.274614818050265 Max=3.47381304931877.
INFO [2021-03-11 11:34:08] ::plot_cnv:Depending on the size of the matrix this may take a moment.
INFO [2021-03-11 11:39:21] plot_cnv(): auto thresholding at: (0.513715 , 1.508550)
INFO [2021-03-11 11:39:25] plot_cnv_observation:Start
INFO [2021-03-11 11:39:25] Observation data size: Cells= 5903 Genes= 15034
INFO [2021-03-11 11:39:27] plot_cnv_observation:Writing observation groupings/color.
INFO [2021-03-11 11:39:27] plot_cnv_observation:Done writing observation groupings/color.
INFO [2021-03-11 11:39:27] plot_cnv_observation:Writing observation heatmap thresholds.
INFO [2021-03-11 11:39:27] plot_cnv_observation:Done writing observation heatmap thresholds.
INFO [2021-03-11 11:39:48] Colors for breaks: #00008B,#24249B,#4848AB,#6D6DBC,#9191CC,#B6B6DD,#DADAEE,#FFFFFF,#EEDADA,#DDB6B6,#CC9191,#BC6D6D,#AB4848,#9B2424,#8B0000
INFO [2021-03-11 11:39:48] Quantiles of plotted data range: 0.513715316376733,0.917554531504774,1,1.08606377720558,1.50855028644134
INFO [2021-03-11 11:40:01] plot_cnv_observations:Writing observation data to data//infercnv.preliminary.observations.txt
INFO [2021-03-11 11:44:29] plot_cnv_references:Start
INFO [2021-03-11 11:44:29] Reference data size: Cells= 1000 Genes= 15034
INFO [2021-03-11 11:46:29] plot_cnv_references:Number reference groups= 2
INFO [2021-03-11 11:46:29] plot_cnv_references:Plotting heatmap.
INFO [2021-03-11 11:46:31] Colors for breaks: #00008B,#24249B,#4848AB,#6D6DBC,#9191CC,#B6B6DD,#DADAEE,#FFFFFF,#EEDADA,#DDB6B6,#CC9191,#BC6D6D,#AB4848,#9B2424,#8B0000
INFO [2021-03-11 11:46:31] Quantiles of plotted data range: 0.513715316376733,0.939733109699739,1,1.06076925167946,1.50855028644134
INFO [2021-03-11 11:46:32] plot_cnv_references:Writing reference data to data//infercnv.preliminary.references.txt
INFO [2021-03-11 11:48:27]

Making the final infercnv heatmap

INFO [2021-03-11 11:48:28] ::plot_cnv:Start
INFO [2021-03-11 11:48:28] ::plot_cnv:Current data dimensions (r,c)=15034,6903 Total=104935060.812655 Min=0.274614818050265 Max=3.47381304931877.
INFO [2021-03-11 11:48:29] ::plot_cnv:Depending on the size of the matrix this may take a moment.
INFO [2021-03-11 11:53:47] plot_cnv(): auto thresholding at: (0.478067 , 1.521933)
INFO [2021-03-11 11:53:51] plot_cnv_observation:Start
INFO [2021-03-11 11:53:51] Observation data size: Cells= 5903 Genes= 15034
INFO [2021-03-11 11:53:52] plot_cnv_observation:Writing observation groupings/color.
INFO [2021-03-11 11:53:52] plot_cnv_observation:Done writing observation groupings/color.
INFO [2021-03-11 11:53:53] plot_cnv_observation:Writing observation heatmap thresholds.
INFO [2021-03-11 11:53:53] plot_cnv_observation:Done writing observation heatmap thresholds.
INFO [2021-03-11 11:54:13] Colors for breaks: #00008B,#24249B,#4848AB,#6D6DBC,#9191CC,#B6B6DD,#DADAEE,#FFFFFF,#EEDADA,#DDB6B6,#CC9191,#BC6D6D,#AB4848,#9B2424,#8B0000
INFO [2021-03-11 11:54:13] Quantiles of plotted data range: 0.478066971720371,0.917554531504774,1,1.08606377720558,1.52193302827963
INFO [2021-03-11 11:54:24] plot_cnv_observations:Writing observation data to data//infercnv.observations.txt
INFO [2021-03-11 11:58:53] plot_cnv_references:Start
INFO [2021-03-11 11:58:53] Reference data size: Cells= 1000 Genes= 15034
INFO [2021-03-11 12:00:45] plot_cnv_references:Number reference groups= 2
INFO [2021-03-11 12:00:46] plot_cnv_references:Plotting heatmap.
INFO [2021-03-11 12:00:48] Colors for breaks: #00008B,#24249B,#4848AB,#6D6DBC,#9191CC,#B6B6DD,#DADAEE,#FFFFFF,#EEDADA,#DDB6B6,#CC9191,#BC6D6D,#AB4848,#9B2424,#8B0000
INFO [2021-03-11 12:00:48] Quantiles of plotted data range: 0.478066971720371,0.939733109699739,1,1.06076925167946,1.52193302827963
INFO [2021-03-11 12:00:49] plot_cnv_references:Writing reference data to data//infercnv.references.txt
Warning messages:
1: In dir.create(out_dir) : 'data'已存在
2: In dir.create(out_dir) : 'data'已存在
3: In dir.create(out_dir) : 'data'已存在

end_time <- Sys.time()
end_time - start_time
Time difference of 3.504011 hours

你可能感兴趣的:(infercnv运行测试4---这个只有15步就完成了)