swaruplabUCI/ArchRtoSignac

Frangments dir with version 1.0.3

Opened this issue · 11 comments

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

rootze commented

Hello @A-legac45, Thanks for using ArchRtoSignac package

Before everything, do you only have one sample? If so, please update your ArchRtoSignac package; I recently encountered some requests with working on only one sample, so made a minor update in the ArchRtoSignac package, hope it works. BE CAUTIOUS when you update the ArchRtoSignac package, please don't update anything else; recent updates of the Seurat and SeuratObject packages may change something for other packages supporting Seurat V4.

Maybe try this from ****STEP 3 Option2:

fragments_dirs <- c(
"/Users/alegac/Library/CloudStorage/OneDrive-INSTITUTCURIE/Projet_linda_mutiomic_novembre/KDI_2017426_2023-11-15_16-59-39/atac_"
)

# Call the ArchR2Signac function with the provided arguments
seurat_atac <- ArchR2Signac(
  ArchRProject = project_Peaks_MACS2_RES0.9,
  refversion = "mm10",
  fragments_dir = fragments_dirs,
  pm = pkm,
  fragments_fromcellranger = "NO",
  fragments_file_extension = 'fragments.tsv.gz', # instead of using fragments_file_extension (.tsv.gz or .fragments.tsv.gz), here just use the whole name fragments.tsv.gz
  annotation = annotations
)

I see the fragments_fromcellranger parameter is a bit confusing when choosing NO,
fragments_fromcellranger = 'NO' is for fragments from NON Cellranger ATAC output or even from Cellranger ATAC output but don't match the standard output PATH from Cellranger ATAC cellranger-atac count

Please let me know if it works or not, more than happy to help you more.

Hello I have only one sample. Multiomic 10x dataset

I try this but still not working :

fragments_dirs <- c(

  • "/Users/alegac/Documents/archr_linda_multiom_dec_2023/"
  • )

or

fragments_dirs <- c(
"/Users/alegac/Documents/archr_linda_multiom_dec_2023/atac_"
)

seurat_atac <- ArchR2Signac(

  • ArchRProject = project_Peaks_MACS2_RES0.5,
  • refversion = "mm10",
  • fragments_dir = fragments_dirs,
  • pm = pkm,
  • fragments_fromcellranger = "YES",
  • fragments_file_extension = 'atac_fragments.tsv.gz', # instead of using fragments_file_extension (.tsv.gz or .fragments.tsv.gz), here just use the whole name fragments.tsv.gz
  • annotation = annotation
  • )
    [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.
rootze commented

Hello @A-legac45,

I cannot see your attached screenshots. I don't think GitHub supports that with email replies.
However, please double-check what I provided for you in my last reply. I made changes not only to fragments_dirs but also fragments_fromcellranger and fragments_file_extension

# Once again here is the code that I changed for you earlier 
fragments_dirs <- c(
"/Users/alegac/Library/CloudStorage/OneDrive-INSTITUTCURIE/Projet_linda_mutiomic_novembre/KDI_2017426_2023-11-15_16-59-39/atac_"
)

# Call the ArchR2Signac function with the provided arguments
seurat_atac <- ArchR2Signac(
  ArchRProject = project_Peaks_MACS2_RES0.9,
  refversion = "mm10",
  fragments_dir = fragments_dirs,
  pm = pkm,
  fragments_fromcellranger = "NO",
  fragments_file_extension = 'fragments.tsv.gz', # instead of using fragments_file_extension (.tsv.gz or .fragments.tsv.gz), here just use the whole name fragments.tsv.gz
  annotation = annotations
)

BUT What you had is

seurat_atac <- ArchR2Signac(
      ArchRProject = project_Peaks_MACS2_RES0.5,
       refversion = "mm10",
       fragments_dir = fragments_dirs,
       pm = pkm,
  *   fragments_fromcellranger = "YES",
  *   fragments_file_extension = 'atac_fragments.tsv.gz', # instead of using fragments_file_extension (.tsv.gz or .fragments.tsv.gz), here just use the whole name fragments.tsv.gz
       annotation = annotation
      )
rootze commented

fragments_dirs <- c(

  • "/Users/alegac/Documents/archr_linda_multiom_dec_2023/atac_" + )

@A-legac45 It seems to me that your fragment PATH has changed. Can you show me what your PATH to the files and what files are inside that folder?

rootze commented

The achr projet is filtered may be this is were the problem come from?

Hello @A-legac45,

It could be. I am not sure. I have very limited experience with true multi-omic datasets. Are you using a public dataset?

Hi @A-legac45 and @rootze,

If this is still an issue I think I was able to get it to work by going in to the ArchR2Signac function and changing a few things to match the cell ranger ARC output.

Line 12:
output_dir = "/croo_output/"

Lines 15/16 :

cur_fragments <- ifelse(is.list(fragments_dir), paste0(fragments_dir[[which(samples == 
                                                                                    cur_sample)]], output_dir, "atac_fragments.tsv.gz"),