Trimmomatic 0.39 Permission denied accessing fastq.gz
1
0
Entering edit mode
3.3 years ago
e.wing • 0

Hello everyone,

I am still relatively new to bioinformatics and RNA-seq analysis so I apologise in advance if I haven't provided enough/relevant information. I am trying to run trimmomatic as an array job. I have done this before for STAR and it worked so have used a very similar format as it worked previously. When I run the following script...

#!/bin/bash
#
#$ -cwd
#
#$ -V
#$ -l h_vmem=8G
#$ -l h_rt=47:59:59
#
# Task range. Tasks need to go from 1 to the number of files:
#$ -t 1-417


#load modules
module load igmm/apps/trimmomatic/0.39


# SGE_TASK_ID will go from 1 to the number of files when we submit an array job
sample_name=`sed -n ${SGE_TASK_ID}p < filename_list.txt`
echo Processing sample: ${sample_name} on $HOSTNAME


trimmomatic PE \
-threads 4 \
-phred33 \
-trimlog ./trimmed/trimmomatic_log.txt \ 
./ipads_rna/${sample_name}_1.fastq.gz ./ipads_rna/${sample_name}_2.fastq.gz \
./trimmed/${sample_name}.trimmed_1.fastq.gz ./trimmed/${sample_name}.un.trimmed_1.fastq.gz \
./trimmed/${sample_name}.trimmed_2.fastq.gz ./trimmed/${sample_name}.un.trimmed_2.fastq.gz \
ILLUMINACLIP:/home/s2126362/scratch/trimmomatic-0.39/adapters/TruSeq3-PE-2.fa/:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:20 MINLEN:50

I get this output...

[scratch]$ cat trimmomatic.sh.e13708195.34
Usage:
   PE [-version] [-threads <threads>] [-phred33|-phred64] [-trimlog <trimLogFile>] [-quiet] [-validatePairs] [-
basein <inputBase> | <inputFile1> <inputFile2>] [-baseout <outputBase> | <outputFile1P> <outputFile1U> <outputFile2P> <outputFile2U>] <trimmer1>...
   or:
   SE [-version] [-threads <threads>] [-phred33|-phred64] [-trimlog <trimLogFile>] [-quiet] <inputFile> <outputFile> <trimmer1>...
or:
   -version
/var/spool/gridheduler/exed/node7d01/job_scripts/13705: line 26: ./ipads_rna/WTCHG_780324_70345010_1.fastq.gz: Permission denied

I cannot work out why I get the permission denied error message when it is run as an array job but not as a single command.

I have tried running the command on its own in the command line with a specific filename and it works perfectly and generates the 4 trimmed output files.

Any thoughts?

Thank you!

RNA-seq trimmomatic • 1.8k views
ADD COMMENT
0
Entering edit mode

./ipads_rna

Are you running the job from the directory which contains these locally referenced directories?

Can you check if the file system you are working on is available on the worker nodes where this job actually runs and that the account the job is running under has read permissions to that directory (seems less likely since your manual test is probably done on the same storage directory).

ADD REPLY
0
Entering edit mode

Thank you for your reply!

I am running it from the directory that contains the ipads_rna directory. I've tried other path combinations to get to the file and get the same error each time.

I have checked the permissions once logged in to where I submit the job script and get -rw-r--r--

ADD REPLY
0
Entering edit mode

If your sample name variable is expanding correctly, if the files are in the correct directory and if the file system is accessible on the node where the job is running then there is no logical reason as to why you are getting that error. Since you are running this via a script can you put the entire command on one line (remove \ breaks) and see if that works.

ADD REPLY
0
Entering edit mode

I managed to get this working by removing the wrapping within the script and running the job script within the directory that contained the fastq files. The command ended up looking like this...

trimmomatic PE -threads 4 -phred33 -trimlog ./trimmomatic_log.txt ./${sample_name}_1.fastq.gz ./${sample_name}_2.fastq.gz ./${sample_name}.trimmed_1.fastq.gz ./${sample_name}.un.trimmed_1.fastq.gz ./${sample_name}.trimmed_2.fastq.gz ./${sample_name}.un.trimmed_2.fastq.gz ILLUMINACLIP:TruSeq3-PE-2.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:20 MINLEN:30

Thank you for your help!

ADD REPLY
0
Entering edit mode
3.3 years ago

What this probably means is that the job runs with different permissions (as a different user) when executed as a job.

Write a simple script and verify:

gzcat filename | wc -l

run it from command line and as a job.

Ask your local tech support.

ADD COMMENT

Login before adding your answer.

Traffic: 1931 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