Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument not checked prior to execution #33

Closed
unode opened this issue Aug 7, 2017 · 1 comment
Closed

Argument not checked prior to execution #33

unode opened this issue Aug 7, 2017 · 1 comment

Comments

@unode
Copy link
Member

unode commented Aug 7, 2017

According to the FAQ ngless is supposed to check all input files prior to execution.

In the case below it doesn't check if the fafile or the folder containing it exists before executing.
Instead it executes up to that point and then fails when it can't create indexes.

ngless "0.0"
import "parallel" version "0.0"
import "samtools" version "0.0"
import "mocat" version "0.0"

TMPDIR = ARGV[2]
DB = TMPDIR + '/db.fna'
DATADIR = 'data/'

sample = ARGV[1]
input = load_mocat_sample(DATADIR + sample)

preprocess(input, keep_singles=True) using |read|:
    read = substrim(read, min_quality=25)
    if len(read) < 45:
        discard

hits = map(input, fafile=DB)

write(hits, ofile='outputs/' + sample + '_db.bam')

Called with ngless --trace map.ngl sample /tmp/non_existing_dir

@luispedro
Copy link
Member

Thanks. This may not be specific to fafile, but the logic may not detect that it can check the existence of the file earlier as it is not a literal, but specified through a variable (a constant in this case, which may or may not be the relevant issue).

luispedro added a commit that referenced this issue Feb 22, 2019
A collection of several bugfixes and performance improvements over the
last few months.

Full ChangeLog:

    * Switch to diagrams package for plotting
    * Update minimap2 version to 2.14
    * Module samtools (version 0.1) now includes samtools_view
    * Update to LTS-13 (GHC 8.6)
    * Fix bug with orf_find & prots_out argument
    * Call bwa/minimap2 with interleaved fastq files
    * Add --verbose flag to check-install mode
    * Avoid leaving open file descriptors after FastQ encoding detection
    * Fix bug in garbage collection
    * Compress intermediate SAM files (#22)
    * Tar extraction uses much less memory (#77)
    * Add early checks for input files in more situations (#33)
    * Support compression in collect() output (#42)
    * Fix CIGAR (#92) for select() blocks
luispedro added a commit that referenced this issue Mar 15, 2019
A collection of several bugfixes and performance improvements over the
last few months.

Full ChangeLog:

    * Switch to diagrams package for plotting
    * Update minimap2 version to 2.14
    * Module samtools (version 0.1) now includes samtools_view
    * Fix bug with orf_find & prots_out argument
    * Call bwa/minimap2 with interleaved fastq files
    * Add --verbose flag to check-install mode
    * Avoid leaving open file descriptors after FastQ encoding detection
    * Fix bug in garbage collection
    * Compress intermediate SAM files (#22)
    * Tar extraction uses much less memory (#77)
    * Add early checks for input files in more situations (#33)
    * Support compression in collect() output (#42)
    * Fix CIGAR (#92) for select() blocks
    * Update to LTS-13 (GHC 8.6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants