Commit 5194738c authored by John Chilton's avatar John Chilton
Browse files

Fix auto pairing for compressed file handling.

parent 5268cb85
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
@@ -7,6 +7,15 @@
      forward: input_R1.fastq
      reverse: input_R2.fastq

- doc: Compressed _R1 _R2 fastqs split.
  inputs:
  - input_R1.fastq.gz
  - input_R2.fastq.gz
  paired:
    input:
      forward: input_R1.fastq.gz
      reverse: input_R2.fastq.gz

- doc: Joining common prefixes on _R1 _R2.
  inputs:
  - input541_R1.fastq
@@ -30,6 +39,15 @@
      forward: input.1.fastq
      reverse: input.2.fastq

- doc: Simple .1.fastq.gz/.2.fastq.gz split.
  inputs:
  - input.1.fastq.gz
  - input.2.fastq.gz
  paired:
    input:
      forward: input.1.fastq.gz
      reverse: input.2.fastq.gz

- doc: Simple _1/_2 split.
  inputs:
  - input_1.fastq
@@ -38,3 +56,21 @@
    input:
      forward: input_1.fastq
      reverse: input_2.fastq

- doc: Simple _1/_2 split on compressed files (.gz)
  inputs:
  - input_1.fastq.gz
  - input_2.fastq.gz
  paired:
    input:
      forward: input_1.fastq.gz
      reverse: input_2.fastq.gz

- doc: Simple _1/_2 split on compressed files (.bz2)
  inputs:
  - input_1.fastq.bz2
  - input_2.fastq.bz2
  paired:
    input:
      forward: input_1.fastq.bz2
      reverse: input_2.fastq.bz2
+7 −1
Original line number Diff line number Diff line
@@ -70,7 +70,13 @@ export function _guessNameForPair(
    if (willRemoveExtensions) {
        const lastDotIndex = lcs.lastIndexOf(".");
        if (lastDotIndex > 0) {
            const extension = lcs.slice(lastDotIndex, lcs.length);
            let extension = lcs.slice(lastDotIndex, lcs.length);
            if ([".gz", ".bz", ".bzip", ".bz2"].indexOf(extension) !== -1) {
                const secondLastDotIndex = lcs.lastIndexOf(".", lastDotIndex - 1);
                if (secondLastDotIndex > 0) {
                    extension = lcs.slice(secondLastDotIndex, lcs.length);
                }
            }
            lcs = lcs.replace(extension, "");
            fwdName = fwdName.replace(extension, "");
            revName = revName.replace(extension, "");