@large_task
def bactopia_task(
fastq_one: Optional[LatchFile],
fastq_two: Optional[LatchFile],
input_dir: Optional[LatchDir],
output_dir: LatchDir,
sample_name: List[Union[str, int]],
genome_size: Optional[int],
species: Optional[Species],
species_genome_size: Optional[SpeciesGenomeSize],
ask_merlin: bool = False,
coverage: int = 100,
hybrid: bool = False,
skip_logs: bool = False,
skip_fastq_check: bool = False,
skip_qc: bool = False,
skip_error_correction: bool = False,
no_miniasm: bool = False,
skip_pseudogene_correction: bool = False,
skip_adj_correction: bool = False,
skip_prodigal_tf: bool = False,
rawproduct: bool = False,
centre: str = "Bactopia",
min_contig_length: int = 500,
amr_plus: bool = False,
) -> LatchDir:
# example opening a LatchFile
with open(Path(fastq_one), "w") as f:
lines = f.readlines()
# ... Logic Here ...
local_output_dir = Path("/root/outputs")
# example returning Flyte directory
return LatchDir(
str(local_output_dir.resolve()),
remote_directory=_fmt_dir(output_dir.remote_source),
)
@workflow
def bactopia_wf(
output_dir: LatchDir,
sample_name: List[Union[str, int]] = "sample1",
fastq_one: Optional[LatchFile] = None,
fastq_two: Optional[LatchFile] = None,
input_dir: Optional[LatchDir] = None,
genome_size: Optional[int] = None,
species: Species = Species.none,
species_genome_size: SpeciesGenomeSize = SpeciesGenomeSize.mash,
ask_merlin: bool = False,
coverage: int = 100,
hybrid: bool = False,
skip_logs: bool = False,
skip_fastq_check: bool = False,
skip_qc: bool = False,
skip_error_correction: bool = False,
no_miniasm: bool = False,
skip_pseudogene_correction: bool = False,
skip_adj_correction: bool = False,
skip_prodigal_tf: bool = False,
rawproduct: bool = False,
amr_plus: bool = False,
centre: str = "Bactopia",
min_contig_length: int = 500,
) -> LatchDir:
return bactopia_task(
fastq_one=fastq_one,
fastq_two=fastq_two,
input_dir=input_dir,
output_dir=output_dir,
sample_name=sample_name,
genome_size=genome_size,
species=species,
species_genome_size=species_genome_size,
ask_merlin=ask_merlin,
coverage=coverage,
hybrid=hybrid,
skip_logs=skip_logs,
skip_fastq_check=skip_fastq_check,
skip_qc=skip_qc,
skip_error_correction=skip_error_correction,
no_miniasm=no_miniasm,
skip_pseudogene_correction=skip_pseudogene_correction,
skip_adj_correction=skip_adj_correction,
skip_prodigal_tf=skip_prodigal_tf,
rawproduct=rawproduct,
centre=centre,
min_contig_length=min_contig_length,
amr_plus=amr_plus,
)