r3fang / SnapATAC

Analysis Pipeline for Single Cell ATAC-seq
GNU General Public License v3.0
301 stars 125 forks source link

dex-fastq permission error #91

Closed mvinyard closed 4 years ago

mvinyard commented 5 years ago

I am attempting to run dex-fastq on some cellranger-atac mkfastq outputs. For simplicity's sake, I executed the following command in the same directory where my fastq files are stored (for a single library). I have pasted the output error message below. I am looking into whether this is an issue on my end or not, but I was hoping to get your feedback since I am more or less running it as advertised without any modifications.

$ snaptools dex-fastq --input-fastq=MM2384_S2_L001_R1_001.fastq.gz --output-fastq=MM2384_S2_L001_R1_001.dex.fastq.gz --index-fastq-list MM2384_S2_L001_R2_001.fastq.gz

Here is my output error message:

Traceback (most recent call last):
  File "/home/mvinyard/anaconda3/bin/snaptools", line 38, in <module>
    parse_args()    
  File "/home/mvinyard/anaconda3/lib/python3.7/site-packages/snaptools/parser.py", line 78, in parse_args
    index_fastq_list=args.index_fastq_list
  File "/home/mvinyard/anaconda3/lib/python3.7/site-packages/snaptools/dex_fastq.py", line 89, in dex_fastq
    fout = gzip.open(output_fastq, 'wb')
  File "/home/mvinyard/anaconda3/lib/python3.7/gzip.py", line 53, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
  File "/home/mvinyard/anaconda3/lib/python3.7/gzip.py", line 163, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
PermissionError: [Errno 13] Permission denied: 'MM2384_S2_L001_R1_001.dex.fastq.gz'
r3fang commented 5 years ago

Hi Micheal,

It’s python version issue. Snaptools does not work on python 3.7. If you can use 2.7, the problem should be gone.

Also, for 10X data, we recommend to run cell ranger for preprocessing and use the tsv file to generate the snap file. This is because cell ranger will correct the barcode error based on a white list which snaptools does not.

Let me know if you need more help! Sent from my iPhone

On Sep 10, 2019, at 8:00 AM, Michael Vinyard notifications@github.com wrote:

I am attempting to run dex-fastq on some cellranger-atac mkfastq outputs. For simplicity's sake, I executed the following command in the same directory where my fastq files are stored (for a single library). I have pasted the output error message below. I am looking into whether this is an issue on my end or not, but I was hoping to get your feedback since I am more or less running it as advertised without any modifications.

$ snaptools dex-fastq --input-fastq=MM2384_S2_L001_R1_001.fastq.gz --output-fastq=MM2384_S2_L001_R1_001.dex.fastq.gz --index-fastq-list MM2384_S2_L001_R2_001.fastq.gz Here is my output error message:

Traceback (most recent call last): File "/home/mvinyard/anaconda3/bin/snaptools", line 38, in parse_args()
File "/home/mvinyard/anaconda3/lib/python3.7/site-packages/snaptools/parser.py", line 78, in parse_args index_fastq_list=args.index_fastq_list File "/home/mvinyard/anaconda3/lib/python3.7/site-packages/snaptools/dex_fastq.py", line 89, in dex_fastq fout = gzip.open(output_fastq, 'wb') File "/home/mvinyard/anaconda3/lib/python3.7/gzip.py", line 53, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/home/mvinyard/anaconda3/lib/python3.7/gzip.py", line 163, in init fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') PermissionError: [Errno 13] Permission denied: 'MM2384_S2_L001_R1_001.dex.fastq.gz' — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

mvinyard commented 5 years ago

Thank you!

mvinyard commented 5 years ago

Hi again, so I created a new env, installing python 2.7 and reinstalled snaptools along with its dependencies. I ran the exact same command as above and received the following, similar error message.

Traceback (most recent call last):
  File "/home/mvinyard/anaconda3/envs/SnapATAC/bin/snaptools", line 38, in <module>
    parse_args()    
  File "/home/mvinyard/anaconda3/envs/SnapATAC/lib/python2.7/site-packages/snaptools/parser.py", line 78, in parse_args
    index_fastq_list=args.index_fastq_list
  File "/home/mvinyard/anaconda3/envs/SnapATAC/lib/python2.7/site-packages/snaptools/dex_fastq.py", line 89, in dex_fastq
    fout = gzip.open(output_fastq, 'wb')
  File "/home/mvinyard/anaconda3/envs/SnapATAC/lib/python2.7/gzip.py", line 34, in open
    return GzipFile(filename, mode, compresslevel)
  File "/home/mvinyard/anaconda3/envs/SnapATAC/lib/python2.7/gzip.py", line 94, in __init__
    fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
IOError: [Errno 13] Permission denied: 'MM2384_S2_L001_R1_001.dex.fastq.gz'

If you have any further insights, I would greatly appreciate it! Best, Michael

r3fang commented 5 years ago

Hi Micheal,

It seems the error was caused by writing permission issue. It is likely because you do not have the permission to create the resulting file in the current folder. To test it, can you try to create a file by “touch tmp.txt” in the current fold and see if you get any error?

-- Rongxin Fang Ph.D. Student, Ren Lab Ludwig Institute for Cancer Research University of California, San Diego

On Sep 10, 2019, at 10:34 AM, Michael Vinyard notifications@github.com wrote:

Hi again, so I created a new env, installing python 2.7 and reinstalled snaptools along with its dependencies. I ran the exact same command as above and received the following, similar error message.

Traceback (most recent call last): File "/home/mvinyard/anaconda3/envs/SnapATAC/bin/snaptools", line 38, in parse_args()
File "/home/mvinyard/anaconda3/envs/SnapATAC/lib/python2.7/site-packages/snaptools/parser.py", line 78, in parse_args index_fastq_list=args.index_fastq_list File "/home/mvinyard/anaconda3/envs/SnapATAC/lib/python2.7/site-packages/snaptools/dex_fastq.py", line 89, in dex_fastq fout = gzip.open(output_fastq, 'wb') File "/home/mvinyard/anaconda3/envs/SnapATAC/lib/python2.7/gzip.py", line 34, in open return GzipFile(filename, mode, compresslevel) File "/home/mvinyard/anaconda3/envs/SnapATAC/lib/python2.7/gzip.py", line 94, in init fileobj = self.myfileobj = builtin.open(filename, mode or 'rb') IOError: [Errno 13] Permission denied: 'MM2384_S2_L001_R1_001.dex.fastq.gz' If you have any further insights, I would greatly appreciate it! Best, Michael

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r3fang/SnapATAC/issues/91?email_source=notifications&email_token=ABT6GG2J5BKJZ4THWHMR6FLQI7LCPA5CNFSM4IVI4GK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6L45EA#issuecomment-530042512, or mute the thread https://github.com/notifications/unsubscribe-auth/ABT6GGZE4ZQL2I2VV57EYFDQI7LCPANCNFSM4IVI4GKQ.

mvinyard commented 4 years ago

Thanks @r3fang I figured this out