This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Hisat2 with SLURM

Okay so here is my problem

I have multiple fastq file paired end, and I would like to perform an alignemnt with Hisat2 using job array, But there is an error that make it doesn't work It tells me that there is an error with this line "SHORTNAME1=$(basename "${R1_file[$SLURM_ARRAY_TASK_ID]}".fastq.gz )" variable without link

    #!/bin/bash
##SBATCH --time=1:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --mem=32G
#SBATCH --cpus-per-task=16   
#SBATCH -o log/slurmjob-%j
#SBATCH --job-name=hist2
#SBATCH --partition=short
#SBATCH --array=0-7 

SCRATCHDIR=/storage/scratch/"$USER"/"$SLURM_JOB_ID"
DATABANK="$HOME/index/

OUTPUT="$HOME"/rnaseq/hisat2
mkdir -p "$OUTPUT"
mkdir -p "$SCRATCHDIR"
cd "$SCRATCHDIR"

R1_file=($(find "$HOME"/rnaseq/ -type f -name "*R1_trim.fastq.gz"))
R2_file=($(find "$HOME"/rnaseq/ -type f -name "*R2_trim.fastq.gz"))


SHORTNAME1=$(basename "${R1_file[$SLURM_ARRAY_TASK_ID]}".fastq.gz ) 
SHORTNAME2=$(basename "${R2_file[$SLURM_ARRAY_TASK_ID]}".fastq.gz)
hisat2 -p $SLURM_CPUS_PER_TASK -x "$DATABANK"   -1 "$R1_file[$SLURM_ARRAY_TASK_ID]}" -2 "${R2_fiile[$SLURM_ARRAY_TASK_ID]}" -S "$SCRATCHDIR"/"$SHORTNAME1".sam "$SCRATCHDIR"/"$SHORTNAME2".sam | \
    samtools view -b -S - | samtools sort - -o  "$SCRATCHDIR"/"$SHORTNAME1".mapped.sorted.bam "$SCRATCHDIR"/"$SHORTNAME2".mapped.sorted.bam

Can somebody help ?

rna-seq alignment

Try adding echo in front of the command and see how it looks like.

When I echo the $SLURM_ARRAY_TASK_ID it's written '7' but when I echo "${R1_file[$SLURM_ARRAY_TASK_ID]}" it also say that ths variable has no link...

Thank you very much for the answer ! But as I can seen , the wrapper of hisat2 doesn't handle SRA input accessions... and thats' a problem because I work on it... I'll probably use it with an other set of data If anyone see where is a problem I'll be gratefull !

0 answers

No answers yet.

Log in to answer this question.