Access Denied when using FilterAndTrim of DADA2 package
0
0
Entering edit mode
9 days ago
ymj • 0

Hi !

I am trying to use the DADA2 package on fastQ files (human microbiome samples), but when trying to run this code: (this is for time point 1 , "T1")

fqT1 <- sort(list.files(path, pattern="T1.fastq", full.names=TRUE))
sample.names <- sapply(strsplit(basename(fqT1),".T"), "[", 1)
filt_T1 <- file.path(path, "filtered", paste0(sample.names, ".T1.filt.fastq.gz"))
out_T1 <- filterAndTrim(fqT1, filt_T1, truncLen = 280, maxN=0, maxEE = 2, rm.phix=TRUE, 
                        compress=TRUE, multithread=FALSE)
out_T1

I get: Error in normalizePath(path.expand(path), winslash, mustWork) : path[1]="./reads/IAM01.T1.fastq": Access is denied

Does this mean I don't have full permission to these fastQ files or does it have to do with something else?

Thanks in advance!

dada2 filterAndTrim accessdenied • 324 views
ADD COMMENT
0
Entering edit mode

Hi,

If you're familiar with the shell and you're working in a cluster/server, you can do ls -lth ./reads/IAM01.T1.fastq (in the same working directory that you're now) to list the file and its permissions. If you're working in your local machine/desktop environment, you still can do ls if you're working with UNIX OS, otherwise just check the properties of this fastq file which will tell you your permissions.

A common problem with paths is misspelling or wrong paths that do not exist which might result in exceptions like that. Are you sure that you are giving the right path?

In the code above you've many lines of code. In which one you got the error?

António

ADD REPLY
0
Entering edit mode

Thanks for your answer. I have following permissions on these fastq files: "Modify", "Read", "Read & Execute", "Write" but not: "Full control".
in the line "out_T1 <- filterAndTrim ... " I get the error message.

ADD REPLY
0
Entering edit mode

Which operating system are you using, R version and dada2 version?

ADD REPLY
0
Entering edit mode

R version 4.1.2 (2021-11-01) Windows 10 x64 dada2 packageversion : 1.22.0

ADD REPLY
0
Entering edit mode

I was looking into the source code and the path should exist because the filterAndTrim() function starts by checking if a file exists or not and it should stop if there is a file that does not exist (see: https://github.com/benjjneb/dada2/blob/dc07b0407b062ede3d145d955a550d5364e7ebd1/R/filter.R#L411).

It seems that the exception error occurs at fwd <- normalizePath(fwd, mustWork=TRUE): https://github.com/benjjneb/dada2/blob/dc07b0407b062ede3d145d955a550d5364e7ebd1/R/filter.R#L421

Check the permissions of these fastq files and let us know if that is the problem of not.

ADD REPLY
0
Entering edit mode

I have following permissions on all of these Fastq files: "Modify", "Read", "Read & Execute", "Write" but not: "Full control". I will see how I can ask for permission on this full control as well.

ADD REPLY
0
Entering edit mode

Are the files that you are trying to reach in an external hard or network disk?

If so, can you try to copy at least a few of them for your local disk and work with these instead and see if that works?

This seems to be a problem related with paths in Windows (please see the following link) and its not related with dada2 software per se.

ADD REPLY

Login before adding your answer.

Traffic: 3003 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6