Answers.Body: <p>Are you sure the <code>find</code> operations return exactly one file each? The error seems to state that there were no files found for some run. Or it could also be that you have a file that matched your glob pattern that's not a dir, so the <code>find</code> operation fails.</p>
  <p>Try this:</p>
  <pre><code>salmon_index=&quot;human_salmon_index&quot;
  fastq_dir=fastq
  for dir in ${fastq_dir}/SRR*/
  do
  r1_file=$(find $dir -name &quot;*_1.fastq&quot;)
  r2_file=$(find $dir -name &quot;*_2.fastq&quot;)
  samp=$(basename $dir)
  echo &quot;Processing sample ${samp}&quot;
  echo salmon quant -i &quot;$salmon_index&quot; -l A -1 &quot;$r1_file&quot; -2 &quot;$r2_file&quot; -p 10 -o &quot;salmon_out/${samp}_quant&quot; | tee salmon_commands.cmd
  done
  </code></pre>
  <p>Verify the contents of <code>salmon_commands.cmd</code> then use <code>bash</code> or <code>parallel</code> to run the actual commands.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-17T09:53:08.170Z
Answers.Text: Hi, I tried but getting this error
  find: ‘fastq//SRR*/’: No such file or directory
  find: ‘fastq//SRR*/’: No such file or directory
  Processing sample SRR*
  salmon quant -i ref_salmon/ -l A -1  -2  -p 10 -o salmon_out/SRR*_quant
Answers.UserDisplayName: S_Malik
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-19T15:40:41.010Z
Answers.Text: Try without the quotes. I've made the required changes.
Answers.UserDisplayName: Ram RS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-15T20:29:26.773Z
Answers.LastActivityDate: 2024-02-19T15:41:09.870Z
Answers.LastEditDate: 2024-02-19T15:41:09.870Z
Answers.UserDisplayName: Ram RS
Body: <p>Hi I am using Salmon quantitation for multiple fastq paired files using following code</p>
  <pre><code>salmon_index=&quot;human_salmon_index&quot;
  fastq_dir=&quot;fastq/&quot;
  for dir in &quot;<span class="math-container">${fastq_dir}"/SRR*
  do
  r1_file=$</span>(find &quot;<span class="math-container">$dir" -name "*_1.fastq")
  r2_file=$</span>(find &quot;<span class="math-container">$dir" -name "*_2.fastq")
  samp=$</span>(basename &quot;<span class="math-container">$dir")
  echo "Processing sample $</span>{samp}&quot;
  salmon quant -i &quot;<span class="math-container">$salmon_index" -l A -1 "$</span>r1_file&quot; -2 &quot;<span class="math-container">$r2_file" -p 10 -o "salmon_out/$</span>{samp}_quant&quot;
  done
  </code></pre>
  <p>and getting this error after it iterates over all files and start initial processing steps.</p>
  <pre><code>Processing sample SRR27756943_2.fastq
  Version Info: This is the most recent version of salmon.
  ### salmon (selective-alignment-based) v1.10.0
  
  Exception : [
  The following errors were detected with the read files
  
  ======================================================
  
  ERROR: file [] does not appear to exist!
  </code></pre>
  <p>Any solution?</p>
  
Tags: <rna-seq><phylogenetics><bash><salmon><quantification>
Title: Salmon Multiple File SCRIPT giving error
ThreadText: # Salmon Multiple File SCRIPT giving error
  
  (Asked by: username_0 on 2024-02-15)
  
  Hi I am using Salmon quantitation for multiple fastq paired files using following code
  
  ```
  salmon_index="human_salmon_index"
  fastq_dir="fastq/"
  for dir in "${fastq_dir}"/SRR*
  do
  r1_file=$(find "$dir" -name "*_1.fastq")
  r2_file=$(find "$dir" -name "*_2.fastq")
  samp=$(basename "$dir")
  echo "Processing sample ${samp}"
  salmon quant -i "$salmon_index" -l A -1 "$r1_file" -2 "$r2_file" -p 10 -o "salmon_out/${samp}_quant"
  done
  
  ```
  
  and getting this error after it iterates over all files and start initial processing steps.
  
  ```
  Processing sample SRR27756943_2.fastq
  Version Info: This is the most recent version of salmon.
  ### salmon (selective-alignment-based) v1.10.0
  
  Exception : [
  The following errors were detected with the read files
  
  ======================================================
  
  ERROR: file [] does not appear to exist!
  
  ```
  
  Any solution?
  
  **Tags:** rna-seq, phylogenetics, bash, salmon, quantification
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-02-15. Score: 0
  
  Are you sure the `find` operations return exactly one file each? The error seems to state that there were no files found for some run. Or it could also be that you have a file that matched your glob pattern that's not a dir, so the `find` operation fails.
  
  Try this:
  
  ```
  salmon_index="human_salmon_index"
  fastq_dir=fastq
  for dir in ${fastq_dir}/SRR*/
  do
  r1_file=$(find $dir -name "*_1.fastq")
  r2_file=$(find $dir -name "*_2.fastq")
  samp=$(basename $dir)
  echo "Processing sample ${samp}"
  echo salmon quant -i "$salmon_index" -l A -1 "$r1_file" -2 "$r2_file" -p 10 -o "salmon_out/${samp}_quant" | tee salmon_commands.cmd
  done
  
  ```
  
  Verify the contents of `salmon_commands.cmd` then use `bash` or `parallel` to run the actual commands.
  
  > **Comments:**
  > **username_0**: Hi, I tried but getting this error find: ‘fastq//SRR*/’: No such file or directory find: ‘fastq//SRR*/’: No such file or directory Processing sample SRR* salmon quant -i ref_salmon/ -l A -1  -2  -p 10 -o salmon_out/SRR*_quant  
  > **username_1**: Try without the quotes. I've made the required changes.  
  
  ---
  
  