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

add artifact class annotations #285

Merged
merged 7 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion q2_types/bowtie2/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
Bowtie2Index = SemanticType('Bowtie2Index')

plugin.register_semantic_types(Bowtie2Index)
plugin.register_semantic_type_to_format(Bowtie2Index, Bowtie2IndexDirFmt)
plugin.register_artifact_class(Bowtie2Index, Bowtie2IndexDirFmt)
5 changes: 3 additions & 2 deletions q2_types/distance_matrix/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
DistanceMatrix = SemanticType('DistanceMatrix')

plugin.register_semantic_types(DistanceMatrix)
plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
DistanceMatrix,
directory_format=DistanceMatrixDirectoryFormat
directory_format=DistanceMatrixDirectoryFormat,
description="A symmetric matrix representing distances between entities."
)
66 changes: 47 additions & 19 deletions q2_types/feature_data/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,35 +57,63 @@
BLAST6)


plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
FeatureData[Taxonomy],
directory_format=TSVTaxonomyDirectoryFormat)
plugin.register_semantic_type_to_format(
directory_format=TSVTaxonomyDirectoryFormat,
description=("Hierarchical metadata or annotations associated with a set "
"of features. This can contain one or more hierarchical "
"levels, and annotations can be anything (e.g., taxonomy of "
"organisms, functional categorization of gene families, ...) "
"as long as it is strictly hierarchical."))
plugin.register_artifact_class(
FeatureData[Sequence],
directory_format=DNASequencesDirectoryFormat)
plugin.register_semantic_type_to_format(
directory_format=DNASequencesDirectoryFormat,
description=("Unaligned DNA sequences associated with a set of feature "
"identifiers (e.g., ASV sequences or OTU representative "
"sequence). Exactly one sequence is associated with each "
"feature identfiier."))
plugin.register_artifact_class(
FeatureData[RNASequence],
directory_format=RNASequencesDirectoryFormat)
plugin.register_semantic_type_to_format(
directory_format=RNASequencesDirectoryFormat,
description=("Unaligned RNA sequences associated with a set of feature "
"identifiers. Exactly one sequence is associated with each "
"feature identfiier."))
plugin.register_artifact_class(
FeatureData[PairedEndSequence],
directory_format=PairedDNASequencesDirectoryFormat)
plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
FeatureData[PairedEndRNASequence],
directory_format=PairedRNASequencesDirectoryFormat)
plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
FeatureData[AlignedSequence],
directory_format=AlignedDNASequencesDirectoryFormat)
plugin.register_semantic_type_to_format(
directory_format=AlignedDNASequencesDirectoryFormat,
description=("Aligned DNA sequences associated with a set of feature "
"identifiers (e.g., aligned ASV sequences or OTU "
"representative sequence). Exactly one sequence is "
"associated with each feature identfiier."))
plugin.register_artifact_class(
FeatureData[AlignedRNASequence],
directory_format=AlignedRNASequencesDirectoryFormat)
plugin.register_semantic_type_to_format(
directory_format=AlignedRNASequencesDirectoryFormat,
description=("Aligned RNA sequences associated with a set of feature "
"identifiers. Exactly one sequence is associated with each "
"feature identfiier."))
plugin.register_artifact_class(
FeatureData[Differential], DifferentialDirectoryFormat)
plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
FeatureData[ProteinSequence],
directory_format=ProteinSequencesDirectoryFormat)
plugin.register_semantic_type_to_format(
directory_format=ProteinSequencesDirectoryFormat,
description=("Unaligned protein sequences associated with a set of "
"feature identifiers. Exactly one sequence is associated "
"with each feature identfiier."))
plugin.register_artifact_class(
FeatureData[AlignedProteinSequence],
directory_format=AlignedProteinSequencesDirectoryFormat)
plugin.register_semantic_type_to_format(
directory_format=AlignedProteinSequencesDirectoryFormat,
description=("Aligned protein sequences associated with a set of "
"feature identifiers. Exactly one sequence is associated "
"with each feature identfiier."))
# FeatureData[BLAST6] seems to fix file type with semantic type.
plugin.register_artifact_class(
FeatureData[BLAST6],
directory_format=BLAST6DirectoryFormat)
directory_format=BLAST6DirectoryFormat,
description=("BLAST results associated with a set of feature "
"identifiers."))
49 changes: 45 additions & 4 deletions q2_types/feature_table/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,50 @@
PresenceAbsence, Balance, Composition,
PercentileNormalized, Design)

plugin.register_semantic_type_to_format(
FeatureTable[Frequency | RelativeFrequency |
PresenceAbsence | Balance | Composition |
PercentileNormalized | Design],
plugin.register_artifact_class(
FeatureTable[Frequency],
directory_format=BIOMV210DirFmt,
description=("A feature table (e.g., samples by ASVs) where each value "
"in the matrix is a whole number greater than or equal to "
"0 representing the frequency or count of a feature in "
"the corresponding sample. These data should be raw "
"(not normalized) counts.")
)
plugin.register_artifact_class(
FeatureTable[RelativeFrequency],
directory_format=BIOMV210DirFmt,
description=("A feature table (e.g., samples by ASVs) where each value "
"in the matrix is a real number greater than or equal to "
"0.0 and less than or equal to 1.0 representing the "
"proportion of the sample that is composed of that feature. "
"The feature values for each sample should sum to 1.0.")
)
plugin.register_artifact_class(
FeatureTable[PresenceAbsence],
directory_format=BIOMV210DirFmt,
description=("A feature table (e.g., samples by ASVs) where each value "
"indicates is a boolean indication of whether the feature "
"is observed in the sample or not.")
)
plugin.register_artifact_class(
FeatureTable[Balance],
directory_format=BIOMV210DirFmt
)
plugin.register_artifact_class(
FeatureTable[Composition],
directory_format=BIOMV210DirFmt,
description=("A feature table (e.g., samples by ASVs) where each value "
"in the matrix is a whole number greater than "
"0 representing the frequency or count of a feature in "
"the corresponding sample. These data are typically not "
"raw counts, having been transformed in some way to exclude "
"zero counts.")
)
plugin.register_artifact_class(
FeatureTable[PercentileNormalized],
directory_format=BIOMV210DirFmt
)
plugin.register_artifact_class(
FeatureTable[Design],
directory_format=BIOMV210DirFmt
)
14 changes: 11 additions & 3 deletions q2_types/multiplexed_sequences/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@
plugin.register_semantic_types(MultiplexedSingleEndBarcodeInSequence,
MultiplexedPairedEndBarcodeInSequence)

plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
MultiplexedSingleEndBarcodeInSequence,
directory_format=MultiplexedSingleEndBarcodeInSequenceDirFmt
directory_format=MultiplexedSingleEndBarcodeInSequenceDirFmt,
description=("Multiplexed sequences (i.e., representing multiple "
"difference samples), which are single-end reads, and which "
"contain the barcode (i.e., index) indicating the source "
"sample as part of the sequence read.")
)
plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
MultiplexedPairedEndBarcodeInSequence,
directory_format=MultiplexedPairedEndBarcodeInSequenceDirFmt,
description=("Multiplexed sequences (i.e., representing multiple "
"difference samples), which are paired-end reads, and which "
"contain the barcode (i.e., index) indicating the source "
"sample as part of the sequence read.")
)
11 changes: 6 additions & 5 deletions q2_types/ordination/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
ProcrustesStatistics = SemanticType('ProcrustesStatistics')

plugin.register_semantic_types(PCoAResults, ProcrustesStatistics)
plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
PCoAResults,
directory_format=OrdinationDirectoryFormat
directory_format=OrdinationDirectoryFormat,
description="The results of running principal coordinate analysis (PCoA)."
)

plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
ProcrustesStatistics,

directory_format=ProcrustesStatisticsDirFmt
directory_format=ProcrustesStatisticsDirFmt,
description="The results of running Procrustes analysis."
)
6 changes: 4 additions & 2 deletions q2_types/sample_data/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

plugin.register_semantic_types(SampleData, AlphaDiversity)

plugin.register_semantic_type_to_format(
plugin.register_artifact_class(
SampleData[AlphaDiversity],
directory_format=AlphaDiversityDirectoryFormat
directory_format=AlphaDiversityDirectoryFormat,
description=("Alpha diversity values, each associated with a single "
"sample identifier.")
)
4 changes: 2 additions & 2 deletions q2_types/tree/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ def factory():
"A phylogenetic tree containing a defined root.",
examples={'Import rooted phylogenetic tree': phylogeny_rooted_usage})

plugin.register_semantic_type_to_format(Hierarchy,
directory_format=NewickDirectoryFormat)
plugin.register_artifact_class(Hierarchy,
directory_format=NewickDirectoryFormat)