need help with script for hisat2 alignment
1
0
Entering edit mode
2.8 years ago

Hello all,

I'm new to bioinformatics and programming in general so apologies if this comes off as naive.

I am working with the data set that comes with "Transcript-level expression analysis on RNA-seq experiments with HISAT, stringtie and Ballgown" Pertea et al. 2016. Instead of writing the same command over and over as in the paper, I am trying to write a for loop to iterate over the samples. Below is my script:

#!/bin/bash
set -e

###
SAMPLES=chrX_data/files.txt

##Store bam files in this directory
mkdir -p sam
#### number of CPUs
CPUS=8

####reference genome
IDX=chrX_data/indexes/chrX_tran

for SAMPLE in $(cat$SAMPLES)
do
R1=samples/${SAMPLE}_chrX_1.fastq R2=samples/${SAMPLE}_chrX_2.fastq
SAM=${SAMPLE}_chrX.sam hisat2 -p$CPUS --dta -x $IDX -1$R1 -2 $R2 -S$SAM
done


However, when I run this I get the following error

Warning: Could not open read file "samples/ERR188044_chrX_1.fastq" for reading; skipping...Error: No input read files were valid


Any help would be greatly appreciated

hisat2 alignment RNA-Seq • 1.5k views
0
Entering edit mode

I actually just figured it out, but can't figure out how to delete the post. Sorry!

0
Entering edit mode

A more appropriate course of action is to follow up with the answer, and with that, you can help someone else that may run into a similar problem. That's the entire purpose of the site. Imagine if every post with a solution would be deleted.

0
Entering edit mode

Got it. Thanks......

2
Entering edit mode
2.8 years ago
GenoMax 110k

Are you running this from a location which has samples directory (with actual samples) in it? That path appears to be incorrect. Should samples be chrX_data instead in the script?

0
Entering edit mode

You're correct the path was incorrectt