Question: need help with script for hisat2 alignment
0
gravatar for Antonio.Aubry
5 months ago by
Antonio.Aubry10 wrote:

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 rna-seq alignment • 321 views
ADD COMMENTlink modified 5 months ago • written 5 months ago by Antonio.Aubry10

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

ADD REPLYlink written 5 months ago by Antonio.Aubry10

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.

ADD REPLYlink written 5 months ago by Istvan Albert ♦♦ 81k

Got it. Thanks......

ADD REPLYlink written 5 months ago by Antonio.Aubry10
2
gravatar for genomax
5 months ago by
genomax70k
United States
genomax70k wrote:

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?

ADD COMMENTlink modified 5 months ago • written 5 months ago by genomax70k

You're correct the path was incorrectt

ADD REPLYlink written 5 months ago by Antonio.Aubry10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 540 users visited in the last hour