sessionInfo()
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936
attached base packages:
[1] splines parallel stats4 stats graphics grDevices utils datasets
[9] methods base
other attached packages:
[1] monocle_2.18.0 DDRTree_0.1.5 irlba_2.3.3
[4] VGAM_1.1-5 Matrix_1.2-18 patchwork_1.1.1
[7] celldex_1.0.0 SingleR_1.4.1 SummarizedExperiment_1.20.0
[10] Biobase_2.50.0 GenomicRanges_1.42.0 GenomeInfoDb_1.26.2
[13] IRanges_2.24.1 S4Vectors_0.28.1 BiocGenerics_0.36.0
[16] MatrixGenerics_1.2.0 matrixStats_0.57.0 forcats_0.5.0
[19] stringr_1.4.0 dplyr_1.0.2 purrr_0.3.4
[22] readr_1.4.0 tidyr_1.1.2 tibble_3.0.4
[25] ggplot2_3.3.3 tidyverse_1.3.0 Seurat_3.2.3
loaded via a namespace (and not attached):
[1] reticulate_1.18 tidyselect_1.1.0
[3] RSQLite_2.2.2 AnnotationDbi_1.52.0
[5] htmlwidgets_1.5.3 docopt_0.7.1
[7] grid_4.0.2 combinat_0.0-8
[9] BiocParallel_1.24.1 Rtsne_0.15
[11] munsell_0.5.0 codetools_0.2-18
[13] ica_1.0-2 future_1.21.0
[15] miniUI_0.1.1.1 withr_2.3.0
[17] fastICA_1.2-2 colorspace_2.0-0
[19] rstudioapi_0.13 ROCR_1.0-11
[21] tensor_1.5 listenv_0.8.0
[23] labeling_0.4.2 slam_0.1-48
[25] GenomeInfoDbData_1.2.4 polyclip_1.10-0
[27] bit64_4.0.5 farver_2.0.3
[29] pheatmap_1.0.12 parallelly_1.23.0
[31] vctrs_0.3.6 generics_0.1.0
[33] BiocFileCache_1.14.0 R6_2.5.0
[35] rsvd_1.0.3 bitops_1.0-6
[37] spatstat.utils_1.20-2 DelayedArray_0.16.0
[39] assertthat_0.2.1 promises_1.1.1
[41] scales_1.1.1 gtable_0.3.0
[43] beachmat_2.6.4 globals_0.14.0
[45] goftest_1.2-2 rlang_0.4.9
[47] lazyeval_0.2.2 broom_0.7.3
[49] BiocManager_1.30.10 yaml_2.2.1
[51] reshape2_1.4.4 abind_1.4-5
[53] modelr_0.1.8 backports_1.2.0
[55] httpuv_1.5.4 tools_4.0.2
[57] ellipsis_0.3.1 RColorBrewer_1.1-2
[59] sessioninfo_1.1.1 ggridges_0.5.3
[61] Rcpp_1.0.5 plyr_1.8.6
[63] sparseMatrixStats_1.2.1 zlibbioc_1.36.0
[65] RCurl_1.98-1.2 densityClust_0.3
[67] rpart_4.1-15 deldir_0.2-3
[69] viridis_0.5.1 pbapply_1.4-3
[71] cowplot_1.1.1 zoo_1.8-8
[73] haven_2.3.1 ggrepel_0.9.0
[75] cluster_2.1.0 fs_1.5.0
[77] magrittr_2.0.1 RSpectra_0.16-0
[79] data.table_1.13.6 scattermore_0.7
[81] lmtest_0.9-38 reprex_0.3.0
[83] RANN_2.6.1 fitdistrplus_1.1-3
[85] hms_0.5.3 mime_0.9
[87] xtable_1.8-4 sparsesvd_0.2
[89] readxl_1.3.1 gridExtra_2.3
[91] HSMMSingleCell_1.10.0 compiler_4.0.2
[93] KernSmooth_2.23-18 crayon_1.3.4
[95] htmltools_0.5.1.1 mgcv_1.8-33
[97] later_1.1.0.1 lubridate_1.7.9.2
[99] DBI_1.1.0 ExperimentHub_1.16.0
[101] dbplyr_2.0.0 MASS_7.3-53
[103] rappdirs_0.3.1 cli_2.2.0
[105] igraph_1.2.6 pkgconfig_2.0.3
[107] plotly_4.9.3 xml2_1.3.2
[109] XVector_0.30.0 rvest_0.3.6
[111] digest_0.6.27 sctransform_0.3.2
[113] RcppAnnoy_0.0.18 spatstat.data_1.7-0
[115] cellranger_1.1.0 leiden_0.3.6
[117] uwot_0.1.10 DelayedMatrixStats_1.12.3
[119] curl_4.3 shiny_1.5.0
[121] lifecycle_0.2.0 nlme_3.1-151
[123] jsonlite_1.7.2 BiocNeighbors_1.8.2
[125] viridisLite_0.3.0 limma_3.46.0
[127] fansi_0.4.1 pillar_1.4.7
[129] lattice_0.20-41 fastmap_1.0.1
[131] httr_1.4.2 survival_3.2-7
[133] interactiveDisplayBase_1.28.0 glue_1.4.2
[135] qlcMatrix_0.9.7 FNN_1.1.3
[137] spatstat_1.64-1 png_0.1-7
[139] BiocVersion_3.12.0 bit_4.0.4
[141] stringi_1.5.3 blob_1.2.1
[143] BiocSingular_1.6.0 AnnotationHub_2.22.0
[145] memoise_1.1.0 future.apply_1.7.0
代码1
> 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-endo' ,'ref-fib')) ## 这个取决于自己的分组信息里面的
INFO [2021-03-10 14:55:24] Parsing matrix: expFile.txt
INFO [2021-03-10 14:56:39] Parsing gene order file: geneFile.txt
INFO [2021-03-10 14:56:39] Parsing cell annotations file: groupFiles.txt
INFO [2021-03-10 14:56:39] ::order_reduce:Start.
INFO [2021-03-10 14:56:40] .order_reduce(): expr and order match.
INFO [2021-03-10 14:56:40] ::process_data:order_reduce:Reduction from positional data, new dimensions (r,c) = 23449,6903 Total=9940369717 Min=0 Max=10408713.
INFO [2021-03-10 14:56:41] num genes removed taking into account provided gene ordering list: 1102 = 4.69956074885923% removed.
INFO [2021-03-10 14:56:41] -filtering out cells < 100 or > Inf, removing 0 % of cells
INFO [2021-03-10 14:56:46] validating infercnv_obj
> # 我自己的代码,运行超级耗费时间,不建议运行
> if(F){
+ infercnv_obj1 = infercnv::run(infercnv_obj,
+ cutoff=1,
+ out_dir= 'plot_out/inferCNV_output_jimmy' ,
+ cluster_by_groups=TRUE,
+ denoise=TRUE,#默认false
+ HMM=TRUE)#默认false
+ }
代码2:
> infercnv_obj2 = infercnv::run(infercnv_obj,
+ cutoff=1,
+ out_dir= 'plot_out/inferCNV_output2' ,
+ cluster_by_groups=F, # cluster
+ hclust_method="ward.D2", plot_steps=F)
INFO [2021-03-10 14:57:35] ::process_data:Start
INFO [2021-03-10 14:57:35] Creating output path plot_out/inferCNV_output2
INFO [2021-03-10 14:57:35] Checking for saved results.
INFO [2021-03-10 14:57:35]
STEP 1: incoming data
INFO [2021-03-10 14:58:26]
STEP 02: Removing lowly expressed genes
INFO [2021-03-10 14:58:26] ::above_min_mean_expr_cutoff:Start
INFO [2021-03-10 14:58:26] Removing 7313 genes from matrix as below mean expr threshold: 1
INFO [2021-03-10 14:58:27] validating infercnv_obj
INFO [2021-03-10 14:58:27] There are 15034 genes and 6903 cells remaining in the expr matrix.
INFO [2021-03-10 14:58:34] no genes removed due to min cells/gene filter
INFO [2021-03-10 14:59:25]
STEP 03: normalization by sequencing depth
INFO [2021-03-10 14:59:25] normalizing counts matrix by depth
INFO [2021-03-10 14:59:35] Computed total sum normalization factor as median libsize: 956458.000000
INFO [2021-03-10 15:00:18]
STEP 04: log transformation of data
INFO [2021-03-10 15:00:18] transforming log2xplus1()
INFO [2021-03-10 15:01:04]
STEP 08: removing average of reference data (before smoothing)
INFO [2021-03-10 15:01:04] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-10 15:01:04] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-10 15:01:17] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-10 15:02:30]
STEP 09: apply max centered expression threshold: 3
INFO [2021-03-10 15:02:30] ::process_data:setting max centered expr, threshold set to: +/-: 3
INFO [2021-03-10 15:03:43]
STEP 10: Smoothing data per cell by chromosome
INFO [2021-03-10 15:03:43] smooth_by_chromosome: chr: chr1
INFO [2021-03-10 15:03:54] smooth_by_chromosome: chr: chr10
INFO [2021-03-10 15:04:03] smooth_by_chromosome: chr: chr11
INFO [2021-03-10 15:04:14] smooth_by_chromosome: chr: chr12
INFO [2021-03-10 15:04:24] smooth_by_chromosome: chr: chr13
INFO [2021-03-10 15:04:31] smooth_by_chromosome: chr: chr14
INFO [2021-03-10 15:04:40] smooth_by_chromosome: chr: chr15
INFO [2021-03-10 15:04:48] smooth_by_chromosome: chr: chr16
INFO [2021-03-10 15:04:57] smooth_by_chromosome: chr: chr17
INFO [2021-03-10 15:05:07] smooth_by_chromosome: chr: chr18
INFO [2021-03-10 15:05:14] smooth_by_chromosome: chr: chr19
INFO [2021-03-10 15:05:25] smooth_by_chromosome: chr: chr2
INFO [2021-03-10 15:05:35] smooth_by_chromosome: chr: chr20
INFO [2021-03-10 15:05:44] smooth_by_chromosome: chr: chr21
INFO [2021-03-10 15:05:52] smooth_by_chromosome: chr: chr22
INFO [2021-03-10 15:06:00] smooth_by_chromosome: chr: chr3
INFO [2021-03-10 15:06:11] smooth_by_chromosome: chr: chr4
INFO [2021-03-10 15:06:20] smooth_by_chromosome: chr: chr5
INFO [2021-03-10 15:06:30] smooth_by_chromosome: chr: chr6
INFO [2021-03-10 15:06:39] smooth_by_chromosome: chr: chr7
INFO [2021-03-10 15:06:49] smooth_by_chromosome: chr: chr8
INFO [2021-03-10 15:06:58] smooth_by_chromosome: chr: chr9
INFO [2021-03-10 15:08:18]
STEP 11: re-centering data across chromosome after smoothing
INFO [2021-03-10 15:08:18] ::center_smooth across chromosomes per cell
INFO [2021-03-10 15:09:50]
STEP 12: removing average of reference data (after smoothing)
INFO [2021-03-10 15:09:50] ::subtract_ref_expr_from_obs:Start inv_log=FALSE, use_bounds=TRUE
INFO [2021-03-10 15:09:50] subtracting mean(normal) per gene per cell across all data
INFO [2021-03-10 15:10:06] -subtracting expr per gene, use_bounds=TRUE
INFO [2021-03-10 15:11:22]
STEP 14: invert log2(FC) to FC
INFO [2021-03-10 15:11:22] invert_log2(), computing 2^x
INFO [2021-03-10 15:12:43]
STEP 15: Clustering samples (not defining tumor subclusters)
INFO [2021-03-10 15:12:43] define_signif_tumor_subclusters(p_val=0.1
INFO [2021-03-10 15:12:43] define_signif_tumor_subclusters(), tumor: all_observations
这一步时间好长
STEP 15: Clustering samples (not defining tumor subclusters)
INFO [2021-03-10 15:12:43] define_signif_tumor_subclusters(p_val=0.1
INFO [2021-03-10 15:12:43] define_signif_tumor_subclusters(), tumor: all_observations
INFO [2021-03-10 19:22:47] cut tree into: 1 groups
INFO [2021-03-10 19:22:47] -processing all_observations,all_observations_s1
INFO [2021-03-10 19:22:47] define_signif_tumor_subclusters(), tumor: all_references
INFO [2021-03-10 19:27:23] cut tree into: 1 groups
INFO [2021-03-10 19:27:23] -processing all_references,all_references_s1
INFO [2021-03-10 19:29:41] ::plot_cnv:Start
INFO [2021-03-10 19:29:41] ::plot_cnv:Current data dimensions (r,c)=15034,6903 Total=104935060.812655 Min=0.274614818050265 Max=3.47381304931877.
INFO [2021-03-10 19:29:42] ::plot_cnv:Depending on the size of the matrix this may take a moment.
INFO [2021-03-10 19:34:05] plot_cnv(): auto thresholding at: (0.513715 , 1.508550)
INFO [2021-03-10 19:34:09] plot_cnv_observation:Start
INFO [2021-03-10 19:34:09] Observation data size: Cells= 5903 Genes= 15034
INFO [2021-03-10 19:34:11] plot_cnv_observation:Writing observations by grouping.
INFO [2021-03-10 19:38:24] plot_cnv_observation:Writing observation groupings/color.
INFO [2021-03-10 19:38:24] plot_cnv_observation:Done writing observation groupings/color.
INFO [2021-03-10 19:38:25] plot_cnv_observation:Writing observation heatmap thresholds.
INFO [2021-03-10 19:38:25] plot_cnv_observation:Done writing observation heatmap thresholds.
INFO [2021-03-10 19:38:52] Colors for breaks: #00008B,#24249B,#4848AB,#6D6DBC,#9191CC,#B6B6DD,#DADAEE,#FFFFFF,#EEDADA,#DDB6B6,#CC9191,#BC6D6D,#AB4848,#9B2424,#8B0000
INFO [2021-03-10 19:38:52] Quantiles of plotted data range: 0.513715316376733,0.917554531504774,1,1.08606377720558,1.50855028644134
INFO [2021-03-10 19:39:12] plot_cnv_observations:Writing observation data to plot_out/inferCNV_output2/infercnv.preliminary.observations.txt
INFO [2021-03-10 19:43:31] plot_cnv_references:Start
INFO [2021-03-10 19:43:31] Reference data size: Cells= 1000 Genes= 15034
ERROR [2021-03-10 19:43:32] Unexpected error, should not happen.
Error in .plot_cnv_references(infercnv_obj = infercnv_obj, ref_data = ref_data_t, :
Error
>
耗时6小时 又失败了