Git Product home page Git Product logo

archrtosignac's People

Contributors

emilymiyoshi avatar rootze avatar sky970415 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

archrtosignac's Issues

Frangments dir with version 1.0.3

Hello I am also troubling with the fragment files which are the output of cellranger 10x multiomic data

seurat_atac <- ArchR2Signac(

ArchRProject = project_Peaks_MACS2_RES0.9,
refversion = "mm10",
#samples = samplelist, # list of samples in the ArchRProject (default will use ArchRProject@cellColData$Sample but another list can be provided)
fragments_dir = inputFiles,
pm = pkm, # peak matrix from getPeakMatrix(),
fragments_file_extension = '_fragments.tsv.gz',
fragments_fromcellranger = "YES", # fragments_fromcellranger This is an Yes or No selection ("NO" | "N" | "No" or "YES" | "Y" | "Yes")
annotation = annotation # annotation from getAnnotation()
)
[1] "In Progress:"
[1] "Prepare Seurat list for each sample"
[1] "First_try_multiomic_archr"
[1] 121983 3733
Error in CreateFragmentObject(path = fragments, cells = cells, validate.fragments = validate.fragments, :
Fragment file does not exist.

For InputFiles I try many things
InputFiles <- c("/Users/alegac/Library/CloudStorage/OneDrive-INSTITUTCURIE/Projet_linda_mutiomic_novembre/KDI_2017426_2023-11-15_16-59-39/")
InputFiles <- c("/Users/alegac/Library/CloudStorage/OneDrive-INSTITUTCURIE/Projet_linda_mutiomic_novembre/KDI_2017426_2023-11-15_16-59-39")
InputFiles <- c("/Users/alegac/Library/CloudStorage/OneDrive-INSTITUTCURIE/Projet_linda_mutiomic_novembre/KDI_2017426_2023-11-15_16-59-39/atac_fragments.tsv.gz")

Thanks for help

Error when running getPeakMatrix

Hi,

I am trying convert an ArchR project to a Seurat object.
However, when I run pkm <- getPeakMatrix(test), I get the following error:

[1] "In Progress:"
[1] "Get Matrix From ArchRProject"
ArchR logging to : ArchRLogs/ArchR-getMatrixFromProject-1512966a1b01f-Date-2023-08-02_Time-13-31-04.log
If there is an issue, please report to github with logFile!
2023-08-02 13:31:21 : Organizing colData, 0.291 mins elapsed.
2023-08-02 13:31:21 : Organizing rowData, 0.293 mins elapsed.
2023-08-02 13:31:21 : Organizing rowRanges, 0.293 mins elapsed.
2023-08-02 13:31:21 : Organizing Assays (1 of 1), 0.293 mins elapsed.
2023-08-02 13:31:21 : Constructing SummarizedExperiment, 0.295 mins elapsed.
2023-08-02 13:31:23 : Finished Matrix Creation, 0.319 mins elapsed.
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘seqnames’ for signature ‘"NULL"’

Do you know what might be causing this error?

Thanks,
Nadine

Error in CreateFragmentObject

Thanks for the contribution. I run the ArchR2Signac function and get the error
Error in CreateFragmentObject(path = fragments, cells = cells, validate.fragments = validate.fragments, : Fragment file does not exist.
There is only one fragment.tsv.gz in the folder, and I provide the full path to the parameter fragments_dir. How to fix it?
Thanks!

Customized UMAP name and IterativeLSI request

Hi @rootze,
Could you please change the addDimRed() with customized UMAP names and IterativeLSI names?
Sometimes the name for those are not default. If you could use [[addUMAPs]] instead of the hard coded $, it would be great.

Thanks,
Jiakang

ArchR2Signac - Merging Seurat list

Hi,
Great packaged very helpful package! I was able to use the package successfully in November (with seurat v. 4.4.0).
But now when I try to re-run the code I get the error;

[1] "In Progress:"
[1] "Merge Seurat list"
Error in rep(yes, length.out = len): attempt to replicate an object of type 'S4'
Traceback:

  1. ArchR2Signac(ArchRProject = ArchRPro, refversion = "mm10", samples = samples,
    . fragments_dir = fragments_dir, pm = pm, fragments_fromcellranger = "Yes",
    . annotation = annotations, )
  2. ifelse(length(seurat_list) > 1, merge(x = seurat_list[[1]], y = seurat_list[2:length(seurat_list)],
    . add.cell.ids = samples), seurat_list[[1]])

When running:
seurat_atac <- ArchR2Signac(
ArchRProject = ArchRPro,
refversion = "mm10",
samples = samples,
fragments_dir = fragments_dir,
pm = pm,
fragments_fromcellranger = "Yes",
annotation = annotations,
)

Both when I use Seurat v. 5 and Seurat v.4.4.0.
ArchRtoSignac v.1.0.3

I wonder if it has something to do with the new function for merging in the ArchR2Signac function but I am not sure.

Thanks in advance.

Best regards,
Laura

Adaptation: snapTool fragment files

Due to the issues reported in #3, we suspected the error was due to the fragments' format. We are working with other researchers who have access to SnapTool output files to investigate the matter actively.

  • Finding a way to reformat snapTool fragment files
    Possible way of reformating fragment files to match cellranger atac count output: stuart-lab/signac#748
  • Update the ArchR2Signac code to accept the reformatted SnapTool fragment files
  • Update the ArchRtoSignac tutorial

Error in function (type, msg, asError = TRUE) :

Hello,

I was trying to update the package of Seurat. But it gave a error information at the "getAnnotation(reference = EnsDb.Hsapiens.v86, refversion = "hg38") " step.

annotations <- getAnnotation(reference = EnsDb.Hsapiens.v86, refversion = "hg38") # "UCSC" is the default style to change to but can be changed with argument seqStyle
[1] "In Progress:"
[1] "Extract genomic ranges from EnsDb object and prepare annotation"
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=21s
Error in function (type, msg, asError = TRUE) :

Not all cells requested could be found in the fragment file

Hi,

I am new in this field and currently using ArchRtoSignac to find a way to better process my scATACseq data after reading your paper. I encounter an issue related to fragment object creation.

Here's my code,

if(T){
  setwd("/public-supool/home/zhchen/LGX/ATAC_PROJ/downstream/human/hypothalamus/PROJ/")
  library(ArchR)
  library(Rsamtools)
  library(data.table)
  library(stringr)
  library(tidyverse)
  library(BSgenome.Hsapiens.UCSC.hg38)
  library(EnsDb.Hsapiens.v86) 
  library(ArchRtoSignac)
  packages <- c("Seurat", "Signac","stringr") # required packages
  loadinglibrary(packages)
  set.seed(12580)
  addArchRGenome("hg38")
  addArchRThreads(threads = 32)
}
annotations <- getAnnotation(reference = EnsDb.Hsapiens.v86, refversion = "hg38")

frag_file <- list(PCW6 = c("/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW6/PCW6_0719001.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW6/PCW6_0719002.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW6/PCW6_0719003.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW6/PCW6_0719004.fragments.tsv.gz"),
                  PCW7 = c("/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW7/PCW7_0719005.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW7/PCW7_0719006.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW7/PCW7_0719007.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW7/PCW7_0719008.fragments.tsv.gz"),
                  PCW9 = c("/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW9/PCW9_0719009.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW9/PCW9_0719010.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW9/PCW9_0719011.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW9/PCW9_0719012.fragments.tsv.gz"),
                  PCW10 = c("/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW10/PCW-10-1-ATAC.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW10/PCW-10-2-ATAC.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW10/PCW-10-3-ATAC.fragments.tsv.gz"),
                  PCW13 = c("/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW13/PCW-13-1-ATAC.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW13/PCW-13-2-ATAC.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW13/PCW-13-3-ATAC.fragments.tsv.gz"),
                  PCW16 = c("/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW16/5.PCW16-080405.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW16/6.PCW16-080406.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW16/7.PCW16-080407.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW16/8.PCW16-080408.fragments.tsv.gz"),
                  PCW20 = c("/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW20/PCW20_Hypothalamus_1109001.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW20/PCW20_Hypothalamus_1109002.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW20/PCW20_Hypothalamus_1109003.fragments.tsv.gz"),
                  PCW22 = c("/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW22/PCW22_0726001.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW22/PCW22_0726002.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW22/PCW22_0726003.fragments.tsv.gz","/public-supool/home/zhchen/analysis/ATAC-project/Human/PCW22/PCW22_0726004.fragments.tsv.gz"))

Time <- c("PCW6","PCW7","PCW9","PCW10","PCW13","PCW16","PCW20","PCW22")

for (i in 1 : length(Time)){
  human_atac <- loadArchRProject(path = paste0("./",Time[i],"_clean"))
  pm <- getPeakMatrix(human_atac)
  fragments_dir <- frag_file[Time[i]]
  fragments_dir <- as.list(as.character(unlist(fragments_dir)))
  samples <-  unique(human_atac@cellColData$Sample)

  seurat_atac <- ArchR2Signac(
    ArchRProject = human_atac,
    refversion = "hg38",
    samples = samples,
    fragments_dir = fragments_dir,
    pm = pm,
    fragments_fromcellranger = "NO",
    fragments_file_extension = "",## already had extension
    annotation = annotations
  )

  gsm <- getGeneScoreMatrix(ArchRProject = human_atac, SeuratObject = seurat_atac)
  seurat_atac[["RNA"]] <- CreateAssayObject(counts = gsm)
  seurat_atac <- addDimRed(
    ArchRProject = human_atac,
    SeuratObject = seurat_atac,
    addUMAPs = "UMAP",
    reducedDims = "IterativeLSI"
  )
  saveRDS(seurat_atac, paste0("./", Time[i], "_clean/seurat_atac_", Time[i], ".rds"))
}

Here is the error,

[1] "Return peak matrix"
[1] "IF selecting NO, please make sure to provide fragments_file_extension"
[1] "In Progress:"
[1] "Prepare Seurat list for each sample"
[1] "PCW6-1"
[1] 227445   4974
Computing hash
Checking for 4974 cell barcodes
Warning: Keys should be one or more alphanumeric characters followed by an underscore, setting key from peaks to peaks_
[1] "PCW6-3"
[1] 227445   4502
Computing hash
Checking for 4502 cell barcodes
Error in CreateFragmentObject(path = fragments, cells = cells, validate.fragments = validate.fragments,  : 
  Not all cells requested could be found in the fragment file.
Calls: ArchR2Signac ... lapply -> FUN -> <Anonymous> -> CreateFragmentObject

It seems I succeeded with the first sample yet I don't know why the second went wrong.

Error in h5checktypeOrOpenLoc()

Hi, thank you for creating this package.
I got Error in h5checktypeOrOpenLoc(file, readonly = TRUE, fapl = NULL, native = native): Error in h5checktypeOrOpenLoc(). Cannot open file. File '/data/proj/GCB_FBP/human_dev/exploratory/hca_dev_best3/ArrowFiles/HES1.arrow' does not exist.
Traceback:

  1. getPeakMatrix(proj)
  2. ArchR::getMatrixFromProject(ArchRProject, useMatrix = "PeakMatrix")
  3. getAvailableMatrices(ArchRProj)
  4. .availableArrays(getArrowFiles(ArchRProj = ArchRProj))
  5. .safelapply(seq_along(ArrowFiles), function(x) {
    . groups <- h5ls(ArrowFiles[x]) %>% {
    . .[.$group == "/" & .$otype == "H5I_GROUP", "name"]
    . }
    . groups <- groups[!grepl("Fragments|Metadata", groups)]
    . groups
    . }, threads = threads) %>% Reduce("intersect", .)
  6. Reduce("intersect", .)
  7. .safelapply(seq_along(ArrowFiles), function(x) {
    . groups <- h5ls(ArrowFiles[x]) %>% {
    . .[.$group == "/" & .$otype == "H5I_GROUP", "name"]
    . }
    . groups <- groups[!grepl("Fragments|Metadata", groups)]
    . groups
    . }, threads = threads)
  8. lapply(...)
  9. FUN(X[[i]], ...)
  10. h5ls(ArrowFiles[x]) %>% {
    . .[.$group == "/" & .$otype == "H5I_GROUP", "name"]
    . }
  11. h5ls(ArrowFiles[x])
  12. h5checktypeOrOpenLoc(file, readonly = TRUE, fapl = NULL, native = native)
  13. stop("Error in ", fctname, ". Cannot open file. File '", file,
    . "' does not exist.")

Could you help me with this?

fragments_dir in ArchR2Signac

Thank you for the package to convert an ArchRProject a SeuratObject!

I have a question about fragments_dir in function ArchR2Signac. Could you provide an example of fragments_dir for the ArchRProject? I tried the folder with "fragments.tsv.gz(tbi)" or fragments.arrow" but got the error:

Error in CreateFragmentObject(path = fragments, cells = cells, validate.fragments = validate.fragments, :
Fragment file does not exist.

Thank you.

Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), : 'data' must be of a vector type, was 'NULL'

@rootze @Sky970415

seurat_atac <- addDimRed(

  • ArchRProject = proj,
  • SeuratObject = seurat_atac,
  • addUMAPs = "UMAP",
  • reducedDims = "IterativeLSI"
  • ) # default is "IterativeLSI"
    [1] "In Progress:"
    [1] "add UMAP From ArchRProject to SeuratObject"

Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :

'data' must be of a vector type, was 'NULL'

How may I fix this problem?

Archr2Signac without peakMatrix

Hi,
Thank you for creating this package.
I am working on CUT&tag data and I am not using the ArchR peak calling method.
I was wondering if I can convert my ArchR project into a Seurat object without using the getPeakMatrix?

Thank you very much

Fragment file does not exist

Hello,
i'm trying to use your package, but the conversion ArchR2Signac does'nt work.
The error message is : Erreur dans CreateFragmentObject(path = fpath, cells = cells, verbose = FALSE, :
Fragment file does not exist.
The problem is that the path is correct. The files fragments.tsv.gz and fragments.tsv.gz.tbi are in the correct path. When i use this passe for Signac it works without problems but it doesn't work for ArchR2Signac. I tried to rename files in different ways but it doesn't work.
Can you help me with this issue?
Many thanks for you help.

Aziza

Issues Monitoring

I didn't realize that email notification for GitHub organizations works differently, so I miss reported issues sometimes.
After changing the setting, I believe now the issues reported here should notify me immediately.

Error with getAnnotation

Hello,

Thanks for making this code! I am trying to use it, but am running into this error for the annotations:

annotations <- getAnnotation(reference = EnsDb.Hsapiens.v86, refversion = "hg38") # UCSC style
[1] "In Progress:"
[1] "Extract genomic ranges from EnsDb object and prepare annotation"
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 06s
Error in .order_seqlevels(chrom_sizes[, "chrom"]) :
!anyNA(m32) is not TRUE

Any help solving this error would be great, thanks!

Enhancement Needed -- ArchR2Signac for one sample only

Error in merge.Seurat(x = seurat_list[[1]], y = seurat_list[2:length(seurat_list)], :
Please provide a cell identifier for each object provided to merge

As shown in the above code's error,
We need an if loop to make sure the researcher can just use the ArchR2Signac merging even if they only have one sample.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.