Trouble with alignment using STAR - unknown error
1
0
Entering edit mode
2.8 years ago
foxiw ▴ 10

Hi.

I'm having trouble aligning my reads with STAR. I've gone over my code and I can't find anything wrong with it, however when I send it to the queue it instantly fails. For some reason, the script doesn't produce an error or out file, so I don't even know what's wrong... This is my script:

#SBATCH --partition=defq       # the requested queue
#SBATCH --nodes=1              # number of nodes to use
#SBATCH --tasks-per-node=1     # for parallel distributed jobs
#SBATCH --cpus-per-task=4      # for multi-threaded jobs
#SBATCH --mem-per-cpu=4G      # in megabytes, unless unit explicitly stated
#SBATCH --error=logs/%J.err         # redirect stderr to this file
#SBATCH --output=logs/%J.out        # redirect stdout to this file


## Load star module
module load star-2.7.6a-gcc-8.3.1-r6xot7y

## Create shortcuts for STAR command

export workingdir=/mnt/scratch/c1818206/fastqs/merged_files/trimmedfiles/trimmedfiles_final
export refdir=/mnt/scratch/c1818206/fastqs/merged_files/trimmedfiles/trimmedfiles_final/genomeDir

# Run star command

for i in $(ls workingdir);
do
        STAR \
        --runMode alignReads \
        --genomeDir $refdir \
        --runThreadN ${SLURM_CPUS_PER_TASK} \
        --readFilesIn $workingdir/$i\2.fastq.gz \
        --outFileNamePrefix $workingdir/star/$i. \
        --outSAMtype BAM Unsorted \
        --outSAMunmapped Within \
        --outSAMattributes Standard \
        --quantMode GeneCounts \
        --readFilesCommand gunzip -c
done;

The only thing I can think of is that my list is wrong, or that I'm trying to align zipped files (although the readFilesCommand should sort that), or that the order of the STAR parameters is incorrect. Any help would be much appreciated. Thanks.

RNA-seq alignment STAR • 745 views
ADD COMMENT
0
Entering edit mode
2.8 years ago
Michael 54k

Tiny error:

for i in $(ls workingdir);

should be:

for i in $(ls $workingdir);
ADD COMMENT
0
Entering edit mode

Hi, Thanks. I've been fiddling with the STAR command and I have changed it to this now:

workingdir=`ls *.fastq.gz`
for i in $workingdir;
do
        STAR
        --genomeDir $refdir \
        --runMode alignReads \
        --runThreadN ${SLURM_CPUS_PER_TASK} \
        --readFilesIn $workingdir/$i \
        --outFileNamePrefix $workingdir/star/$i. \
        --outSAMtype BAM Unsorted \
        --outSAMunmapped Within \
        --outSAMattributes Standard \
        --quantMode GeneCounts \
        --readFilesCommand zcat
done

However, it still doesn't work and what's most frustrating is that it doesn't produce an error file, so I can't even check the error logs.

ADD REPLY

Login before adding your answer.

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