[Swift-user] Management of undeclared files

Michael Wilde wilde at anl.gov
Wed Jun 10 15:07:34 CDT 2015


Dear Aurélien,

Your files were likely created in the task "sandbox" directory that 
Swift creates for each app invocation.
This directory is below the workdirectory for the execution site 
(probably your local machine unless you configured Swift to run on other 
sites).

The basic language model is that for each app you declare what files go 
into the app run, and which are returned (as files, not strings).

There are many ways to do this:
- declare the nin, nhr, and nsq files as outputs of your app (which you 
say below you'd rather avoid)
- declare a struct of 3 variables (for this we need to see if an 
existing mapper would work, else you'd need to use a mapper script)
- let swift name the output files for you (but then you have to tell 
MAKEBLASTDB what to name its files).

The first approach is simplest (see example below) and quite easy once 
you get used to this model of scripting.

I suspect we can suggest a more compact way with a bit more thinking.

- Mike

untested example:

app (file log_file, file nin, file nhr, file nsq) FormatLibrary (file 
fasta_file, string library_name) {
     MAKEBLASTDB ...;
}

file input_fasta <"test_blast.fasta">;
file log_file <"test_blast.makeblastdb.log">;
string library_name = strcut(filename(input_fasta), "^(.*?)\\.fa(sta)?");

file nin<single_file_mapper; file=strcat(library_name,".nin");
file nhr<single_file_mapper; file=strcat(library_name,".nhr");
file nhq<single_file_mapper; file=strcat(library_name,".nhq");

(log_file, ini, nhr, nhq) = FormatLibrary(input_fasta, library_name);


On 6/10/15 2:36 PM, Aurélien Mazurie wrote:
>
> My question is: where are these files? Since makeblastdb ran without
> issue, they probably have been created somewhere (and I confirm that
> they are created when I run the exact same  command on the terminal).
> Are they automatically deleted by Swift since they are not explicitly
> named by another variable?
>
> I'm guessing that the answer is yes; if that the case, is there a way
> to have variables storing file names that are only known at execution
> time? For example, I would like my 'FormatLibrary' function to return
> among else the name of these three files, rather than having to bind
> these file names to variables before the execution of this function.
> Is that even doable?

-- 
Michael Wilde
Mathematics and Computer Science          Computation Institute
Argonne National Laboratory               The University of Chicago




More information about the Swift-user mailing list