common-workflow-language / common-workflow-language/cwltool

Glob pattern error

Open
#959 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

I have a CWL script to run a python script. The command line tool version of CWL.

## Expected Behavior
I wanted all the output file saved in ladder_out directory, where ladder_out directory is non-existing.

## Actual Behavior
lad.cwl:77:4: Did not find output file with glob pattern: '['./ladder_out/lad/genes_graph_conf3.merge_graphs.pickle']'

## Workflow Code
```
cwlVersion: v1.0
class: CommandLineTool
doc: Spladder

baseCommand: [python, ladder.py]

requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- entry: "$({class: 'Directory', listing: []})"
entryname: $(inputs.ladder_outDir)
writable: true

inputs:
spladder_gtf:
type: File
inputBinding:
position: 1
prefix: -a
spladder_bams:
type: File[]
inputBinding:
position: 2
prefix: -b
itemSeparator: ","
secondaryFiles: .bai
ladder_outDir:
type: string
inputBinding:
position: 3
prefix: -o
spladder_phase2:
type: string
inputBinding:
position: 4
prefix: -T
spladder_confidence:
type: int
inputBinding:
position: 4
prefix: -c
spladder_merge_graphs:
type: string
inputBinding:
position: 5
prefix: -M
spladder_alt:
type: string
inputBinding:
position: 7
prefix: -t
spladder_RL:
type: int
inputBinding:
position: 8
prefix: -n
spladder_primary_alignment:
type: string
inputBinding:
position: 9
prefix: -P

outputs:
spladder_out_dir1:
type: Directory
outputBinding:
glob: $(inputs.ladder_outDir)/lad
spladder_out_dir2:
type: Directory
outputBinding:
glob: $(inputs.ladder_outDir)
spladderFile:
type: File
outputBinding:
glob: $(inputs.ladder_outDir)/lad/genes_graph_conf3.merge_graphs.pickle

```
The YML file looks like
```
spladder_gtf:
class: File
path: /ur/home/gencode.v19.annotation.hs37d5_chr.spladder.gtf
spladder_outDir: ladder_out
spladder_bams: [
{class: File, path: /cluster/work/sampleA.bam},
{class: File, path: /cluster/work/sampleB.bam}
]
spladder_confidence: 2
spladder_merge_graphs: merge_graphs
spladder_alt: alt_3prime
spladder_RL: 100
spladder_phase2: y
spladder_primary_alignment: y
```
## Full Traceback
```Traceback (most recent call last):
File "/cluster/home/usr/ladder/python/ladder.py", line 325, in
spladder()
File "/cluster/home/usr/ladder/python/ladder.py", line 226, in spladder
spladder_core(CFG)
File "/cluster/home/usr/ladder/python/modules/core/laddercore.py", line 21, in spladder_core
genes = gen_graphs(genes, CFG)
File "/cluster/home/user/ladder/python/modules/core/gen_graphs.py", line 104, in gen_graphs
genes, inserted_ = insert_cassette_exons(genes, CFG)
File "/cluster/home/usr/ladder/python/modules/editgraph.py", line 875, in insert_cassette_exons
tracks = add_reads_from_bam(sp.array([gg], dtype='object'), CFG['bam_fnames'], ['exon_track'], CFG['read_filter'], CFG['var_aware'], CFG['primary_only'], CFG['ignore_mismatch_tag'])
File "/cluster/home/usr/ladder/python/modules/reads.py", line 164, in add_reads_from_bam
(introns_p, introns_m, coverage) = get_all_data(blocks[b], filenames, filter=filter, var_aware=var_aware, primary_only=primary_only, no_mm=no_mm)
File "/cluster/home/usr/ladder/python/modules/reads.py", line 342, in get_all_data
(coverage_tmp, introns_p_tmp, introns_m_tmp) = get_reads(fname, contig_name, block.start, block.stop, strand, filter, mapped, spliced, var_aware, collapse, primary_only, no_mm)
File "/cluster/home/usr/ladder/python/modules/reads.py", line 18, in get_reads
infile = pysam.Samfile(fname, 'rb')
File "pysam/libcalignmentfile.pyx", line 734, in pysam.libcalignmentfile.AlignmentFile.__cinit__
File "pysam/libcalignmentfile.pyx", line 933, in pysam.libcalignmentfile.AlignmentFile._open
IOError: [Errno 116] could not open alignment file `/tmp/tmpm4QOot/stg0cb1472e-7aa6-4c0e-a138-32cae5c48167/sampleA.sortedByCoord.out.bam`: Stale file handle
[job spladder.cwl] Job error:
Error collecting output for parameter 'spladderFile':
ladder.cwl:77:4: Did not find output file with glob pattern: '['./ladder_out/ladder/genes_graph_conf3.merge_graphs.pickle']'
[job ladder.cwl] completed permanentFail
{}
Final process status is permanentFail

```

## Your Environment
* cwltool version:
cwlVersion: v1.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.