0
$\begingroup$

I have a problem with my nextflow pipeline.

My workflow looks like this:

  1. Uncompress the hisat2 genotpye index grch38_genome.tar.gz from https://genome-idx.s3.amazonaws.com/hisat/grch38_genome.tar.gz

  2. Align .fastq.gz files from /https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=SRR1806626 and https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=SRR1806627

However, in process HISAT2 I get command exit status 255:

Command error: "grch38" does not exist

The command executed is:

hisat2 --very-sensitive --no-spliced-alignment -x grch38 -U SRR1806626.fastq.gz > SRR1806626.fastq.sam

Can someone please explain to me what I'm doing wrong?

My script.nf file for reproducing the error looks like this:

#!/usr/bin/env nextflow

nextflow.enable.dsl=2

params.reads = "$baseDir/data/*{1,2}*.fastq.gz" //https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=SRR1806626, https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=SRR1806627
params.hisat2_index = "$baseDir/data/*_genome.tar.gz" // https://genome-idx.s3.amazonaws.com/hisat/grch38_genome.tar.gz

log.info """\
         reads:        ${params.reads}
         hisat2_index: ${params.hisat2_index}
         """
         .stripIndent()

process UNCOMPRESS_GENOTYPE_INDEX {

  tag "$hisat2_index_ch.baseName"

  input:
  path(hisat2_index_ch)

  output:
  path('*')

  script:
  """
  tar xvzf $hisat2_index_ch
  """

}

process HISAT2 {

  tag "$reads.baseName"

  input:
  path(hisat2_indices)
  path(reads)

  output:
  path('*.sam')

  script:
  """
  hisat2 --very-sensitive \
         --no-spliced-alignment \
         -x $hisat2_indices \
         -U $reads \
         > ${reads.baseName}.sam
  """

}

workflow {

  Channel
    .fromPath( params.reads )
    .ifEmpty { exit 1, "reads was empty - no input files supplied" }
    .set { reads_ch }

  Channel.fromPath( params.hisat2_index )
    .ifEmpty { exit 1, "hisat2_index was empty - no input file supplied" }
    .set { hisat2_index_ch }

  UNCOMPRESS_GENOTYPE_INDEX(hisat2_index_ch)

  HISAT2(UNCOMPRESS_GENOTYPE_INDEX.out, reads_ch)

  //Command error:
  //(ERR): "grch38" does not exist
  //Exiting now ...

}

Kind regards, Thomas

$\endgroup$
1
  • 1
    $\begingroup$ Hi @ATpoint, thank you for your answer. You are correct. I changed -x $hisat2_indices to -x "${hisat2_indices}/genome" and then it worked. $\endgroup$ Dec 30 '21 at 11:38
0
$\begingroup$

The problem is probably that the tar process creates a folder with the genome files but the input for -x is not the folder with the index files but the basename of the index files itself.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.