infercnv运行测试5---15步完成

R version 4.0.2 (2020-06-22) -- "Taking Off Again"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> dir.create("plot_out")#新建,原来没有这个文件夹
> 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

Warning message:
程辑包‘Seurat’是用R版本4.0.3 来建造的 
> library(ggplot2)
RStudio Community is a great place to get help: https://community.rstudio.com/c/tidyverse
> library(infercnv)
Warning message:
程辑包‘infercnv’是用R版本4.0.3 来建造的 
> 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:33:30] Parsing matrix: expFile.txt
INFO [2021-03-11 08:35:17] Parsing gene order file: geneFile.txt
INFO [2021-03-11 08:35:17] Parsing cell annotations file: groupFiles.txt
INFO [2021-03-11 08:35:17] ::order_reduce:Start.
INFO [2021-03-11 08:35:17] .order_reduce(): expr and order match.
INFO [2021-03-11 08:35:18] ::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:35:19] num genes removed taking into account provided gene ordering list: 1102 = 4.69956074885923% removed.
INFO [2021-03-11 08:35:19] -filtering out cells < 100 or > Inf, removing 0 % of cells
INFO [2021-03-11 08:35:24] validating infercnv_obj
>  
> dir.create("plot_out")#新建,原来没有这个文件夹
Warning message:
In dir.create("plot_out") : 'plot_out' already exists
> 
> ##  文献的代码:#14:58开始
> start_time <- Sys.time()
> infercnv_obj2 = infercnv::run(infercnv_obj,
+                              cutoff=1,  
+                              out_dir=  'plot_out/' , 
+                              cluster_by_groups=T,   # cluster
+                               hclust_method="ward.D2", 
+                              plot_steps=F,
+                              denoise=F,
+                              HMM=F) 
INFO [2021-03-11 08:35:24] ::process_data:Start
INFO [2021-03-11 08:35:24] Creating output path plot_out/
INFO [2021-03-11 08:35:24] Checking for saved results.
INFO [2021-03-11 08:35:24] 
STEP 1: incoming data

INFO [2021-03-11 08:36:16]

STEP 02: Removing lowly expressed genes

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

STEP 03: normalization by sequencing depth

INFO [2021-03-11 08:37:19] normalizing counts matrix by depth
INFO [2021-03-11 08:37:36] Computed total sum normalization factor as median libsize: 956458.000000
INFO [2021-03-11 08:38:18]

STEP 04: log transformation of data

INFO [2021-03-11 08:38:18] transforming log2xplus1()
INFO [2021-03-11 08:39:06]

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

INFO [2021-03-11 08:39:06] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-11 08:39:06] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-11 08:39:32] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-11 08:40:53]

STEP 09: apply max centered expression threshold: 3

INFO [2021-03-11 08:40:53] ::process_data:setting max centered expr, threshold set to: +/-: 3
INFO [2021-03-11 08:41:57]

STEP 10: Smoothing data per cell by chromosome

INFO [2021-03-11 08:41:57] smooth_by_chromosome: chr: chr1
INFO [2021-03-11 08:42:08] smooth_by_chromosome: chr: chr10
INFO [2021-03-11 08:42:16] smooth_by_chromosome: chr: chr11
INFO [2021-03-11 08:42:26] smooth_by_chromosome: chr: chr12
INFO [2021-03-11 08:42:35] smooth_by_chromosome: chr: chr13
INFO [2021-03-11 08:42:43] smooth_by_chromosome: chr: chr14
INFO [2021-03-11 08:42:50] smooth_by_chromosome: chr: chr15
INFO [2021-03-11 08:42:58] smooth_by_chromosome: chr: chr16
INFO [2021-03-11 08:43:07] smooth_by_chromosome: chr: chr17
INFO [2021-03-11 08:43:17] smooth_by_chromosome: chr: chr18
INFO [2021-03-11 08:43:23] smooth_by_chromosome: chr: chr19
INFO [2021-03-11 08:43:34] smooth_by_chromosome: chr: chr2
INFO [2021-03-11 08:43:44] smooth_by_chromosome: chr: chr20
INFO [2021-03-11 08:43:51] smooth_by_chromosome: chr: chr21
INFO [2021-03-11 08:43:58] smooth_by_chromosome: chr: chr22
INFO [2021-03-11 08:44:05] smooth_by_chromosome: chr: chr3
INFO [2021-03-11 08:44:15] smooth_by_chromosome: chr: chr4
INFO [2021-03-11 08:44:23] smooth_by_chromosome: chr: chr5
INFO [2021-03-11 08:44:33] smooth_by_chromosome: chr: chr6
INFO [2021-03-11 08:57:24] smooth_by_chromosome: chr: chr7
INFO [2021-03-11 08:57:33] smooth_by_chromosome: chr: chr8
INFO [2021-03-11 08:57:41] smooth_by_chromosome: chr: chr9
INFO [2021-03-11 08:58:59]

STEP 11: re-centering data across chromosome after smoothing

INFO [2021-03-11 08:58:59] ::center_smooth across chromosomes per cell
INFO [2021-03-11 09:01:07]

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

INFO [2021-03-11 09:01:07] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-11 09:01:07] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-11 09:01:23] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-11 09:02:54]

STEP 14: invert log2(FC) to FC

INFO [2021-03-11 09:02:54] invert_log2(), computing 2^x
INFO [2021-03-11 09:04:22]

STEP 15: Clustering samples (not defining tumor subclusters)

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

Making the final infercnv heatmap

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

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

其中第15步耗时3.5h

你可能感兴趣的:(infercnv运行测试5---15步完成)