Answers.Body: <p>The issue here is that the current working directory inside the container is <code>/</code>. You can see this with:</p>
  <pre><code>docker run --rm quay.io/biocontainers/guessmylt:0.2.5--py_0 python \
      -c 'import os; print(os.getcwd())'
  </code></pre>
  <p>When <a href="https://github.com/NBISweden/GUESSmyLT" rel="nofollow noreferrer">GUESSmyLT</a> tries to get the absolute path of it's arguments (<code>--reads</code>, <code>--reference</code>, <code>--output</code>, etc), it actually appends a trailing slash to the current working directory<sup><a href="https://github.com/NBISweden/GUESSmyLT/blob/v1.0/GUESSmyLT/GUESSmyLT.py#L21" rel="nofollow noreferrer">1</a></sup>, hence the double slash in the returned file names.</p>
  <p>To pass the files into the container and ensure that the results are available when it exits, you'll need a <a href="https://docs.docker.com/engine/reference/run/#volume-shared-filesystems" rel="nofollow noreferrer">volume</a> mount anyway. For example:</p>
  <pre><code>docker run --rm -v &quot;${PWD}:/working&quot; quay.io/biocontainers/guessmylt:0.2.5--py_0 GUESSmyLT \
      --reads &quot;/working/${base}_1.fastq&quot; &quot;/working/${base}_2.fastq&quot; \
      --reference &quot;/working/reference.fa&quot; \
      --annotation &quot;/working/annotation.gtf&quot; \
      --output &quot;/working&quot;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-12T15:17:11.090Z
Answers.Text: Ah of course, thanks. The citation to the GitHub Python code is cool.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-13T06:29:35.533Z
Answers.Text: Thank you @Steve for taking the time to give such a thorough reply. It works now!
Answers.UserDisplayName: pubsurfted
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-12T05:45:04.677Z
Answers.LastActivityDate: 2022-12-12T05:57:59.443Z
Answers.LastEditDate: 2022-12-12T05:57:59.443Z
Answers.UserDisplayName: Steve
Body: <p>I'm using the following script to detect strandedness of my paired end RNA-seq data.</p>
  <pre><code>#!/usr/bin/env bash
  
  cd ~/Desktop/fastq
  
  for infile in *_1.fastq
  do
     base=<span class="math-container">$(basename $</span>{infile} _1.fastq)
  
      docker run quay.io/biocontainers/guessmylt:0.2.5--py_0 GUESSmyLT \
      --reads <span class="math-container">${infile} $</span>{base}_2.fastq
  
  done
  </code></pre>
  <p>But when I run it, it keeps giving the error:</p>
  <pre><code>Building DAG of jobs... File path //SRR3475890_1.fastq contains double
  '/'. This is likely unintended. It can also lead to inconsistent
  results of the file-matching approach used by Snakemake. File path
  //SRR3475890_2.fastq contains double '/'. This is likely unintended.
  It can also lead to inconsistent results of the file-matching approach
  used by Snakemake. MissingInputException in line 46 of
  /usr/local/lib/python3.6/site-packages/GUESSmyLT/subsample: Missing
  input files for rule subsample_fastq: //SRR3475890_2.fastq
  //SRR3475890_1.fastq
  </code></pre>
  <p>Why is it appending double '/' to the fastq file's path? Nowhere in my script did I mention any path.</p>
  <p><em>I apologize for the very vague title, English is not my first language, so I did not know how else to phrase it.</em></p>
  
Tags: <rna-seq><bash>
Title: How to remove double '/' from file path, bash script
ThreadText: # How to remove double '/' from file path, bash script
  
  (Asked by: username_0 on 2022-12-11)
  
  I'm using the following script to detect strandedness of my paired end RNA-seq data.
  
  ```
  #!/usr/bin/env bash
  
  cd ~/Desktop/fastq
  
  for infile in *_1.fastq
  do
     base=$(basename ${infile} _1.fastq)
  
      docker run quay.io/biocontainers/guessmylt:0.2.5--py_0 GUESSmyLT \
      --reads ${infile} ${base}_2.fastq
  
  done
  
  ```
  
  But when I run it, it keeps giving the error:
  
  ```
  Building DAG of jobs... File path //SRR3475890_1.fastq contains double
  '/'. This is likely unintended. It can also lead to inconsistent
  results of the file-matching approach used by Snakemake. File path
  //SRR3475890_2.fastq contains double '/'. This is likely unintended.
  It can also lead to inconsistent results of the file-matching approach
  used by Snakemake. MissingInputException in line 46 of
  /usr/local/lib/python3.6/site-packages/GUESSmyLT/subsample: Missing
  input files for rule subsample_fastq: //SRR3475890_2.fastq
  //SRR3475890_1.fastq
  
  ```
  
  Why is it appending double '/' to the fastq file's path? Nowhere in my script did I mention any path.
  
  *I apologize for the very vague title, English is not my first language, so I did not know how else to phrase it.*
  
  **Tags:** rna-seq, bash
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-12-12. Score: 4 | Accepted answer
  
  The issue here is that the current working directory inside the container is `/`. You can see this with:
  
  ```
  docker run --rm quay.io/biocontainers/guessmylt:0.2.5--py_0 python \
      -c 'import os; print(os.getcwd())'
  
  ```
  
  When [GUESSmyLT](https://github.com/NBISweden/GUESSmyLT) tries to get the absolute path of it's arguments (`--reads`, `--reference`, `--output`, etc), it actually appends a trailing slash to the current working directory[1](https://github.com/NBISweden/GUESSmyLT/blob/v1.0/GUESSmyLT/GUESSmyLT.py#L21), hence the double slash in the returned file names.
  
  To pass the files into the container and ensure that the results are available when it exits, you'll need a [volume](https://docs.docker.com/engine/reference/run/#volume-shared-filesystems) mount anyway. For example:
  
  ```
  docker run --rm -v "${PWD}:/working" quay.io/biocontainers/guessmylt:0.2.5--py_0 GUESSmyLT \
      --reads "/working/${base}_1.fastq" "/working/${base}_2.fastq" \
      --reference "/working/reference.fa" \
      --annotation "/working/annotation.gtf" \
      --output "/working"
  
  ```
  
  > **Comments:**
  > **username_2**: Ah of course, thanks. The citation to the GitHub Python code is cool.  
  > **username_0**: Thank you @username_1 for taking the time to give such a thorough reply. It works now!  
  
  ---
  
  