Skip to content

Error in subsetArchRProject: Error in loadArchRProject(path = outputDirectory) : all(file.exists(zfiles)) is not TRUE #1922

@YuZhengM

Description

@YuZhengM

I noticed that when I used the subsetArchRProject function, there was a problem about file.exists. The following is the detailed related content:

Describe the bug/Browse code information

> idxSample <- BiocGenerics::which(proj$Sample == name)
> cellsSample <- proj$cellNames[idxSample]
> proj_name <- subsetArchRProject(proj, cellsSample, outputDirectory=paste0("ArchRSubset_", name))
Copying ArchRProject to new outputDirectory : /mnt/f/software/scATAC_data/handler/GSE129785/ArchRSubset_GSE129785_scATAC-PBMCs-Frozen
Copying Arrow Files...
Getting ImputeWeights
No imputeWeights found, returning NULL
Copying Other Files...
Copying Other Files (1 of 19): Embeddings
Copying Other Files (2 of 19): GroupCoverages
Copying Other Files (3 of 19): GSE129785_scATAC-Hematopoiesis-All.tsv.gz
Copying Other Files (4 of 19): GSE129785_scATAC-Hematopoiesis-All.tsv.gz.tbi
Copying Other Files (5 of 19): GSE129785_scATAC-Hematopoiesis-CD34.tsv.gz
Copying Other Files (6 of 19): GSE129785_scATAC-Hematopoiesis-CD34.tsv.gz.tbi
Copying Other Files (7 of 19): GSE129785_scATAC-PBMCs-Fresh.tsv.gz
Copying Other Files (8 of 19): GSE129785_scATAC-PBMCs-Fresh.tsv.gz.tbi
Copying Other Files (9 of 19): GSE129785_scATAC-PBMCs-Frozen.tsv.gz
Copying Other Files (10 of 19): GSE129785_scATAC-PBMCs-Frozen.tsv.gz.tbi
Copying Other Files (11 of 19): GSE129785_scATAC-PBMCs-FrozenSort.tsv.gz
Copying Other Files (12 of 19): GSE129785_scATAC-PBMCs-FrozenSort.tsv.gz.tbi
Copying Other Files (13 of 19): GSE129785_scATAC-TME-All.tsv.gz
Copying Other Files (14 of 19): GSE129785_scATAC-TME-All.tsv.gz.tbi
Copying Other Files (15 of 19): GSE129785_scATAC-TME-TCells.tsv.gz
Copying Other Files (16 of 19): GSE129785_scATAC-TME-TCells.tsv.gz.tbi
Copying Other Files (17 of 19): IterativeLSI
Copying Other Files (18 of 19): PeakCalls
Copying Other Files (19 of 19): Plots
Saving ArchRProject...
Loading ArchRProject...
Error in loadArchRProject(path = outputDirectory) :
  all(file.exists(zfiles)) is not TRUE
>

By the way, I use the devtools::install_github("GreenleafLab/ArchR", ref="dev", repos = BiocManager::repositories()) command to install the ArchR package.

I looked at the code for this function and found that there was a problem with this section of zfiles <- gsub(outputDir, outputDirNew, zdata$File). I feel that it is likely a problem with path concatenation.

  if (length(ArchRProj@projectMetadata$GroupCoverages) > 0) {
    groupC <- length(ArchRProj@projectMetadata$GroupCoverages)
    for (z in seq_len(groupC)) {
      zdata <- ArchRProj@projectMetadata$GroupCoverages[[z]]$coverageMetadata
      zfiles <- gsub(outputDir, outputDirNew, zdata$File)
      ArchRProj@projectMetadata$GroupCoverages[[z]]$coverageMetadata$File <- zfiles
      stopifnot(all(file.exists(zfiles)))
    }
  }

I tried running every piece of code for this function and found that the value in the variable zfiles is different from the value in my actual path.

> zfiles
 [1] "/mnt/f/software/scATAC_data/handler/GSE129785/ArchRSubset_GSE129785_scATAC-PBMCs-FrozenSubset_GSE129785_scATAC-PBMCs-Frozen/GroupCoverages/cell_type/Cluster0._.GSE129785_scATAC.PBMCs.Fresh.insertions.coverage.h5"
 [2] "/mnt/f/software/scATAC_data/handler/GSE129785/ArchRSubset_GSE129785_scATAC-PBMCs-FrozenSubset_GSE129785_scATAC-PBMCs-Frozen/GroupCoverages/cell_type/Cluster0._.GSE129785_scATAC.PBMCs.Frozen.insertions.coverage.h5"
 [3] "/mnt/f/software/scATAC_data/handler/GSE129785/ArchRSubset_GSE129785_scATAC-PBMCs-FrozenSubset_GSE129785_scATAC-PBMCs-Frozen/GroupCoverages/cell_type/Cluster1._.GSE129785_scATAC.Hematopoiesis.CD34.insertions.coverage.h5"
 [4] "/mnt/f/software/scATAC_data/handler/GSE129785/ArchRSubset_GSE129785_scATAC-PBMCs-FrozenSubset_GSE129785_scATAC-PBMCs-Frozen/GroupCoverages/cell_type/Cluster1._.GSE129785_scATAC.Hematopoiesis.All.insertions.coverage.h5"
 .........

The actual path of my files:

/mnt/f/software/scATAC_data/handler/GSE129785/ArchRSubset_GSE129785_scATAC-PBMCs-Frozen/GroupCoverages/cell_type/Cluster0._.GSE129785_scATAC.PBMCs.Fresh.insertions.coverage.h5
.......

I hope to get your answer, Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions