v0.11.0
Introduces file_glob
to group files by a pattern (#68).
Using Globs
Often times logic is needed to move groups of files together based on a shared
pattern. For instance, you may wish to return all files that end with a
fastq.gz
extension after a
trimming task has been run.
To do this in the SDK, you can leverage the file_glob
function to construct
lists of LachFile
s defined by a pattern.
The class of allowed patterns are defined as globs. It is likely you've
already used globs in the terminal by using wildcard characters in common
commands, eg. ls *.txt
.
The second argument must be a valid latch URL pointing to a directory. This will
be the remote location of returned LatchFile
constructed with this utility.
In this example, all files ending with .fastq.gz
in the working directory of
the task will be returned to the latch:///fastqc_outputs
directory:
@small_task
def task():
...
return file_glob("*.fastq.gz", "latch:///fastqc_outputs")