Repository: common-workflow-language/cwltool

Issue:
Have `--print-input-deps` include secondaryFiles
When running `cwltool --print-input-deps` on a process for which the inputs define `SecondaryFileSchema`, I expect the dependencies to include any `secondaryFiles` that match the patterns.

For example, running `cwltool --print-input-deps` on the conformance test https://github.com/common-workflow-language/cwl-v1.2/blob/main/tests/docker-array-secondaryfiles.cwl with https://github.com/common-workflow-language/cwl-v1.2/blob/main/tests/docker-array-secondaryfiles-job.json produces:

```json
{
    "class": "File",
    "location": "docker-array-secondaryfiles-job.json",
    "format": "https://www.iana.org/assignments/media-types/application/cwl",
    "secondaryFiles": [
        {
            "class": "File",
            "location": "ref.fasta",
            "basename": "ref.fasta",
            "nameroot": "ref",
            "nameext": ".fasta"
        },
        {
            "class": "File",
            "location": "ref2.fasta",
            "basename": "ref2.fasta",
            "nameroot": "ref2",
            "nameext": ".fasta"
        }
    ]
}
```

but should produce:

```json
{
    "class": "File",
    "location": "docker-array-secondaryfiles-job.json",
    "format": "https://www.iana.org/assignments/media-types/application/cwl",
    "secondaryFiles": [
        {
            "class": "File",
            "location": "ref.fasta",
            "basename": "ref.fasta",
            "nameroot": "ref",
            "nameext": ".fasta",
            "secondaryFiles: [
              {
                "class": "File",
                "location": "ref.fasta.fai",
                ...
              }
            ]
        },
        {
            "class": "File",
            "location": "ref2.fasta",
            "basename": "ref2.fasta",
            "nameroot": "ref2",
            "nameext": ".fasta",
            "secondaryFiles: [
              {
                "class": "File",
                "location": "ref2.fasta.fai",
                ...
              }
            ]
        }
    ]
}
```


Discussion:

Resolving patch:
diff --git a/cwltool/command_line_tool.py b/cwltool/command_line_tool.py
--- a/cwltool/command_line_tool.py
+++ b/cwltool/command_line_tool.py
@@ -527,13 +527,11 @@ def _initialworkdir(self, j: JobBase, builder: Builder) -> None:
                                         "not a File nor a Directory object."
                                     )
                     elif not (
-                        (
-                            isinstance(entry, MutableMapping)
-                            and (
-                                "class" in entry
-                                and (entry["class"] == "File" or "Directory")
-                                or "entry" in entry
-                            )
+                        isinstance(entry, MutableMapping)
+                        and (
+                            "class" in entry
+                            and (entry["class"] == "File" or "Directory")
+                            or "entry" in entry
                         )
                     ):
                         fail = entry
diff --git a/cwltool/main.py b/cwltool/main.py
--- a/cwltool/main.py
+++ b/cwltool/main.py
@@ -398,6 +398,7 @@ def init_job_order(
     input_basedir: str = "",
     secret_store: Optional[SecretStore] = None,
     input_required: bool = True,
+    runtime_context: Optional[RuntimeContext] = None,
 ) -> CWLObjectType:
     secrets_req, _ = process.get_requirement("http://commonwl.org/cwltool#Secrets")
     if job_order_object is None:
@@ -472,23 +473,6 @@ def init_job_order(
         else:
             job_order_object = {}
 
-    if print_input_deps:
-        basedir = None  # type: Optional[str]
-        uri = cast(str, job_order_object["id"])
-        if uri == args.workflow:
-            basedir = os.path.dirname(uri)
-            uri = ""
-        printdeps(
-            job_order_object,
-            loader,
-            stdout,
-            relative_deps,
-            uri,
-            basedir=basedir,
-            nestdirs=False,
-        )
-        exit(0)
-
     def path_to_loc(p: CWLObjectType) -> None:
         if "location" not in p and "path" in p:
             p["location"] = p["path"]
@@ -513,6 +497,31 @@ def expand_formats(p: CWLObjectType) -> None:
     adjustDirObjs(job_order_object, trim_listing)
     normalizeFilesDirs(job_order_object)
 
+    if print_input_deps:
+        if not runtime_context:
+            raise RuntimeError("runtime_context is required for print_input_deps.")
+        runtime_context.toplevel = True
+        builder = process._init_job(job_order_object, runtime_context)
+        builder.loadListing = "no_listing"
+        builder.bind_input(
+            process.inputs_record_schema, job_order_object, discover_secondaryFiles=True
+        )
+        basedir: Optional[str] = None
+        uri = cast(str, job_order_object["id"])
+        if uri == args.workflow:
+            basedir = os.path.dirname(uri)
+            uri = ""
+        printdeps(
+            job_order_object,
+            loader,
+            stdout,
+            relative_deps,
+            uri,
+            basedir=basedir,
+            nestdirs=False,
+        )
+        exit(0)
+
     if secret_store and secrets_req:
         secret_store.store(
             [shortname(sc) for sc in cast(List[str], secrets_req["secrets"])],
@@ -1266,6 +1275,7 @@ def main(
                     input_basedir=input_basedir,
                     secret_store=runtimeContext.secret_store,
                     input_required=input_required,
+                    runtime_context=runtimeContext,
                 )
             except SystemExit as err:
                 return err.code
diff --git a/cwltool/process.py b/cwltool/process.py
--- a/cwltool/process.py
+++ b/cwltool/process.py
@@ -1159,7 +1159,7 @@ def scandeps(
     urljoin: Callable[[str, str], str] = urllib.parse.urljoin,
     nestdirs: bool = True,
 ) -> MutableSequence[CWLObjectType]:
-    r = []  # type: MutableSequence[CWLObjectType]
+    r: MutableSequence[CWLObjectType] = []
     if isinstance(doc, MutableMapping):
         if "id" in doc:
             if cast(str, doc["id"]).startswith("file://"):


Test patch:
diff --git a/tests/input_deps/docker-array-secondaryfiles-job.json b/tests/input_deps/docker-array-secondaryfiles-job.json
new file mode 100644
--- /dev/null
+++ b/tests/input_deps/docker-array-secondaryfiles-job.json
@@ -0,0 +1,12 @@
+{
+    "fasta_path": [
+        {
+            "class": "File",
+            "location": "ref.fasta"
+        },
+        {
+            "class": "File",
+            "location": "ref2.fasta"
+        }
+    ]
+}
diff --git a/tests/input_deps/docker-array-secondaryfiles.cwl b/tests/input_deps/docker-array-secondaryfiles.cwl
new file mode 100644
--- /dev/null
+++ b/tests/input_deps/docker-array-secondaryfiles.cwl
@@ -0,0 +1,50 @@
+#!/usr/bin/env cwl-runner
+
+cwlVersion: v1.2
+
+requirements:
+  - class: DockerRequirement
+    dockerPull: docker.io/debian:stable-slim
+  - class: InlineJavascriptRequirement
+  - class: ShellCommandRequirement
+
+class: CommandLineTool
+
+inputs:
+  fasta_path:
+    type:
+      type: array
+      items: File
+    secondaryFiles:
+      - pattern: .fai
+        required: true
+      - pattern: .crai
+        required: false
+      - .bai?
+      - "${ if (inputs.require_dat) {return '.dat'} else {return null} }"
+      - "${ return null; }"
+      - pattern: .dat2
+        required: $(inputs.require_dat)
+  require_dat: boolean?
+
+outputs:
+  bai_list:
+    type: File
+    outputBinding:
+      glob: "fai.list"
+    secondaryFiles:
+      - .bai?
+      - pattern: "${ return null }"
+
+arguments:
+  - valueFrom: ${
+        var fai_list = "";
+        for (var i = 0; i < inputs.fasta_path.length; i ++) {
+          fai_list += " cat " + inputs.fasta_path[i].path +".fai" + " >> fai.list && "
+        }
+        return fai_list.slice(0,-3)
+        }
+    position: 1
+    shellQuote: false
+
+baseCommand: []
diff --git a/tests/input_deps/ref.fasta b/tests/input_deps/ref.fasta
new file mode 100644
--- /dev/null
+++ b/tests/input_deps/ref.fasta
@@ -0,0 +1,10 @@
+>0$chr1$9001$11468
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN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CGCAGAGAGGCGCGCCGCGCCGGCGCAGGCGCAGAGACACATGCTACCGCGTCCAGGGGTGGAGGCGTGGCGCAGGCGCAGAGAGGCGCACCGCGCCGGCGCAGGCGCAGAGACACATGCTAGCGCGTCCAGGGGTGGAGGCGTGGCGCAGGCGCAGAGACGCAAGCCTACGGGCGGGGGTTGGGGGGGCGTGTGTTGCAGGAGCAAAGTCGCACGGCGCCGGGCTGGGGCGGGGGGAGGGTGGCGCCGTGCACGCGCAGAAACTCACGTCACGGTGGCGCGGCGCAGAGACGGGTAGAACCTCAGTAATCCGAAAAGCCGGGATCGACCGCCCCTTGCTTGCAGCCGGGCACTACAGGACCCGCTTGCTCACGGTGCTGTGCCAGGGCGCCCCCTGCTGGCGACTAGGGCAACTGCAGGGCTCTCTTGCTTAGAGTGGTGGCCAGCGCCCCCTGCTGGCGCCGGGGCACTGCAGGGCCCTCTTGCTTACTGTATAGTGGTGGCACGCCGCCTGCTGGCAGCTAGGGACATTGCAGGGTCCTCTTGCTCAAGGTGTAGTGGCAGCACGCCCACCTGCTGGCAGCTGGGGACACTGCCGGGCCCTCTTGCTCCAACAGTACTGGCGGATTATNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+>1$chr1$53713$55817
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNATAGATGGAATAAATAAAATGTGAACTTAGGTAAATTATAAATTAATAAAGTATATTTTTAAAATTTCCATTTTAATTTCTGTTTAAATTAGAATAAGAAACAAAAACAACTATGTAATACGTGTGCAAAGCCCTGAACTGAGATTTGACTTTACCTTGAGCTTTGTCAGTTTACGATGCTATTTCAGTTTTGTGCTCAGATTTGAGTGATTGCAGGAAGAGAATAAATTTCTTTAATGCTGTCAAGACTTTAAATAGATACAGACAGAGCATTTTCACTTTTTCCTACATCTCTATTATTCTAAAAATGAGAACATTCCAAAAGTCAACCATCCAAGTTTATTCTAAATAGATGTGTAGAAATAACAGTTGTTTCACAGGAGACTAATCGCCCAAGGATATGTGTTTAGAGGTACTGGTTTCTTAAATAAGGTTTTCTAGTCAGGCAAAAGATTCCCTGGAGCTTATGCATCTGTGGTTGATATTTTGGGATAAGAATAAAGCTAGAAATGGTGAGGCATATTCAATTTCATTGAAGATTTCTGCATTCAAAATAAAAACTCTATTGAAGTTACACATACTTTTTTCATGTATTTGTTTCTACTGCTTTGTAAATTATAACAGCTCAATTAAGAGAAACCGTACCTATGCTATTTTGTCCTGTGATTCTCCAAGAACCTTCCTAAGTTATTCTACTTAATTGCTTTATCACTCATATGAATGGGAATTTCTTCTCTTAATTGCTGCTAATCTCCCCCATCTTCAAATACTCTACCGGGCTTCTGGAACACCACAGCTTCCTGGCTTTTTCTCCTACCTCCTGGGCAAGTCCTTCCCTGTGTCTTTTGTTGAGTGTTCCTCATCTGCTTAACTACCAATCAACCTATTGCCCCTAATTTGATCTTTGGCCTGTTTTCACTTAGATTCTATCCCTACGTATCACCCATTCCCACAGCTTTAATCACCATCTAAACACTAGGGGCTCTCAAACCTTGTATTTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTCCTCCTTTTCTTTCCTTTTCTTTCTTTCATTCTTTCTTTCTTTTTTAAGGGGCAGGGTCTCACTATGTTGCTGAGGCTGGTCTCAAACTCCTGACCTCAAGCAATCTGTCTGCTTCAGCCTCCCAAGTAGCTGAGAATACAGGGACAAGCCATTGCACCTGACCCTGGTACTATTTCTTGAGTTCCTGATCCACAGATCTAACCTCCTACTTTCCTGGATGCCACACAAGATCTTCCACTCAACAAGTCTGCAACTAAACTAGCCTTCCTCTTTTCAAACCTACTCTTCTTTCAGTGTTCTCAGTCACAATAATTTGTACCAACTAGTTACCTAGTTGCACAACCCAAAATCTGGGAAAAATAATAGATTTCTTTCTCCATAGTACCCCCAAATCAATAAATCATCAAGTCTTATTCTACCTTCCAAAGAGCCTTACATATGTTCCTTTATTTTCATCTGTAACACCACTATTCCTGTCTAAGCCTACCTATGTCATTTTTGGAAGAGAATATAGTCACCTATGCGACCTTCCCACTTAAAATCCTACTATTTACGCTTCAGTAAAAGAAAAAAAATTTTTAATCTAAGTATGTAATTCTTTTGCTGAAGACACTTCACTTGCTTCTGTGCCCTTAAACTGGTATGTTATCATGGTATAGTAGGCCATCCAAGACCTGGCTTCCTTCCTTTTTTTCAGTCTCAGAGAATAACATACTCTTTCCCTGCAACTCCAGATCCAATTTGGTTTTCTTTTACTTGCCTGGAAACTCCAAAATCTATCAACTCTGGGGCTTTCCACTAGCTAATCATTTTGTATACAATATTTGTCCTTCATGTTTTGCCTCTTAACATCTCAGCTTTCAGTTTCATCATTTTACCAGGGAGGCCTCCCAGAACCTGAGTCCAGAAGAGTTCCTTCCATTGTATATTCCTCTAGCACTACCTATTACCTCTTTTGTAAGACTAACAGCCCTCAAAATTTTTCATTCAGTGATGTCTTCCTCATTGCATTTTAAGTTCAACATGAGCAGGACTTTGTCGTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+>2$chr1$65161$67630
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNAAATCGAAGCATTATTACTTACTCTCTTGTTAACCTATCTGGATTTTAATTTTGTAACTTTATTATATTTGTTTTGCTGTGATTCTTTAAAAAGCACCTTTAGACTCAGTGAGATAGCAAAAATATCCAAATAGGCCAAAAAATTGTGGCAATGTCCTCTCACTCAGGAAAATTCTGTGTGTTTTCTCTAATGGCCAAGGGAAAACTTGTGAGACTATAAAAGTTAGTCTCAGTACACAAAGCTCAGACTGGCTATTCCCAGATCTCTTCAGGTACATCTAGTCCATTCATAAAGGGCTTTTAATTAACCAAGTGGTTTACTAAAAAGGACAATTCACTACATATTATTCTCTTACAGTTTTTATGCCTCATTCTGTGAAAATTGCTGTAGTCTCTTCCAGTTATGAAGAAGGTAGGTGGAAACAAAGACAAAACACATATATTAGAAGAATGAATGAAATTGTAGCATTTTATTGACAATGAGATGGTTCTATTAGTAGGAATCTATTCTGCATAATTCCATTTTGTGTTTACCTTCTGGAAAAATGAAAGGATTCTGTATGGTTAACTTAAATACTTAGAGAAATTAATATGAATAATGTTAGCAAGAATAACCCTTGTTATAAGTATTATGCTGGCAACAATTGTCGAGTCCTCCTCCTCACTCTTCTGGGCTAATTTGTTCTTTTCTCCCCATTTAATAGTCCTTTTCCCCATCTTTCCCCAGGTCCGGTGTTTTCTTACCCACCTCCTTCCCTCCTTTTTATAATACCAGTGAAACTTGGTTTGGAGCATTTCTTTCACATAAAGGTACAAATCATACTGCTAGAGTTGTGAGGATTTTTACAGCTTTTGAAAGAATAAACTCATTTTAAAAACAGGAAAGCTAAGGCCCAGAGATTTTTAAATGATATTCCCATGATCACACTGTGAATTTGTGCCAGAACCCAAATGCCTACTCCCATCTCACTGAGACTTACTATAAGGACATAAGGCATTTATATATATATATATTATATATACTATATATTTATATATATTACATATTATATATATAATATATATTATATAATATATATTATATTATATAATATATAATATAAATATAATATAAATTATATTATATAATATATAATATAAATATAATATAAATTATATAAATATAATATATATTTTATTATATAATATAATATATATTATATAAATATAATATATAAATTATATAATATAATATATATTATATAATATAATATATTTTATTATATAAATATATATTATATTATATAATATATATTTTATTATATAATATATATTATATATTTATAGAATATAATATATATTTTATTATATAATATATATTATATAATATATATTATATTTATATATAACATATATTATTATATAAAATATGTATAATATATATTATATAAATATATTTATATATTATATAAATATATATATTATATATAATTCTAATGGTTGAATTCCAAGAATAATCTATGGCATGAAAGATTTTACCTGTCAACAGTGGCTGGCTCTTCATGGTTGCTACAATGAGTGTGTAAGATTCTGAAGGACTCCTTTAATAAGCCTAAACTTAATGTTCAACTTAGAATAAATACAATTCTTCTAATTTTTTTTGAATAATTTTTAAAAAGTCAGAAATGAGCTTTGAAAGAATTATGGTGGTGAAGGATCCCCTCAGCAGCACAAATTCAGGAGAGAGATGTCTTAACTACGTTAGCAAGAAATTCCTTTTGCTAAAGAATAGCATTCCTGAATTCTTACTAACAGCCATGATAGAAAGTCTTTTGCTACAGATGAGAACCCTCGGGTCAACCTCATCCTTGGCATATTTCATGTGAAGATATAACTTCAAGATTGTCCTTGCCTATCAATGAAATGAATTAATTTTATGTCAATGCATATTTAAGGTCTATTCTAAATTGCACACTTTGATTCAAAAGAAACAGTCCAACCAACCAGTCAGGACAGAAATTATCTCACAATAAAAATCCTATCGTTTGTACTGTCAATGATTAGTATGATTATATTTATTACCGTGCTAAGCAGAAGAGAAATGAAGTGAATGTTCATGATTTATTCCACTATTAGACTTCTCTTTATTCTTAAAAATATTTAAGATCACTAAATTTTTATAGGACTTTAAAAACAGTAATGTGCTGCTTTGAGTGTGTAGGACTAAGAAATGGGATTCAGAGTAGTAAAGAGAAAAGTGGAATTTCCAAGCACTATGAATTACTGTTCTTTAAAAAACAGCAAAAATCAAATAACAGTATTCCTCCAAAAAAGATGGCAAGTGTAAACTCTATACCTTCATGTCTCCCGTGGAATGTTAGTGATCAATTTCCACTTCTCTCTTTTACATCTTACTTGCCCATTAACTCTTATACCTAATCCAAAGATTGTTAATATGGCTATGTCTCACTTTCAGGACACCTTTTATTTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+>3$chr1$82792$85041
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNACTACATCCCACAGTGGGTAACAAAAATAACCTTGAAGAAGGGAAAAATTTGGTTTCCAGAATAAACACATTATAATATCCAAAATGTCCAGTTTTCAACAAAAATTAAGAAGCATGCAAATAAACACAAAACTATGGCCCATTTACAGAAGAAATAAATGAGACTCTCCCTGAGTAAGCAGATATTGAAAATATTAGACAAAAACTTTATATAACTGTCTTAAATAAACTTAAAGAGCTAAAGAAACCCAAGAGAATGACATATAAATAAATAAGAAATATGAATTTTTTTAAAGGTACAAAAAAATTCTGAGGCTGAAAAGTACAATAAGTAAAAAGTTACTTTTTACTTAGGGTTCCAATAGAAGATTTGAGCAGCTGGAAAAAAGAATCAGTGAACTTGATAGATCAAATGAAATGATTCAGTCTGAAGAGCAGGAAAATGAAAGAATGACAACAAAAAAGAATAGAGCCTAAAGACCTGTGTAACAACATCAAGAATGCCTACATACAGAATCCTGGTGGGGAGTGAGGGGCAGGAAGACTATTTGAAGAAATGTGTTTGAAAGCTTCCCAAATTTCACTAAAAACAAATATATACATTCAAAAAGCTCAGTGAACTTCATCAAGGAAATATACAAAGATATTCACACCAAGACACACTATGTTTCAAATTGTCAAAAGGCAAAGCGAATGTTTGAAAGCAGCAAGAGAAAGGCAACGCGTCATTTACAAAGGATCCTCAATAAGTTTGACAGCAGATAGTGCATTATAAGCCATGGATGCCAGAAGAGCTTAGGAAAAAGGCAACGCGTCATTTACAAAGGATCCTCAGTAAGTTTGACAGCAGAGAGCTCATTATAAACCATGGGTGCCAGAAGAGCTTAGGATGACATTTTAAAGTTCTGAAAGAAAAAAACACTGTCAACCAAAAATTCTATAACTTGGAAGATGCCCCTTCAAGTATTAAGGATAAATTACACATTCCCAGATTAAAAAAAAGAAAGAGAGAGAGAGAGAAAGAGAAAGAAAGAAAGAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAGAGAAAGAAAGAAAGAAGAAAGAGAAAGAAAGAAAGAAAGAGAGAGAGAAAGAGAGAGAAAGAAAAAGAAGGAAAGAAAGAAAGAAAGAAAAAAGAAAGAAAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAAGCAAGCAAGCTTTAAAAGTTCATGTTTGGTAGGCTGTACTTCAAGATACACTTTTAAAAAAAAGACTCCTTCAGATACAAACTAAAAAACACTAGAAAGTAACTCAAAACCACATAAAGAAATAACTCCAGTAAAGATAACTACATAGGTAAATATAAAAGCAATTATCACATTTTTTGTAAGTCTTTTTTAATATTCTATATGTTTTAAAACAAATGTGTAAAATAATGACTATAAATCTATGTTAATGAAGCATGATGTATACAGATGTGGTTTGTGAAATTACCAACATAAAGAAATTCATAGGAAACTAAATAATAATAGAGATTTTGTATACTATTGAAGTTGTTTCAATTTACTCTAAATTGTTCCAAATTAAGAATGTTAATTGTAAATCCCCATGGTAACCACTAAGTTAATATCTTTTGAAAATACAGAAAAGGAAAGCACAGGGTAAACACAGTGATATGCTACAAAATAGCAACTAAACACAAAAGAAGGCGATAATTGAGGAAATTAGGAACAAAGGAGGTATAAGACATACAGAAAACAAAAGCAAAATGGTAGGAGTAAGCCCCTCTTTATCAGTAATTACATTAAATACAAATGAATTAAACTCTCCAATCCAAAGAAAGAGATTAACAGAATGGATTTTTTAAAAATGATCCAACTATATTGTCCACAAGATACTCACTTTAGATCAAAATACACAATGAGTTGAAATGAAAGGATGGGAGAAAATATTCCATGTAAGTAATAACCAAAGGAGATCTGAGGCAAATATACTTATATCAGACAAAATAGACTTTAAGTCAAAAACTGTTACAAAATACAAAGAACAGTATATATTGATTTCAAAATTAATTAAGAAGATATAACAATTATAAATATATGTACACCAACTAACAGGGCTCCAAAATATATAATGTAACCATTGAGAGAATTAAAGGGAGAGACAGACAATTCCACGAAAATTGTTGGGCATTTGAAAACCCAACTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+>4$chr1$98000$100116
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCATGACAGGCAGAGCTCCCTGTTGAGCCACAGAGATTTAGAGAATGGCTGTTAACACAGCATAATCCAGCCCATCCTGACTAATCTGATATTAACATGTATAATAAAGAATTCTATCAATGCTGAGGGAAGATGACTAGTTAAGGTCCTAGGTTGCAAGTCTCAAAACCTCTTCTAAGGATTGTAGACAGGAAATTAAATGACTTCTAGTCCCTAGAGTTCCCAATCTCCTACCATCCCATCCTAATATGACAGAAGTAATTCCTGAGTTGCTTCTGAAACCAGAGCTTCCCTCAGAACCCTTAGCCTGCCAGATGGCTTCTTGGAGAGCCCTCACTCACTTTTCTCCTTCTGCTATTGCTGCTCATTCATTCCAGTTTTTAAAAATTCATCTTTATCCAGGAACCTCGCTTCTAGAAAAGTCATACAGGTGCTTCCAGGAGGCTACATGGGCACCCATATTTTTCTAGCCACTTTCATTAGACCAATGCAGCAGAGAAGAAAAGCCTCAATAATTATTATGACATGGCATGTTAGGATACCAAGTAAATTGCATTTGTAAAATGTGATTTTCTGTTGGTGTTCACTTCAGCTCTACTGACATTTGGTAAGTATTATTGACTGACTGACTAACTAATGTGGTCATTAGTCTTCATAAAGAAAGGCTCTCTACAAAAACGGAGGGATGCCCTTTTTCTGGCATTTAATACGTAAGAAATTGCCTCCAATAGAAACCAGAGTTGCCTGATTACTATCAGCACAGGAGAAATGTATTAATGTGCCTTTCTAGTAACAGGTTTTTAGAAAGTCAAATATAAACAAATCTGTCTATTTGTGTGTGTGCATGTGGTAGTGGGGAGGGAAGAAAAAAGGAGGGGGAGAGAAAGAGAAATAAGAACCAAGTTTATTATACTGTATTCAGGGGGAAAAAATTTTCCCAAGGTCCTAACAGAAGAGCAAAGTGCCACTGTCAATAGCCTCAGTAGTGTTAGGGTTGCTTTTATTTATTTATTTATTTATTTATTTATTTATTTATTTATTTTTCCTTTTTTTTCTTTCTCTTTTTTTCTTCTTTTTTTTTTCTTTTCTTTCTTTTTTTTTTTTTTTTTTTTTTTTGGACAGAGTCTCACACTGTCACCTGGGCTGGAGTGCATTGGTGCAATCTCGACTCACTGCAACTTCTGCCTCCCAGGTTCAAGTGATTCTCCTGCCTCAGCCGCCCAAGTAGCTGGGATTACAGGTGTCTGCCACCGTGCCTAGCTAATTTTTTTGTATTTTTAGTAGAGATGAGGTTTCACTATGTTGGCCAGGCTGGTCTCAAACTCCTGACCTCATGATCCACCCACGTTGGCCTCCCAAAGTGCTGGGATTACAGGCGTGAGCCACCGCCCCTGGCCAGGATTGCTTTTACAGCCAGTCTTCAGGTGCCCACTGTAGGAACAATGTCATTTAACCCTCGGGATTATTCTGTGCCAAATATGGATAATGACTAATATCCAACACAGATATTCTCAGCTCAGAAGAGCAATTAGCAAATTCATAAATTAAGTGCTTGCTTCCTCTTTAGTCAAATACAAACGTTTGTTAAAAGATATTATTTTGCTTTACACTTTTTCTCTCAGAAATAAGCAGATGCTTGAATTCCCACAGTGCTGCTTGAGCCTCACACCATGTCATCCTGCCAGGCACCCAGATCCAGTTCTAGAGTTTCACATGATCGTGAGTGTTGGTTAATAAGTCAATGTGAACTGGGAGGGGAGATTTTTCAGGAGTGCCACAGGGCTCTCCCTTTAATCACATACACTCCCTGCTTTCATTGGAAAGTGTATAATGATGTCAGAGTGCCCCAGAATGGAGCTAGTTGGAAGACTGCCGTCATAGGGATGCCTTAGTGAATTAATAAGGTTTTAATTTCTGGCTCTCAACTTTGTAGATGTAAAAGTTGATTTATCAATATGTGAGAAAGGATGAATCTTTCTGAAGGTTATGTCATCACACTCACTAAGCACACAGAGAATAATGTCTAGAATCTGAGTGCCATGTTATCAAATTGTACTGAGACTCTTGCAGTCACACAGGCTGACATGTAAGCATCGCCATGCCTAGTACAGACTCTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
diff --git a/tests/input_deps/ref.fasta.fai b/tests/input_deps/ref.fasta.fai
new file mode 100644
--- /dev/null
+++ b/tests/input_deps/ref.fasta.fai
@@ -0,0 +1,5 @@
+0$chr1$9001$11468	2567	19	2567	2568
+1$chr1$53713$55817	2204	2607	2204	2205
+2$chr1$65161$67630	2569	4832	2569	2570
+3$chr1$82792$85041	2349	7422	2349	2350
+4$chr1$98000$100116	2216	9793	2216	2217
diff --git a/tests/input_deps/ref2.fasta b/tests/input_deps/ref2.fasta
new file mode 100644
--- /dev/null
+++ b/tests/input_deps/ref2.fasta
@@ -0,0 +1,10 @@
+>0$chr1$9001$11468
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN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CTCTTGCTTAGAGTGGTGGCCAGCGCCCCCTGCTGGCGCCGGGGCACTGCAGGGCCCTCTTGCTTACTGTATAGTGGTGGCACGCCGCCTGCTGGCAGCTAGGGACATTGCAGGGTCCTCTTGCTCAAGGTGTAGTGGCAGCACGCCCACCTGCTGGCAGCTGGGGACACTGCCGGGCCCTCTTGCTCCAACAGTACTGGCGGATTATNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+>1$chr1$53713$55817
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNATAGATGGAATAAATAAAATGTGAACTTAGGTAAATTATAAATTAATAAAGTATATTTTTAAAATTTCCATTTTAATTTCTGTTTAAATTAGAATAAGAAACAAAAACAACTATGTAATACGTGTGCAAAGCCCTGAACTGAGATTTGACTTTACCTTGAGCTTTGTCAGTTTACGATGCTATTTCAGTTTTGTGCTCAGATTTGAGTGATTGCAGGAAGAGAATAAATTTCTTTAATGCTGTCAAGACTTTAAATAGATACAGACAGAGCATTTTCACTTTTTCCTACATCTCTATTATTCTAAAAATGAGAACATTCCAAAAGTCAACCATCCAAGTTTATTCTAAATAGATGTGTAGAAATAACAGTTGTTTCACAGGAGACTAATCGCCCAAGGATATGTGTTTAGAGGTACTGGTTTCTTAAATAAGGTTTTCTAGTCAGGCAAAAGATTCCCTGGAGCTTATGCATCTGTGGTTGATATTTTGGGATAAGAATAAAGCTAGAAATGGTGAGGCATATTCAATTTCATTGAAGATTTCTGCATTCAAAATAAAAACTCTATTGAAGTTACACATACTTTTTTCATGTATTTGTTTCTACTGCTTTGTAAATTATAACAGCTCAATTAAGAGAAACCGTACCTATGCTATTTTGTCCTGTGATTCTCCAAGAACCTTCCTAAGTTATTCTACTTAATTGCTTTATCACTCATATGAATGGGAATTTCTTCTCTTAATTGCTGCTAATCTCCCCCATCTTCAAATACTCTACCGGGCTTCTGGAACACCACAGCTTCCTGGCTTTTTCTCCTACCTCCTGGGCAAGTCCTTCCCTGTGTCTTTTGTTGAGTGTTCCTCATCTGCTTAACTACCAATCAACCTATTGCCCCTAATTTGATCTTTGGCCTGTTTTCACTTAGATTCTATCCCTACGTATCACCCATTCCCACAGCTTTAATCACCATCTAAACACTAGGGGCTCTCAAACCTTGTATTTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTTCTTCCTCCTTTTCTTTCCTTTTCTTTCTTTCATTCTTTCTTTCTTTTTTAAGGGGCAGGGTCTCACTATGTTGCTGAGGCTGGTCTCAAACTCCTGACCTCAAGCAATCTGTCTGCTTCAGCCTCCCAAGTAGCTGAGAATACAGGGACAAGCCATTGCACCTGACCCTGGTACTATTTCTTGAGTTCCTGATCCACAGATCTAACCTCCTACTTTCCTGGATGCCACACAAGATCTTCCACTCAACAAGTCTGCAACTAAACTAGCCTTCCTCTTTTCAAACCTACTCTTCTTTCAGTGTTCTCAGTCACAATAATTTGTACCAACTAGTTACCTAGTTGCACAACCCAAAATCTGGGAAAAATAATAGATTTCTTTCTCCATAGTACCCCCAAATCAATAAATCATCAAGTCTTATTCTACCTTCCAAAGAGCCTTACATATGTTCCTTTATTTTCATCTGTAACACCACTATTCCTGTCTAAGCCTACCTATGTCATTTTTGGAAGAGAATATAGTCACCTATGCGACCTTCCCACTTAAAATCCTACTATTTACGCTTCAGTAAAAGAAAAAAAATTTTTAATCTAAGTATGTAATTCTTTTGCTGAAGACACTTCACTTGCTTCTGTGCCCTTAAACTGGTATGTTATCATGGTATAGTAGGCCATCCAAGACCTGGCTTCCTTCCTTTTTTTCAGTCTCAGAGAATAACATACTCTTTCCCTGCAACTCCAGATCCAATTTGGTTTTCTTTTACTTGCCTGGAAACTCCAAAATCTATCAACTCTGGGGCTTTCCACTAGCTAATCATTTTGTATACAATATTTGTCCTTCATGTTTTGCCTCTTAACATCTCAGCTTTCAGTTTCATCATTTTACCAGGGAGGCCTCCCAGAACCTGAGTCCAGAAGAGTTCCTTCCATTGTATATTCCTCTAGCACTACCTATTACCTCTTTTGTAAGACTAACAGCCCTCAAAATTTTTCATTCAGTGATGTCTTCCTCATTGCATTTTAAGTTCAACATGAGCAGGACTTTGTCGTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+>2$chr1$65161$67630
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNAAATCGAAGCATTATTACTTACTCTCTTGTTAACCTATCTGGATTTTAATTTTGTAACTTTATTATATTTGTTTTGCTGTGATTCTTTAAAAAGCACCTTTAGACTCAGTGAGATAGCAAAAATATCCAAATAGGCCAAAAAATTGTGGCAATGTCCTCTCACTCAGGAAAATTCTGTGTGTTTTCTCTAATGGCCAAGGGAAAACTTGTGAGACTATAAAAGTTAGTCTCAGTACACAAAGCTCAGACTGGCTATTCCCAGATCTCTTCAGGTACATCTAGTCCATTCATAAAGGGCTTTTAATTAACCAAGTGGTTTACTAAAAAGGACAATTCACTACATATTATTCTCTTACAGTTTTTATGCCTCATTCTGTGAAAATTGCTGTAGTCTCTTCCAGTTATGAAGAAGGTAGGTGGAAACAAAGACAAAACACATATATTAGAAGAATGAATGAAATTGTAGCATTTTATTGACAATGAGATGGTTCTATTAGTAGGAATCTATTCTGCATAATTCCATTTTGTGTTTACCTTCTGGAAAAATGAAAGGATTCTGTATGGTTAACTTAAATACTTAGAGAAATTAATATGAATAATGTTAGCAAGAATAACCCTTGTTATAAGTATTATGCTGGCAACAATTGTCGAGTCCTCCTCCTCACTCTTCTGGGCTAATTTGTTCTTTTCTCCCCATTTAATAGTCCTTTTCCCCATCTTTCCCCAGGTCCGGTGTTTTCTTACCCACCTCCTTCCCTCCTTTTTATAATACCAGTGAAACTTGGTTTGGAGCATTTCTTTCACATAAAGGTACAAATCATACTGCTAGAGTTGTGAGGATTTTTACAGCTTTTGAAAGAATAAACTCATTTTAAAAACAGGAAAGCTAAGGCCCAGAGATTTTTAAATGATATTCCCATGATCACACTGTGAATTTGTGCCAGAACCCAAATGCCTACTCCCATCTCACTGAGACTTACTATAAGGACATAAGGCATTTATATATATATATATTATATATACTATATATTTATATATATTACATATTATATATATAATATATATTATATAATATATATTATATTATATAATATATAATATAAATATAATATAAATTATATTATATAATATATAATATAAATATAATATAAATTATATAAATATAATATATATTTTATTATATAATATAATATATATTATATAAATATAATATATAAATTATATAATATAATATATATTATATAATATAATATATTTTATTATATAAATATATATTATATTATATAATATATATTTTATTATATAATATATATTATATATTTATAGAATATAATATATATTTTATTATATAATATATATTATATAATATATATTATATTTATATATAACATATATTATTATATAAAATATGTATAATATATATTATATAAATATATTTATATATTATATAAATATATATATTATATATAATTCTAATGGTTGAATTCCAAGAATAATCTATGGCATGAAAGATTTTACCTGTCAACAGTGGCTGGCTCTTCATGGTTGCTACAATGAGTGTGTAAGATTCTGAAGGACTCCTTTAATAAGCCTAAACTTAATGTTCAACTTAGAATAAATACAATTCTTCTAATTTTTTTTGAATAATTTTTAAAAAGTCAGAAATGAGCTTTGAAAGAATTATGGTGGTGAAGGATCCCCTCAGCAGCACAAATTCAGGAGAGAGATGTCTTAACTACGTTAGCAAGAAATTCCTTTTGCTAAAGAATAGCATTCCTGAATTCTTACTAACAGCCATGATAGAAAGTCTTTTGCTACAGATGAGAACCCTCGGGTCAACCTCATCCTTGGCATATTTCATGTGAAGATATAACTTCAAGATTGTCCTTGCCTATCAATGAAATGAATTAATTTTATGTCAATGCATATTTAAGGTCTATTCTAAATTGCACACTTTGATTCAAAAGAAACAGTCCAACCAACCAGTCAGGACAGAAATTATCTCACAATAAAAATCCTATCGTTTGTACTGTCAATGATTAGTATGATTATATTTATTACCGTGCTAAGCAGAAGAGAAATGAAGTGAATGTTCATGATTTATTCCACTATTAGACTTCTCTTTATTCTTAAAAATATTTAAGATCACTAAATTTTTATAGGACTTTAAAAACAGTAATGTGCTGCTTTGAGTGTGTAGGACTAAGAAATGGGATTCAGAGTAGTAAAGAGAAAAGTGGAATTTCCAAGCACTATGAATTACTGTTCTTTAAAAAACAGCAAAAATCAAATAACAGTATTCCTCCAAAAAAGATGGCAAGTGTAAACTCTATACCTTCATGTCTCCCGTGGAATGTTAGTGATCAATTTCCACTTCTCTCTTTTACATCTTACTTGCCCATTAACTCTTATACCTAATCCAAAGATTGTTAATATGGCTATGTCTCACTTTCAGGACACCTTTTATTTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+>3$chr1$82792$85041
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNACTACATCCCACAGTGGGTAACAAAAATAACCTTGAAGAAGGGAAAAATTTGGTTTCCAGAATAAACACATTATAATATCCAAAATGTCCAGTTTTCAACAAAAATTAAGAAGCATGCAAATAAACACAAAACTATGGCCCATTTACAGAAGAAATAAATGAGACTCTCCCTGAGTAAGCAGATATTGAAAATATTAGACAAAAACTTTATATAACTGTCTTAAATAAACTTAAAGAGCTAAAGAAACCCAAGAGAATGACATATAAATAAATAAGAAATATGAATTTTTTTAAAGGTACAAAAAAATTCTGAGGCTGAAAAGTACAATAAGTAAAAAGTTACTTTTTACTTAGGGTTCCAATAGAAGATTTGAGCAGCTGGAAAAAAGAATCAGTGAACTTGATAGATCAAATGAAATGATTCAGTCTGAAGAGCAGGAAAATGAAAGAATGACAACAAAAAAGAATAGAGCCTAAAGACCTGTGTAACAACATCAAGAATGCCTACATACAGAATCCTGGTGGGGAGTGAGGGGCAGGAAGACTATTTGAAGAAATGTGTTTGAAAGCTTCCCAAATTTCACTAAAAACAAATATATACATTCAAAAAGCTCAGTGAACTTCATCAAGGAAATATACAAAGATATTCACACCAAGACACACTATGTTTCAAATTGTCAAAAGGCAAAGCGAATGTTTGAAAGCAGCAAGAGAAAGGCAACGCGTCATTTACAAAGGATCCTCAATAAGTTTGACAGCAGATAGTGCATTATAAGCCATGGATGCCAGAAGAGCTTAGGAAAAAGGCAACGCGTCATTTACAAAGGATCCTCAGTAAGTTTGACAGCAGAGAGCTCATTATAAACCATGGGTGCCAGAAGAGCTTAGGATGACATTTTAAAGTTCTGAAAGAAAAAAACACTGTCAACCAAAAATTCTATAACTTGGAAGATGCCCCTTCAAGTATTAAGGATAAATTACACATTCCCAGATTAAAAAAAAGAAAGAGAGAGAGAGAGAAAGAGAAAGAAAGAAAGAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAGAGAAAGAAAGAAAGAAGAAAGAGAAAGAAAGAAAGAAAGAGAGAGAGAAAGAGAGAGAAAGAAAAAGAAGGAAAGAAAGAAAGAAAGAAAAAAGAAAGAAAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAGAAAAGCAAGCAAGCTTTAAAAGTTCATGTTTGGTAGGCTGTACTTCAAGATACACTTTTAAAAAAAAGACTCCTTCAGATACAAACTAAAAAACACTAGAAAGTAACTCAAAACCACATAAAGAAATAACTCCAGTAAAGATAACTACATAGGTAAATATAAAAGCAATTATCACATTTTTTGTAAGTCTTTTTTAATATTCTATATGTTTTAAAACAAATGTGTAAAATAATGACTATAAATCTATGTTAATGAAGCATGATGTATACAGATGTGGTTTGTGAAATTACCAACATAAAGAAATTCATAGGAAACTAAATAATAATAGAGATTTTGTATACTATTGAAGTTGTTTCAATTTACTCTAAATTGTTCCAAATTAAGAATGTTAATTGTAAATCCCCATGGTAACCACTAAGTTAATATCTTTTGAAAATACAGAAAAGGAAAGCACAGGGTAAACACAGTGATATGCTACAAAATAGCAACTAAACACAAAAGAAGGCGATAATTGAGGAAATTAGGAACAAAGGAGGTATAAGACATACAGAAAACAAAAGCAAAATGGTAGGAGTAAGCCCCTCTTTATCAGTAATTACATTAAATACAAATGAATTAAACTCTCCAATCCAAAGAAAGAGATTAACAGAATGGATTTTTTAAAAATGATCCAACTATATTGTCCACAAGATACTCACTTTAGATCAAAATACACAATGAGTTGAAATGAAAGGATGGGAGAAAATATTCCATGTAAGTAATAACCAAAGGAGATCTGAGGCAAATATACTTATATCAGACAAAATAGACTTTAAGTCAAAAACTGTTACAAAATACAAAGAACAGTATATATTGATTTCAAAATTAATTAAGAAGATATAACAATTATAAATATATGTACACCAACTAACAGGGCTCCAAAATATATAATGTAACCATTGAGAGAATTAAAGGGAGAGACAGACAATTCCACGAAAATTGTTGGGCATTTGAAAACCCAACTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
+>4$chr1$98000$100116
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCATGACAGGCAGAGCTCCCTGTTGAGCCACAGAGATTTAGAGAATGGCTGTTAACACAGCATAATCCAGCCCATCCTGACTAATCTGATATTAACATGTATAATAAAGAATTCTATCAATGCTGAGGGAAGATGACTAGTTAAGGTCCTAGGTTGCAAGTCTCAAAACCTCTTCTAAGGATTGTAGACAGGAAATTAAATGACTTCTAGTCCCTAGAGTTCCCAATCTCCTACCATCCCATCCTAATATGACAGAAGTAATTCCTGAGTTGCTTCTGAAACCAGAGCTTCCCTCAGAACCCTTAGCCTGCCAGATGGCTTCTTGGAGAGCCCTCACTCACTTTTCTCCTTCTGCTATTGCTGCTCATTCATTCCAGTTTTTAAAAATTCATCTTTATCCAGGAACCTCGCTTCTAGAAAAGTCATACAGGTGCTTCCAGGAGGCTACATGGGCACCCATATTTTTCTAGCCACTTTCATTAGACCAATGCAGCAGAGAAGAAAAGCCTCAATAATTATTATGACATGGCATGTTAGGATACCAAGTAAATTGCATTTGTAAAATGTGATTTTCTGTTGGTGTTCACTTCAGCTCTACTGACATTTGGTAAGTATTATTGACTGACTGACTAACTAATGTGGTCATTAGTCTTCATAAAGAAAGGCTCTCTACAAAAACGGAGGGATGCCCTTTTTCTGGCATTTAATACGTAAGAAATTGCCTCCAATAGAAACCAGAGTTGCCTGATTACTATCAGCACAGGAGAAATGTATTAATGTGCCTTTCTAGTAACAGGTTTTTAGAAAGTCAAATATAAACAAATCTGTCTATTTGTGTGTGTGCATGTGGTAGTGGGGAGGGAAGAAAAAAGGAGGGGGAGAGAAAGAGAAATAAGAACCAAGTTTATTATACTGTATTCAGGGGGAAAAAATTTTCCCAAGGTCCTAACAGAAGAGCAAAGTGCCACTGTCAATAGCCTCAGTAGTGTTAGGGTTGCTTTTATTTATTTATTTATTTATTTATTTATTTATTTATTTATTTTTCCTTTTTTTTCTTTCTCTTTTTTTCTTCTTTTTTTTTTCTTTTCTTTCTTTTTTTTTTTTTTTTTTTTTTTTGGACAGAGTCTCACACTGTCACCTGGGCTGGAGTGCATTGGTGCAATCTCGACTCACTGCAACTTCTGCCTCCCAGGTTCAAGTGATTCTCCTGCCTCAGCCGCCCAAGTAGCTGGGATTACAGGTGTCTGCCACCGTGCCTAGCTAATTTTTTTGTATTTTTAGTAGAGATGAGGTTTCACTATGTTGGCCAGGCTGGTCTCAAACTCCTGACCTCATGATCCACCCACGTTGGCCTCCCAAAGTGCTGGGATTACAGGCGTGAGCCACCGCCCCTGGCCAGGATTGCTTTTACAGCCAGTCTTCAGGTGCCCACTGTAGGAACAATGTCATTTAACCCTCGGGATTATTCTGTGCCAAATATGGATAATGACTAATATCCAACACAGATATTCTCAGCTCAGAAGAGCAATTAGCAAATTCATAAATTAAGTGCTTGCTTCCTCTTTAGTCAAATACAAACGTTTGTTAAAAGATATTATTTTGCTTTACACTTTTTCTCTCAGAAATAAGCAGATGCTTGAATTCCCACAGTGCTGCTTGAGCCTCACACCATGTCATCCTGCCAGGCACCCAGATCCAGTTCTAGAGTTTCACATGATCGTGAGTGTTGGTTAATAAGTCAATGTGAACTGGGAGGGGAGATTTTTCAGGAGTGCCACAGGGCTCTCCCTTTAATCACATACACTCCCTGCTTTCATTGGAAAGTGTATAATGATGTCAGAGTGCCCCAGAATGGAGCTAGTTGGAAGACTGCCGTCATAGGGATGCCTTAGTGAATTAATAAGGTTTTAATTTCTGGCTCTCAACTTTGTAGATGTAAAAGTTGATTTATCAATATGTGAGAAAGGATGAATCTTTCTGAAGGTTATGTCATCACACTCACTAAGCACACAGAGAATAATGTCTAGAATCTGAGTGCCATGTTATCAAATTGTACTGAGACTCTTGCAGTCACACAGGCTGACATGTAAGCATCGCCATGCCTAGTACAGACTCTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
diff --git a/tests/input_deps/ref2.fasta.fai b/tests/input_deps/ref2.fasta.fai
new file mode 100644
--- /dev/null
+++ b/tests/input_deps/ref2.fasta.fai
@@ -0,0 +1,5 @@
+0$chr1$9001$11468	2567	19	2567	2568
+1$chr1$53713$55817	2204	2607	2204	2205
+2$chr1$65161$67630	2569	4832	2569	2570
+3$chr1$82792$85041	2349	7422	2349	2350
+4$chr1$98000$100116	2216	9793	2216	2217
diff --git a/tests/test_examples.py b/tests/test_examples.py
--- a/tests/test_examples.py
+++ b/tests/test_examples.py
@@ -539,97 +539,6 @@ def test_scandeps_defaults_with_secondaryfiles() -> None:
     ].endswith(os.path.join("tests", "wf", "indir1"))
 
 
-def test_input_deps() -> None:
-    stream = StringIO()
-
-    main(
-        [
-            "--print-input-deps",
-            get_data("tests/wf/count-lines1-wf.cwl"),
-            get_data("tests/wf/wc-job.json"),
-        ],
-        stdout=stream,
-    )
-
-    expected = {
-        "class": "File",
-        "location": "wc-job.json",
-        "format": CWL_IANA,
-        "secondaryFiles": [
-            {
-                "class": "File",
-                "location": "whale.txt",
-                "basename": "whale.txt",
-                "nameroot": "whale",
-                "nameext": ".txt",
-            }
-        ],
-    }
-    assert json.loads(stream.getvalue()) == expected
-
-
-def test_input_deps_cmdline_opts() -> None:
-    stream = StringIO()
-
-    main(
-        [
-            "--print-input-deps",
-            get_data("tests/wf/count-lines1-wf.cwl"),
-            "--file1",
-            get_data("tests/wf/whale.txt"),
-        ],
-        stdout=stream,
-    )
-    expected = {
-        "class": "File",
-        "location": "",
-        "format": CWL_IANA,
-        "secondaryFiles": [
-            {
-                "class": "File",
-                "location": "whale.txt",
-                "basename": "whale.txt",
-                "nameroot": "whale",
-                "nameext": ".txt",
-            }
-        ],
-    }
-    assert json.loads(stream.getvalue()) == expected
-
-
-def test_input_deps_cmdline_opts_relative_deps_cwd() -> None:
-    stream = StringIO()
-
-    data_path = get_data("tests/wf/whale.txt")
-    main(
-        [
-            "--print-input-deps",
-            "--relative-deps",
-            "cwd",
-            get_data("tests/wf/count-lines1-wf.cwl"),
-            "--file1",
-            data_path,
-        ],
-        stdout=stream,
-    )
-
-    goal = {
-        "class": "File",
-        "location": "",
-        "format": CWL_IANA,
-        "secondaryFiles": [
-            {
-                "class": "File",
-                "location": str(Path(os.path.relpath(data_path, os.path.curdir))),
-                "basename": "whale.txt",
-                "nameroot": "whale",
-                "nameext": ".txt",
-            }
-        ],
-    }
-    assert json.loads(stream.getvalue()) == goal
-
-
 def test_dedupe() -> None:
     not_deduped = [
         {"class": "File", "location": "file:///example/a"},
diff --git a/tests/test_input_deps.py b/tests/test_input_deps.py
new file mode 100644
--- /dev/null
+++ b/tests/test_input_deps.py
@@ -0,0 +1,163 @@
+"""Tests for --print-inputs-deps."""
+
+import os
+import json
+from pathlib import Path
+
+from io import StringIO
+
+from cwltool.main import main
+from cwltool.process import CWL_IANA
+
+from .util import get_data
+
+
+def test_input_deps() -> None:
+    """Basic test of --print-input-deps with a job input file."""
+    stream = StringIO()
+
+    main(
+        [
+            "--print-input-deps",
+            get_data("tests/wf/count-lines1-wf.cwl"),
+            get_data("tests/wf/wc-job.json"),
+        ],
+        stdout=stream,
+    )
+
+    expected = {
+        "class": "File",
+        "location": "wc-job.json",
+        "format": CWL_IANA,
+        "secondaryFiles": [
+            {
+                "class": "File",
+                "location": "whale.txt",
+                "basename": "whale.txt",
+                "nameroot": "whale",
+                "nameext": ".txt",
+            }
+        ],
+    }
+    assert json.loads(stream.getvalue()) == expected
+
+
+def test_input_deps_cmdline_opts() -> None:
+    """Test of --print-input-deps with command line provided inputs."""
+    stream = StringIO()
+
+    main(
+        [
+            "--print-input-deps",
+            get_data("tests/wf/count-lines1-wf.cwl"),
+            "--file1",
+            get_data("tests/wf/whale.txt"),
+        ],
+        stdout=stream,
+    )
+    expected = {
+        "class": "File",
+        "location": "",
+        "format": CWL_IANA,
+        "secondaryFiles": [
+            {
+                "class": "File",
+                "location": "whale.txt",
+                "basename": "whale.txt",
+                "nameroot": "whale",
+                "nameext": ".txt",
+            }
+        ],
+    }
+    assert json.loads(stream.getvalue()) == expected
+
+
+def test_input_deps_cmdline_opts_relative_deps_cwd() -> None:
+    """Test of --print-input-deps with command line provided inputs and relative-deps."""
+    stream = StringIO()
+
+    data_path = get_data("tests/wf/whale.txt")
+    main(
+        [
+            "--print-input-deps",
+            "--relative-deps",
+            "cwd",
+            get_data("tests/wf/count-lines1-wf.cwl"),
+            "--file1",
+            data_path,
+        ],
+        stdout=stream,
+    )
+
+    goal = {
+        "class": "File",
+        "location": "",
+        "format": CWL_IANA,
+        "secondaryFiles": [
+            {
+                "class": "File",
+                "location": str(Path(os.path.relpath(data_path, os.path.curdir))),
+                "basename": "whale.txt",
+                "nameroot": "whale",
+                "nameext": ".txt",
+            }
+        ],
+    }
+    assert json.loads(stream.getvalue()) == goal
+
+
+def test_input_deps_secondary_files() -> None:
+    """Affirm that secondaryFiles are also represented."""
+    stream = StringIO()
+
+    data_path = get_data("tests/wf/whale.txt")
+    main(
+        [
+            "--print-input-deps",
+            get_data("tests/input_deps/docker-array-secondaryfiles.cwl"),
+            get_data("tests/input_deps/docker-array-secondaryfiles-job.json"),
+        ],
+        stdout=stream,
+    )
+
+    goal = {
+        "class": "File",
+        "location": "docker-array-secondaryfiles-job.json",
+        "format": CWL_IANA,
+        "secondaryFiles": [
+            {
+                "class": "File",
+                "location": "ref.fasta",
+                "basename": "ref.fasta",
+                "secondaryFiles": [
+                    {
+                        "class": "File",
+                        "location": "ref.fasta.fai",
+                        "basename": "ref.fasta.fai",
+                        "nameroot": "ref.fasta",
+                        "nameext": ".fai",
+                    }
+                ],
+                "nameroot": "ref",
+                "nameext": ".fasta",
+            },
+            {
+                "class": "File",
+                "location": "ref2.fasta",
+                "basename": "ref2.fasta",
+                "secondaryFiles": [
+                    {
+                        "class": "File",
+                        "location": "ref2.fasta.fai",
+                        "basename": "ref2.fasta.fai",
+                        "nameroot": "ref2.fasta",
+                        "nameext": ".fai",
+                    }
+                ],
+                "nameroot": "ref2",
+                "nameext": ".fasta",
+            },
+        ],
+    }
+
+    assert json.loads(stream.getvalue()) == goal