swaruplabuci / archrtosignac Goto Github PK
View Code? Open in Web Editor NEWAn R package performing object conversion from ArchRProject (ArchR) to Signac SeuratObject (Signac)
License: MIT License
An R package performing object conversion from ArchRProject (ArchR) to Signac SeuratObject (Signac)
License: MIT License
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
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
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!
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
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:
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
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.
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) :
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.
Could you please help resolve this issue?
Computing hash
Checking for 5432 cell barcodes
[1] "Run_04_24h"
[1] 165939 11858
Computing hash
Checking for 11858 cell barcodes
[1] "In Progress:"
[1] "Merge Seurat list"
Error in validObject(object = .Object) :
invalid class "Seurat" object: all assays must have a key
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:
Could you help me with this?
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.
seurat_atac <- addDimRed(
How may I fix this problem?
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
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
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.
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!
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.