18391 gene 11000个细胞
48小时未完成
自己主动结束了
> rm(list=ls())
> options(stringsAsFactors = F)
> library(Seurat)
> library(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-fib')) ## 这个取决于自己的分组信息里面的
INFO [2021-03-12 23:25:00] Parsing matrix: expFile.txt
INFO [2021-03-12 23:27:38] Parsing gene order file: geneFile.txt
INFO [2021-03-12 23:27:38] Parsing cell annotations file: groupFiles.txt
INFO [2021-03-12 23:27:38] ::order_reduce:Start.
INFO [2021-03-12 23:27:39] .order_reduce(): expr and order match.
INFO [2021-03-12 23:27:40] ::process_data:order_reduce:Reduction from positional data, new dimensions (r,c) = 18391,11063 Total=126349717 Min=0 Max=3041.
INFO [2021-03-12 23:27:40] num genes removed taking into account provided gene ordering list: 587 = 3.19177858735251% removed.
INFO [2021-03-12 23:27:40] -filtering out cells < 100 or > Inf, removing 0 % of cells
INFO [2021-03-12 23:27:46] validating infercnv_obj
>
> ## 文献的代码:#14:58开始
> start_time <- Sys.time()
> infercnv_obj2 = infercnv::run(infercnv_obj,
+ cutoff=0.1, # cutoff=1 works well for Smart-seq2, and cutoff=0.1 works well for 10x Genomics
+ out_dir='plot_out2/' ,
+ cluster_by_groups=T, # cluster
+ hclust_method="ward.D2",
+ plot_steps=F,
+ denoise=T,
+ HMM=T)
INFO [2021-03-12 23:27:46] ::process_data:Start
INFO [2021-03-12 23:27:46] Creating output path plot_out2/
INFO [2021-03-12 23:27:46] Checking for saved results.
INFO [2021-03-12 23:27:46]
STEP 1: incoming data
INFO [2021-03-12 23:28:21]
STEP 02: Removing lowly expressed genes
INFO [2021-03-12 23:28:21] ::above_min_mean_expr_cutoff:Start
INFO [2021-03-12 23:28:22] Removing 11683 genes from matrix as below mean expr threshold: 0.1
INFO [2021-03-12 23:28:22] validating infercnv_obj
INFO [2021-03-12 23:28:22] There are 6121 genes and 11063 cells remaining in the expr matrix.
INFO [2021-03-12 23:28:27] no genes removed due to min cells/gene filter
INFO [2021-03-12 23:28:49]
STEP 03: normalization by sequencing depth
INFO [2021-03-12 23:28:49] normalizing counts matrix by depth
INFO [2021-03-12 23:28:53] Computed total sum normalization factor as median libsize: 9307.000000
INFO [2021-03-12 23:28:54] Adding h-spike
INFO [2021-03-12 23:28:54] -hspike modeling of ref-fib
INFO [2021-03-12 23:30:24] validating infercnv_obj
INFO [2021-03-12 23:30:24] normalizing counts matrix by depth
INFO [2021-03-12 23:30:24] Using specified normalization factor: 9307.000000
INFO [2021-03-12 23:30:49]
STEP 04: log transformation of data
INFO [2021-03-12 23:30:49] transforming log2xplus1()
INFO [2021-03-12 23:30:52] -mirroring for hspike
INFO [2021-03-12 23:30:52] transforming log2xplus1()
INFO [2021-03-12 23:31:16]
STEP 08: removing average of reference data (before smoothing)
INFO [2021-03-12 23:31:16] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-12 23:31:16] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-12 23:31:24] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-12 23:31:30] -mirroring for hspike
INFO [2021-03-12 23:31:30] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-12 23:31:30] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-12 23:31:33] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-12 23:32:06]
STEP 09: apply max centered expression threshold: 3
INFO [2021-03-12 23:32:06] ::process_data:setting max centered expr, threshold set to: +/-: 3
INFO [2021-03-12 23:32:07] -mirroring for hspike
INFO [2021-03-12 23:32:07] ::process_data:setting max centered expr, threshold set to: +/-: 3
INFO [2021-03-12 23:32:41]
STEP 10: Smoothing data per cell by chromosome
INFO [2021-03-12 23:32:41] smooth_by_chromosome: chr: chr1
INFO [2021-03-12 23:32:53] smooth_by_chromosome: chr: chr10
INFO [2021-03-12 23:33:04] smooth_by_chromosome: chr: chr11
INFO [2021-03-12 23:33:16] smooth_by_chromosome: chr: chr12
INFO [2021-03-12 23:33:27] smooth_by_chromosome: chr: chr13
INFO [2021-03-12 23:33:37] smooth_by_chromosome: chr: chr14
INFO [2021-03-12 23:33:49] smooth_by_chromosome: chr: chr15
INFO [2021-03-12 23:33:59] smooth_by_chromosome: chr: chr16
INFO [2021-03-12 23:34:10] smooth_by_chromosome: chr: chr17
INFO [2021-03-12 23:34:22] smooth_by_chromosome: chr: chr18
INFO [2021-03-12 23:34:29] smooth_by_chromosome: chr: chr19
INFO [2021-03-12 23:34:41] smooth_by_chromosome: chr: chr2
INFO [2021-03-12 23:34:53] smooth_by_chromosome: chr: chr20
INFO [2021-03-12 23:35:03] smooth_by_chromosome: chr: chr21
INFO [2021-03-12 23:35:09] smooth_by_chromosome: chr: chr22
INFO [2021-03-12 23:35:19] smooth_by_chromosome: chr: chr3
INFO [2021-03-12 23:35:31] smooth_by_chromosome: chr: chr4
INFO [2021-03-12 23:35:41] smooth_by_chromosome: chr: chr5
INFO [2021-03-12 23:35:53] smooth_by_chromosome: chr: chr6
INFO [2021-03-12 23:36:05] smooth_by_chromosome: chr: chr7
INFO [2021-03-12 23:36:16] smooth_by_chromosome: chr: chr8
INFO [2021-03-12 23:36:27] smooth_by_chromosome: chr: chr9
INFO [2021-03-12 23:36:38] -mirroring for hspike
INFO [2021-03-12 23:36:38] smooth_by_chromosome: chr: chrA
INFO [2021-03-12 23:36:38] smooth_by_chromosome: chr: chr_0
INFO [2021-03-12 23:36:38] smooth_by_chromosome: chr: chr_B
INFO [2021-03-12 23:36:39] smooth_by_chromosome: chr: chr_0pt5
INFO [2021-03-12 23:36:39] smooth_by_chromosome: chr: chr_C
INFO [2021-03-12 23:36:39] smooth_by_chromosome: chr: chr_1pt5
INFO [2021-03-12 23:36:39] smooth_by_chromosome: chr: chr_D
INFO [2021-03-12 23:36:39] smooth_by_chromosome: chr: chr_2pt0
INFO [2021-03-12 23:36:40] smooth_by_chromosome: chr: chr_E
INFO [2021-03-12 23:36:40] smooth_by_chromosome: chr: chr_3pt0
INFO [2021-03-12 23:36:40] smooth_by_chromosome: chr: chr_F
INFO [2021-03-12 23:37:19]
STEP 11: re-centering data across chromosome after smoothing
INFO [2021-03-12 23:37:19] ::center_smooth across chromosomes per cell
INFO [2021-03-12 23:37:31] -mirroring for hspike
INFO [2021-03-12 23:37:31] ::center_smooth across chromosomes per cell
INFO [2021-03-12 23:38:12]
STEP 12: removing average of reference data (after smoothing)
INFO [2021-03-12 23:38:12] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-12 23:38:12] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-12 23:38:20] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-12 23:38:27] -mirroring for hspike
INFO [2021-03-12 23:38:27] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-12 23:38:27] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-12 23:38:29] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-12 23:39:07]
STEP 14: invert log2(FC) to FC
INFO [2021-03-12 23:39:07] invert_log2(), computing 2^x
INFO [2021-03-12 23:39:17] -mirroring for hspike
INFO [2021-03-12 23:39:17] invert_log2(), computing 2^x
INFO [2021-03-12 23:40:04]
STEP 15: Clustering samples (not defining tumor subclusters)
INFO [2021-03-12 23:40:04] define_signif_tumor_subclusters(p_val=0.1
INFO [2021-03-12 23:40:04] define_signif_tumor_subclusters(), tumor: epi
INFO [2021-03-13 02:37:51] cut tree into: 1 groups
INFO [2021-03-13 02:37:51] -processing epi,epi_s1
INFO [2021-03-13 02:37:51] define_signif_tumor_subclusters(), tumor: ref-fib
INFO [2021-03-13 02:37:53] cut tree into: 1 groups
INFO [2021-03-13 02:37:53] -processing ref-fib,ref-fib_s1
INFO [2021-03-13 02:37:53] -mirroring for hspike
INFO [2021-03-13 02:37:53] define_signif_tumor_subclusters(p_val=0.1
INFO [2021-03-13 02:37:53] define_signif_tumor_subclusters(), tumor: spike_tumor_cell_ref-fib
INFO [2021-03-13 02:37:53] cut tree into: 1 groups
INFO [2021-03-13 02:37:53] -processing spike_tumor_cell_ref-fib,spike_tumor_cell_ref-fib_s1
INFO [2021-03-13 02:37:53] define_signif_tumor_subclusters(), tumor: simnorm_cell_ref-fib
INFO [2021-03-13 02:37:54] cut tree into: 1 groups
INFO [2021-03-13 02:37:54] -processing simnorm_cell_ref-fib,simnorm_cell_ref-fib_s1
INFO [2021-03-13 02:39:28] ::plot_cnv:Start
INFO [2021-03-13 02:39:28] ::plot_cnv:Current data dimensions (r,c)=6121,11063 Total=68099334.2894841 Min=0.585987027896766 Max=1.83603009047539.
INFO [2021-03-13 02:39:28] ::plot_cnv:Depending on the size of the matrix this may take a moment.
INFO [2021-03-13 02:42:51] plot_cnv(): auto thresholding at: (0.757548 , 1.253755)
INFO [2021-03-13 02:42:53] plot_cnv_observation:Start
INFO [2021-03-13 02:42:53] Observation data size: Cells= 10842 Genes= 6121
INFO [2021-03-13 02:42:55] plot_cnv_observation:Writing observation groupings/color.
INFO [2021-03-13 02:42:55] plot_cnv_observation:Done writing observation groupings/color.
INFO [2021-03-13 02:42:55] plot_cnv_observation:Writing observation heatmap thresholds.
INFO [2021-03-13 02:42:55] plot_cnv_observation:Done writing observation heatmap thresholds.
INFO [2021-03-13 02:43:10] Colors for breaks: #00008B,#24249B,#4848AB,#6D6DBC,#9191CC,#B6B6DD,#DADAEE,#FFFFFF,#EEDADA,#DDB6B6,#CC9191,#BC6D6D,#AB4848,#9B2424,#8B0000
INFO [2021-03-13 02:43:10] Quantiles of plotted data range: 0.757548339156505,0.951395217414696,0.997192826722825,1.04958131745595,1.25375497966032
INFO [2021-03-13 02:43:22] plot_cnv_observations:Writing observation data to plot_out2//infercnv.preliminary.observations.txt
INFO [2021-03-13 02:46:44] plot_cnv_references:Start
INFO [2021-03-13 02:46:44] Reference data size: Cells= 221 Genes= 6121
INFO [2021-03-13 02:46:46] plot_cnv_references:Number reference groups= 1
INFO [2021-03-13 02:46:46] plot_cnv_references:Plotting heatmap.
INFO [2021-03-13 02:46:46] Colors for breaks: #00008B,#24249B,#4848AB,#6D6DBC,#9191CC,#B6B6DD,#DADAEE,#FFFFFF,#EEDADA,#DDB6B6,#CC9191,#BC6D6D,#AB4848,#9B2424,#8B0000
INFO [2021-03-13 02:46:46] Quantiles of plotted data range: 0.820560260295382,0.969895328336921,0.996942296253679,1.02835680397275,1.25375497966032
INFO [2021-03-13 02:46:47] plot_cnv_references:Writing reference data to plot_out2//infercnv.preliminary.references.txt
INFO [2021-03-13 02:46:51]
STEP 17: HMM-based CNV prediction
INFO [2021-03-13 02:46:51] predict_CNV_via_HMM_on_whole_tumor_samples
INFO [2021-03-13 02:46:55] -done predicting CNV based on initial tumor subclusters
INFO [2021-03-13 02:47:12] get_predicted_CNV_regions(subcluster)
INFO [2021-03-13 02:47:12] -processing cell_group_name: epi.epi_s1, size: 10842
INFO [2021-03-13 02:48:29] -processing cell_group_name: ref-fib.ref-fib_s1, size: 221
INFO [2021-03-13 02:48:37] -writing cell clusters file: plot_out2//17_HMM_predHMMi6.hmm_mode-samples.cell_groupings
INFO [2021-03-13 02:48:38] -writing cnv regions file: plot_out2//17_HMM_predHMMi6.hmm_mode-samples.pred_cnv_regions.dat
INFO [2021-03-13 02:48:38] -writing per-gene cnv report: plot_out2//17_HMM_predHMMi6.hmm_mode-samples.pred_cnv_genes.dat
INFO [2021-03-13 02:48:38] -writing gene ordering info: plot_out2//17_HMM_predHMMi6.hmm_mode-samples.genes_used.dat
INFO [2021-03-13 02:48:39] ::plot_cnv:Start
INFO [2021-03-13 02:48:39] ::plot_cnv:Current data dimensions (r,c)=6121,11063 Total=221819793 Min=1 Max=6.
INFO [2021-03-13 02:48:39] ::plot_cnv:Depending on the size of the matrix this may take a moment.
INFO [2021-03-13 02:50:48] plot_cnv_observation:Start
INFO [2021-03-13 02:50:48] Observation data size: Cells= 10842 Genes= 6121
INFO [2021-03-13 02:50:51] plot_cnv_observation:Writing observation groupings/color.
INFO [2021-03-13 02:50:51] plot_cnv_observation:Done writing observation groupings/color.
INFO [2021-03-13 02:50:51] plot_cnv_observation:Writing observation heatmap thresholds.
INFO [2021-03-13 02:50:51] plot_cnv_observation:Done writing observation heatmap thresholds.
INFO [2021-03-13 02:51:05] Colors for breaks: #00008B,#24249B,#4848AB,#6D6DBC,#9191CC,#B6B6DD,#DADAEE,#FFFFFF,#EEDADA,#DDB6B6,#CC9191,#BC6D6D,#AB4848,#9B2424,#8B0000
INFO [2021-03-13 02:51:05] Quantiles of plotted data range: 1,2,3,4,6
INFO [2021-03-13 02:51:17] plot_cnv_observations:Writing observation data to plot_out2//infercnv.17_HMM_predHMMi6.hmm_mode-samples.observations.txt
INFO [2021-03-13 02:53:26] plot_cnv_references:Start
INFO [2021-03-13 02:53:26] Reference data size: Cells= 221 Genes= 6121
INFO [2021-03-13 02:53:28] plot_cnv_references:Number reference groups= 1
INFO [2021-03-13 02:53:28] plot_cnv_references:Plotting heatmap.
INFO [2021-03-13 02:53:28] Colors for breaks: #00008B,#24249B,#4848AB,#6D6DBC,#9191CC,#B6B6DD,#DADAEE,#FFFFFF,#EEDADA,#DDB6B6,#CC9191,#BC6D6D,#AB4848,#9B2424,#8B0000
INFO [2021-03-13 02:53:28] Quantiles of plotted data range: 3,3,3,3,3
INFO [2021-03-13 02:53:28] plot_cnv_references:Writing reference data to plot_out2//infercnv.17_HMM_predHMMi6.hmm_mode-samples.references.txt
INFO [2021-03-13 02:53:35]
STEP 18: Run Bayesian Network Model on HMM predicted CNV's
INFO [2021-03-13 02:53:35] Creating the following Directory: plot_out2//BayesNetOutput.HMMi6.hmm_mode-samples
INFO [2021-03-13 02:53:35] Initializing new MCM InferCNV Object.
INFO [2021-03-13 02:53:35] validating infercnv_obj
INFO [2021-03-13 02:53:35] Total CNV's: 84
INFO [2021-03-13 02:53:35] Loading BUGS Model.
INFO [2021-03-13 02:53:35] Running Sampling Using Parallel with 4 Cores
当前时间9:30