A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/stuart-lab/signac/issues/1062 below:

Issues with peak calling using macs2 · Issue #1062 · stuart-lab/signac · GitHub

Dear Signac team,

I am encountering issues with the macs2 function that I am unable to solve and I hope that you may be able to provide me with some insights. I saw the other peak calling issues #473, 560, 676 yet could not obtain the information needed.
The code I use is as following:

# General
library(tidyverse) 
library(knitr)
library(Cairo)
# Analysis
library(Signac)
library(Seurat)
library(EnsDb.Hsapiens.v86)
library(BSgenome.Hsapiens.NCBI.GRCh38)
library(pastecs)
# Plotting
library(cowplot)

# Prepare Annotations & Genome
# extract gene annotations from EnsDb
annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Hsapiens.v94)

# rename chromosome names to match cellranger output
#BSgenome.Hsapiens.NCBI.GRCh38.renamed <- renameSeqlevels(BSgenome.Hsapiens.NCBI.GRCh38, value = str_replace(str_replace(seqnames(BSgenome.Hsapiens.NCBI.GRCh38), pattern = "chr", replacement = ""), pattern = "M", replacement = "MT"))

# Load Data & Concatenate Samples
# read preprocessed data
samples <- c("FVRminus","FVRplus")
seurat_list <- list()

for (sample in samples){
  seurat_list[[sample]] <- readRDS(paste0("/HOME_DIREC/outs/", sample, "_raw_feature_bc_matrix_filtered_seurat_markedDoublets.rds"))
  seurat_list[[sample]] <- subset(seurat_list[[sample]], subset= final_doublets, invert=TRUE)
  seurat_list[[sample]]$orig.ident <- sample
}

seurat <- merge(seurat_list[[1]], y=c(seurat_list[[2]]), add.cell.ids = samples, project = "FVR_S5")

saveRDS(seurat, "/HOME_DIREC/scRNA-seq_iPSC_FVR_S5_adata_filtered_rmDoublets_seurat.rds")
saveRDS(seurat_list, "/HOME_DIREC/scRNA-seq_iPSC_FVR_S5_adata_filtered_rmDoublets_list_seurat.rds")


# Joint Peak Calling

DefaultAssay(seurat) <- "ATAC"
peaks <- CallPeaks(seurat, macs2.path = "/ENV/bin/macs2", outdir = "/HOME_DIREC/outs")

This yields the following Info:

INFO :
# Command line: callpeak -t  -g 2.7e+09 -f BED --nomodel --extsize 200 --shift -100 -n FVR_S5 --outdir /HOME_DIREC/outs
# ARGUMENTS LIST:
# name = FVR_S5
# format = BED
# ChIP-seq file = ['']
# control file = None
# effective genome size = 2.70e+09
# band width = 300
# model fold = [5, 50]
# qvalue cutoff = 5.00e-02
# The maximum gap between significant sites is assigned as the read length/tag size.
# The minimum length of peaks is assigned as the predicted fragment length "d".
# Larger dataset will be scaled towards smaller dataset.
# Range for calculating regional lambda is: 10000 bps
# Broad region calling is off
# Paired-End mode is off
 
INFO  @ Thu, 31 Mar 2022 19:50:44: #1 read tag files... 
INFO  @ Thu, 31 Mar 2022 19:50:44: #1 read treatment tags... 
Traceback (most recent call last):
  File "/ENV/bin/macs2", line 653, in <module>
    main()
  File "/ENV/bin/macs2", line 51, in main
    run( args )
  File "/ENV/bin/MACS2/callpeak_cmd.py", line 65, in run
    else:       (treat, control) = load_tag_files_options  (options)
  File "/ENV/bin/MACS2/callpeak_cmd.py", line 387, in load_tag_files_options
    tp = options.parser(options.tfile[0], buffer_size=options.buffer_size)
  File "MACS2/IO/Parser.pyx", line 330, in MACS2.IO.Parser.GenericParser.__init__
  File "/usr/lib/python3.8/gzip.py", line 58, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
  File "/usr/lib/python3.8/gzip.py", line 173, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: ''
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file '/HOME_DIREC/outs/FVR_S5_peaks.narrowPeak': No such file or directory

Macs2 is installed accordingly:

 file.exists("/home/minas/scAnalysis_1.8_R4.1/bin/macs2")
[1] TRUE

My session is as following (sorry for the wall of text):

sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS/LAPACK: /opt/openblas/lib/libopenblas_zenp-r0.3.18.dev.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=de_DE.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=de_DE.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=de_DE.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] cowplot_1.1.1                          pastecs_1.3.21                         BSgenome.Hsapiens.NCBI.GRCh38_1.3.1000
 [4] BSgenome_1.62.0                        rtracklayer_1.54.0                     Biostrings_2.62.0                     
 [7] XVector_0.34.0                         EnsDb.Hsapiens.v86_2.99.0              ensembldb_2.18.1                      
[10] AnnotationFilter_1.18.0                GenomicFeatures_1.46.1                 AnnotationDbi_1.56.1                  
[13] Biobase_2.54.0                         GenomicRanges_1.46.0                   GenomeInfoDb_1.30.0                   
[16] IRanges_2.28.0                         S4Vectors_0.32.0                       BiocGenerics_0.40.0                   
[19] SeuratObject_4.0.2                     Seurat_4.0.5                           Signac_1.4.0                          
[22] Cairo_1.5-12.2                         knitr_1.36                             forcats_0.5.1                         
[25] stringr_1.4.0                          dplyr_1.0.7                            purrr_0.3.4                           
[28] readr_2.0.2                            tidyr_1.1.4                            tibble_3.1.5                          
[31] ggplot2_3.3.5                          tidyverse_1.3.1                       

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                  reticulate_1.22             tidyselect_1.1.1            RSQLite_2.2.8              
  [5] htmlwidgets_1.5.4           grid_4.1.1                  docopt_0.7.1                BiocParallel_1.28.0        
  [9] Rtsne_0.15                  munsell_0.5.0               codetools_0.2-18            ica_1.0-2                  
 [13] future_1.23.0               miniUI_0.1.1.1              withr_2.4.2                 colorspace_2.0-2           
 [17] filelock_1.0.2              rstudioapi_0.13             ROCR_1.0-11                 tensor_1.5                 
 [21] listenv_0.8.0               MatrixGenerics_1.6.0        slam_0.1-48                 GenomeInfoDbData_1.2.7     
 [25] polyclip_1.10-0             bit64_4.0.5                 farver_2.1.0                parallelly_1.28.1          
 [29] vctrs_0.3.8                 generics_0.1.1              xfun_0.28                   biovizBase_1.42.0          
 [33] BiocFileCache_2.2.0         lsa_0.73.2                  ggseqlogo_0.1               R6_2.5.1                   
 [37] DelayedArray_0.20.0         bitops_1.0-7                spatstat.utils_2.2-0        cachem_1.0.6               
 [41] assertthat_0.2.1            BiocIO_1.4.0                promises_1.2.0.1            scales_1.1.1               
 [45] nnet_7.3-16                 gtable_0.3.0                globals_0.14.0              goftest_1.2-3              
 [49] rlang_0.4.12                RcppRoll_0.3.0              splines_4.1.1               lazyeval_0.2.2             
 [53] dichromat_2.0-0             checkmate_2.0.0             spatstat.geom_2.3-0         broom_0.7.10               
 [57] yaml_2.2.1                  reshape2_1.4.4              abind_1.4-5                 modelr_0.1.8               
 [61] backports_1.3.0             httpuv_1.6.3                Hmisc_4.6-0                 tools_4.1.1                
 [65] ellipsis_0.3.2              spatstat.core_2.3-1         RColorBrewer_1.1-2          ggridges_0.5.3             
 [69] Rcpp_1.0.7                  plyr_1.8.6                  base64enc_0.1-3             progress_1.2.2             
 [73] zlibbioc_1.40.0             RCurl_1.98-1.5              prettyunits_1.1.1           rpart_4.1-15               
 [77] deldir_1.0-6                pbapply_1.5-0               zoo_1.8-9                   SummarizedExperiment_1.24.0
 [81] haven_2.4.3                 ggrepel_0.9.1               cluster_2.1.2               fs_1.5.0                   
 [85] magrittr_2.0.1              data.table_1.14.2           scattermore_0.7             lmtest_0.9-38              
 [89] reprex_2.0.1                RANN_2.6.1                  SnowballC_0.7.0             ProtGenerics_1.26.0        
 [93] fitdistrplus_1.1-6          matrixStats_0.61.0          hms_1.1.1                   patchwork_1.1.1            
 [97] mime_0.12                   xtable_1.8-4                XML_3.99-0.8                jpeg_0.1-9                 
[101] sparsesvd_0.2               readxl_1.3.1                gridExtra_2.3               compiler_4.1.1             
[105] biomaRt_2.50.0              KernSmooth_2.23-20          crayon_1.4.2                htmltools_0.5.2            
[109] mgcv_1.8-38                 later_1.3.0                 tzdb_0.2.0                  Formula_1.2-4              
[113] lubridate_1.8.0             DBI_1.1.1                   tweenr_1.0.2                dbplyr_2.1.1               
[117] rappdirs_0.3.3              MASS_7.3-54                 boot_1.3-28                 Matrix_1.3-4               
[121] cli_3.1.0                   parallel_4.1.1              igraph_1.2.7                pkgconfig_2.0.3            
[125] GenomicAlignments_1.30.0    foreign_0.8-81              plotly_4.10.0               spatstat.sparse_2.0-0      
[129] xml2_1.3.2                  rvest_1.0.2                 VariantAnnotation_1.40.0    digest_0.6.28              
[133] sctransform_0.3.2           RcppAnnoy_0.0.19            spatstat.data_2.1-0         cellranger_1.1.0           
[137] leiden_0.3.9                fastmatch_1.1-3             htmlTable_2.3.0             uwot_0.1.10                
[141] restfulr_0.0.13             curl_4.3.2                  shiny_1.7.1                 Rsamtools_2.10.0           
[145] rjson_0.2.20                lifecycle_1.0.1             nlme_3.1-153                jsonlite_1.7.2             
[149] viridisLite_0.4.0           fansi_0.5.0                 pillar_1.6.4                lattice_0.20-45            
[153] KEGGREST_1.34.0             fastmap_1.1.0               httr_1.4.2                  survival_3.2-13            
[157] glue_1.4.2                  qlcMatrix_0.9.7             png_0.1-7                   bit_4.0.4                  
[161] ggforce_0.3.3               stringi_1.7.5               blob_1.2.2                  latticeExtra_0.6-29        
[165] memoise_2.0.0               irlba_2.3.3                 future.apply_1.8.1      

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4