You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a technical reason why Usage.init_artifact doesn't accept kwargs that can be passed through to the factory function?
If not that would be convenient to enable, to support factory functions like the following:
defdna_artifact_factory(sequence_id: str, sequence: str):
seq=skbio.DNA(sequence, metadata={id: sequence_id})
withtempfile.NamedTemporaryFile() asf:
# write our skbio.DNA object to file in fasta format (the default)seq.write(f)
# reset to the beginning of the filef.seek(0)
# instantiate our format object with the fastaff=SingleRecordDNAFASTAFormat(f.name, mode='r')
# return the sequence packaged in a "SingleDNASequence" qiime2.Artifactreturnqiime2.Artifact.import_data("SingleDNASequence", ff)
defnw_align_example_1(use):
seq1=use.init_artifact('seq1', dna_artifact_factory, "seq1", "ACGGTTAA")
seq2=use.init_artifact('seq2', dna_artifact_factory, "seq2", "ATTGTAA")
...
I planned to do this while working on usage example content for Developing with QIIME 2, but remembered that I need to define a factory function per input as it stands right now.
The text was updated successfully, but these errors were encountered:
Is there a technical reason why
Usage.init_artifact
doesn't accept kwargs that can be passed through to the factory function?If not that would be convenient to enable, to support factory functions like the following:
I planned to do this while working on usage example content for Developing with QIIME 2, but remembered that I need to define a factory function per input as it stands right now.
The text was updated successfully, but these errors were encountered: