From 321d8d3df05d48b324a138d550031c2663396e9d Mon Sep 17 00:00:00 2001 From: Robert Aboukhalil Date: Tue, 30 Jan 2024 10:30:45 -0800 Subject: [PATCH] [CZID-9255] [CZID-9221] Schema updates (#163) * Checkpoint * Checkpoint * Cleanup * Add bulk download types * Run codegen * Fix test * Delete unused files * Undo coverage viz changes * Add "2dArrayInt" type and update codegen to support it * Checkpoint * Update codegen to support 1:1 relationships * Small fix * Fix tests * Fix lint * Demo 1:1 relationships * Fix factory codegen * We need an accession_name column, so add it in this PR * Add accession_name column --------- Co-authored-by: Jessica Gadling --- entities/api/mutations.py | 21 +- entities/api/queries.py | 22 +- entities/api/schema.graphql | 497 +- entities/api/schema.json | 5083 ++++++++++------- entities/api/types/bulk_download.py | 384 ++ entities/api/types/consensus_genome.py | 47 +- entities/api/types/contig.py | 3 + entities/api/types/genomic_range.py | 5 +- ...ce_alignment_index.py => host_organism.py} | 182 +- entities/api/types/metadatum.py | 3 + entities/api/types/metric_consensus_genome.py | 75 +- entities/api/types/phylogenetic_tree.py | 3 + entities/api/types/reference_genome.py | 78 +- entities/api/types/sample.py | 14 +- entities/api/types/sequencing_read.py | 17 +- entities/api/types/taxon.py | 3 + entities/api/types/upstream_database.py | 3 + ...lignment_index.yaml => bulk_download.yaml} | 2 +- entities/cerbos/policies/host_organism.yaml | 22 + entities/cli/gql_schema.py | 858 +-- .../20240129_115001_schema_updates.py | 149 + entities/database/models/__init__.py | 3 +- entities/database/models/bulk_download.py | 30 + entities/database/models/consensus_genome.py | 6 +- entities/database/models/genomic_range.py | 2 +- entities/database/models/host_organism.py | 32 + .../models/metric_consensus_genome.py | 10 +- entities/database/models/reference_genome.py | 13 +- entities/database/models/sample.py | 5 +- .../models/sequence_alignment_index.py | 39 - entities/database/models/sequencing_read.py | 4 +- entities/schema/README.md | 78 +- entities/schema/platformics.yaml | 129 +- entities/support/enums.py | 13 +- .../test_infra/factories/bulk_download.py | 37 + ...ce_alignment_index.py => host_organism.py} | 26 +- .../factories/metric_consensus_genome.py | 15 +- .../test_infra/factories/reference_genome.py | 9 +- entities/test_infra/factories/sample.py | 1 + .../test_infra/factories/sequencing_read.py | 2 +- platformics/codegen/lib/linkml_wrappers.py | 7 +- .../templates/api/types/class_name.py.j2 | 11 +- .../database/models/class_name.py.j2 | 10 +- .../test_infra/factories/class_name.py.j2 | 6 +- .../codegen/tests/test_basic_queries.py | 9 +- .../codegen/tests/test_error_handling.py | 1 + .../codegen/tests/test_file_queries.py | 6 +- .../tests/test_schemas/platformics.yaml | 13 +- platformics/database/models/base.py | 14 +- 49 files changed, 4763 insertions(+), 3239 deletions(-) create mode 100644 entities/api/types/bulk_download.py rename entities/api/types/{sequence_alignment_index.py => host_organism.py} (61%) rename entities/cerbos/policies/{sequence_alignment_index.yaml => bulk_download.yaml} (94%) create mode 100644 entities/cerbos/policies/host_organism.yaml create mode 100644 entities/database/migrations/versions/20240129_115001_schema_updates.py create mode 100644 entities/database/models/bulk_download.py create mode 100644 entities/database/models/host_organism.py delete mode 100644 entities/database/models/sequence_alignment_index.py create mode 100644 entities/test_infra/factories/bulk_download.py rename entities/test_infra/factories/{sequence_alignment_index.py => host_organism.py} (58%) diff --git a/entities/api/mutations.py b/entities/api/mutations.py index c8420b6a..ca2428d8 100644 --- a/entities/api/mutations.py +++ b/entities/api/mutations.py @@ -30,12 +30,7 @@ update_reference_genome, delete_reference_genome, ) -from api.types.sequence_alignment_index import ( - SequenceAlignmentIndex, - create_sequence_alignment_index, - update_sequence_alignment_index, - delete_sequence_alignment_index, -) +from api.types.host_organism import HostOrganism, create_host_organism, update_host_organism, delete_host_organism from api.types.metadatum import Metadatum, create_metadatum, update_metadatum, delete_metadatum from api.types.consensus_genome import ( ConsensusGenome, @@ -63,6 +58,7 @@ update_phylogenetic_tree, delete_phylogenetic_tree, ) +from api.types.bulk_download import BulkDownload, create_bulk_download, update_bulk_download, delete_bulk_download @strawberry.type @@ -93,10 +89,10 @@ class Mutation: update_reference_genome: Sequence[ReferenceGenome] = update_reference_genome delete_reference_genome: Sequence[ReferenceGenome] = delete_reference_genome - # SequenceAlignmentIndex mutations - create_sequence_alignment_index: SequenceAlignmentIndex = create_sequence_alignment_index - update_sequence_alignment_index: Sequence[SequenceAlignmentIndex] = update_sequence_alignment_index - delete_sequence_alignment_index: Sequence[SequenceAlignmentIndex] = delete_sequence_alignment_index + # HostOrganism mutations + create_host_organism: HostOrganism = create_host_organism + update_host_organism: Sequence[HostOrganism] = update_host_organism + delete_host_organism: Sequence[HostOrganism] = delete_host_organism # Metadatum mutations create_metadatum: Metadatum = create_metadatum @@ -132,3 +128,8 @@ class Mutation: create_phylogenetic_tree: PhylogeneticTree = create_phylogenetic_tree update_phylogenetic_tree: Sequence[PhylogeneticTree] = update_phylogenetic_tree delete_phylogenetic_tree: Sequence[PhylogeneticTree] = delete_phylogenetic_tree + + # BulkDownload mutations + create_bulk_download: BulkDownload = create_bulk_download + update_bulk_download: Sequence[BulkDownload] = update_bulk_download + delete_bulk_download: Sequence[BulkDownload] = delete_bulk_download diff --git a/entities/api/queries.py b/entities/api/queries.py index 45fc2952..65226ba9 100644 --- a/entities/api/queries.py +++ b/entities/api/queries.py @@ -28,11 +28,11 @@ ReferenceGenomeAggregate, resolve_reference_genomes_aggregate, ) -from api.types.sequence_alignment_index import ( - SequenceAlignmentIndex, - resolve_sequence_alignment_indices, - SequenceAlignmentIndexAggregate, - resolve_sequence_alignment_indices_aggregate, +from api.types.host_organism import ( + HostOrganism, + resolve_host_organisms, + HostOrganismAggregate, + resolve_host_organisms_aggregate, ) from api.types.metadatum import Metadatum, resolve_metadatas, MetadatumAggregate, resolve_metadatas_aggregate from api.types.consensus_genome import ( @@ -61,6 +61,12 @@ PhylogeneticTreeAggregate, resolve_phylogenetic_trees_aggregate, ) +from api.types.bulk_download import ( + BulkDownload, + resolve_bulk_downloads, + BulkDownloadAggregate, + resolve_bulk_downloads_aggregate, +) @strawberry.type @@ -76,7 +82,7 @@ class Query: sequencing_reads: Sequence[SequencingRead] = resolve_sequencing_reads genomic_ranges: Sequence[GenomicRange] = resolve_genomic_ranges reference_genomes: Sequence[ReferenceGenome] = resolve_reference_genomes - sequence_alignment_indices: Sequence[SequenceAlignmentIndex] = resolve_sequence_alignment_indices + host_organisms: Sequence[HostOrganism] = resolve_host_organisms metadatas: Sequence[Metadatum] = resolve_metadatas consensus_genomes: Sequence[ConsensusGenome] = resolve_consensus_genomes metrics_consensus_genomes: Sequence[MetricConsensusGenome] = resolve_metrics_consensus_genomes @@ -84,13 +90,14 @@ class Query: upstream_databases: Sequence[UpstreamDatabase] = resolve_upstream_databases contigs: Sequence[Contig] = resolve_contigs phylogenetic_trees: Sequence[PhylogeneticTree] = resolve_phylogenetic_trees + bulk_downloads: Sequence[BulkDownload] = resolve_bulk_downloads # Query entity aggregates samples_aggregate: SampleAggregate = resolve_samples_aggregate sequencing_reads_aggregate: SequencingReadAggregate = resolve_sequencing_reads_aggregate genomic_ranges_aggregate: GenomicRangeAggregate = resolve_genomic_ranges_aggregate reference_genomes_aggregate: ReferenceGenomeAggregate = resolve_reference_genomes_aggregate - sequence_alignment_indices_aggregate: SequenceAlignmentIndexAggregate = resolve_sequence_alignment_indices_aggregate + host_organisms_aggregate: HostOrganismAggregate = resolve_host_organisms_aggregate metadatas_aggregate: MetadatumAggregate = resolve_metadatas_aggregate consensus_genomes_aggregate: ConsensusGenomeAggregate = resolve_consensus_genomes_aggregate metrics_consensus_genomes_aggregate: MetricConsensusGenomeAggregate = resolve_metrics_consensus_genomes_aggregate @@ -98,3 +105,4 @@ class Query: upstream_databases_aggregate: UpstreamDatabaseAggregate = resolve_upstream_databases_aggregate contigs_aggregate: ContigAggregate = resolve_contigs_aggregate phylogenetic_trees_aggregate: PhylogeneticTreeAggregate = resolve_phylogenetic_trees_aggregate + bulk_downloads_aggregate: BulkDownloadAggregate = resolve_bulk_downloads_aggregate diff --git a/entities/api/schema.graphql b/entities/api/schema.graphql index 50adc770..88f2db1b 100644 --- a/entities/api/schema.graphql +++ b/entities/api/schema.graphql @@ -1,21 +1,3 @@ -enum AlignmentTool { - bowtie2 - minimap2 - czid_index_generation -} - -input AlignmentToolEnumComparators { - _eq: AlignmentTool - _neq: AlignmentTool - _in: [AlignmentTool!] - _nin: [AlignmentTool!] - _gt: AlignmentTool - _gte: AlignmentTool - _lt: AlignmentTool - _lte: AlignmentTool - _is_null: AlignmentTool -} - input BoolComparators { _eq: Int _neq: Int @@ -28,6 +10,98 @@ input BoolComparators { _is_null: Int } +type BulkDownload implements EntityInterface & Node { + """The Globally Unique ID of this object""" + _id: GlobalID! + id: ID! + producingRunId: Int + ownerUserId: Int! + collectionId: Int! + downloadType: BulkDownloadType! + fileId: ID + file(where: FileWhereClause = null): File +} + +type BulkDownloadAggregate { + aggregate: BulkDownloadAggregateFunctions +} + +type BulkDownloadAggregateFunctions { + sum: BulkDownloadNumericalColumns + avg: BulkDownloadNumericalColumns + min: BulkDownloadMinMaxColumns + max: BulkDownloadMinMaxColumns + stddev: BulkDownloadNumericalColumns + variance: BulkDownloadNumericalColumns + count(distinct: Boolean = false, columns: BulkDownloadCountColumns = null): Int +} + +enum BulkDownloadCountColumns { + download_type + file + entity_id + id + producing_run_id + owner_user_id + collection_id + created_at + updated_at + deleted_at +} + +input BulkDownloadCreateInput { + collectionId: Int! + downloadType: BulkDownloadType! + fileId: ID = null +} + +type BulkDownloadMinMaxColumns { + producingRunId: Int + ownerUserId: Int + collectionId: Int +} + +type BulkDownloadNumericalColumns { + producingRunId: Int + ownerUserId: Int + collectionId: Int +} + +enum BulkDownloadType { + concatenate + zip +} + +input BulkDownloadTypeEnumComparators { + _eq: BulkDownloadType + _neq: BulkDownloadType + _in: [BulkDownloadType!] + _nin: [BulkDownloadType!] + _gt: BulkDownloadType + _gte: BulkDownloadType + _lt: BulkDownloadType + _lte: BulkDownloadType + _is_null: BulkDownloadType +} + +input BulkDownloadUpdateInput { + collectionId: Int = null + downloadType: BulkDownloadType = null + fileId: ID = null +} + +input BulkDownloadWhereClause { + id: UUIDComparators + producingRunId: IntComparators + ownerUserId: IntComparators + collectionId: IntComparators + downloadType: BulkDownloadTypeEnumComparators +} + +input BulkDownloadWhereClauseMutations { + id: UUIDComparators +} + type ConsensusGenome implements EntityInterface & Node { """The Globally Unique ID of this object""" _id: GlobalID! @@ -40,24 +114,9 @@ type ConsensusGenome implements EntityInterface & Node { referenceGenome(where: ReferenceGenomeWhereClause = null): ReferenceGenome sequenceId: ID sequence(where: FileWhereClause = null): File + metrics(where: MetricConsensusGenomeWhereClause = null): MetricConsensusGenome intermediateOutputsId: ID intermediateOutputs(where: FileWhereClause = null): File - metrics( - where: MetricConsensusGenomeWhereClause = null - - """Returns the items in the list that come before the specified cursor.""" - before: String = null - - """Returns the items in the list that come after the specified cursor.""" - after: String = null - - """Returns the first n items from the list.""" - first: Int = null - - """Returns the items in the list that come after the specified cursor.""" - last: Int = null - ): MetricConsensusGenomeConnection! - metricsAggregate(where: MetricConsensusGenomeWhereClause = null): MetricConsensusGenomeAggregate } type ConsensusGenomeAggregate { @@ -88,13 +147,16 @@ enum ConsensusGenomeCountColumns { sequence_read reference_genome sequence - intermediate_outputs metrics + intermediate_outputs entity_id id producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input ConsensusGenomeCreateInput { @@ -103,6 +165,7 @@ input ConsensusGenomeCreateInput { sequenceReadId: ID! referenceGenomeId: ID! sequenceId: ID = null + metricsId: ID = null intermediateOutputsId: ID = null } @@ -133,6 +196,7 @@ input ConsensusGenomeUpdateInput { sequenceReadId: ID = null referenceGenomeId: ID = null sequenceId: ID = null + metricsId: ID = null intermediateOutputsId: ID = null } @@ -193,6 +257,9 @@ enum ContigCountColumns { producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input ContigCreateInput { @@ -416,11 +483,14 @@ enum GenomicRangeCountColumns { producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input GenomicRangeCreateInput { collectionId: Int! - referenceGenomeId: ID! + referenceGenomeId: ID = null fileId: ID = null } @@ -469,6 +539,93 @@ The `ID` scalar type represents a unique identifier, often used to refetch an ob """ scalar GlobalID @specifiedBy(url: "https://relay.dev/graphql/objectidentification.htm") +type HostOrganism implements EntityInterface & Node { + """The Globally Unique ID of this object""" + _id: GlobalID! + id: ID! + producingRunId: Int + ownerUserId: Int! + collectionId: Int! + name: String! + version: String! + hostFilteringId: ID + hostFiltering(where: FileWhereClause = null): File + sequenceId: ID + sequence(where: FileWhereClause = null): File +} + +type HostOrganismAggregate { + aggregate: HostOrganismAggregateFunctions +} + +type HostOrganismAggregateFunctions { + sum: HostOrganismNumericalColumns + avg: HostOrganismNumericalColumns + min: HostOrganismMinMaxColumns + max: HostOrganismMinMaxColumns + stddev: HostOrganismNumericalColumns + variance: HostOrganismNumericalColumns + count(distinct: Boolean = false, columns: HostOrganismCountColumns = null): Int +} + +enum HostOrganismCountColumns { + name + version + host_filtering + sequence + entity_id + id + producing_run_id + owner_user_id + collection_id + created_at + updated_at + deleted_at +} + +input HostOrganismCreateInput { + collectionId: Int! + name: String! + version: String! + hostFilteringId: ID = null + sequenceId: ID = null +} + +type HostOrganismMinMaxColumns { + producingRunId: Int + ownerUserId: Int + collectionId: Int + name: String + version: String +} + +type HostOrganismNumericalColumns { + producingRunId: Int + ownerUserId: Int + collectionId: Int +} + +input HostOrganismUpdateInput { + collectionId: Int = null + name: String = null + version: String = null + hostFilteringId: ID = null + sequenceId: ID = null +} + +input HostOrganismWhereClause { + id: UUIDComparators + producingRunId: IntComparators + ownerUserId: IntComparators + collectionId: IntComparators + name: StrComparators + version: StrComparators +} + +input HostOrganismWhereClauseMutations { + id: UUIDComparators +} + input IntComparators { _eq: Int _neq: Int @@ -530,6 +687,9 @@ enum MetadatumCountColumns { producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input MetadatumCreateInput { @@ -591,7 +751,6 @@ type MetricConsensusGenome implements EntityInterface & Node { ownerUserId: Int! collectionId: Int! consensusGenome(where: ConsensusGenomeWhereClause = null): ConsensusGenome - coverageDepth: Float referenceGenomeLength: Float percentGenomeCalled: Float percentIdentity: Float @@ -602,8 +761,11 @@ type MetricConsensusGenome implements EntityInterface & Node { nActg: Int nMissing: Int nAmbiguous: Int - coverageVizSummaryFileId: ID - coverageVizSummaryFile(where: FileWhereClause = null): File + coverageDepth: Float + coverageBreadth: Float + coverageBinSize: Float + coverageTotalLength: Int + coverageViz: [[Int!]!] } type MetricConsensusGenomeAggregate { @@ -620,18 +782,8 @@ type MetricConsensusGenomeAggregateFunctions { count(distinct: Boolean = false, columns: MetricConsensusGenomeCountColumns = null): Int } -"""A connection to a list of items.""" -type MetricConsensusGenomeConnection { - """Pagination data for this connection""" - pageInfo: PageInfo! - - """Contains the nodes in this connection""" - edges: [MetricConsensusGenomeEdge!]! -} - enum MetricConsensusGenomeCountColumns { consensus_genome - coverage_depth reference_genome_length percent_genome_called percent_identity @@ -642,18 +794,24 @@ enum MetricConsensusGenomeCountColumns { n_actg n_missing n_ambiguous - coverage_viz_summary_file + coverage_depth + coverage_breadth + coverage_bin_size + coverage_total_length + coverage_viz entity_id id producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input MetricConsensusGenomeCreateInput { collectionId: Int! consensusGenomeId: ID! - coverageDepth: Float = null referenceGenomeLength: Float = null percentGenomeCalled: Float = null percentIdentity: Float = null @@ -664,23 +822,17 @@ input MetricConsensusGenomeCreateInput { nActg: Int = null nMissing: Int = null nAmbiguous: Int = null - coverageVizSummaryFileId: ID = null -} - -"""An edge in a connection.""" -type MetricConsensusGenomeEdge { - """A cursor for use in pagination""" - cursor: String! - - """The item at the end of the edge""" - node: MetricConsensusGenome! + coverageDepth: Float = null + coverageBreadth: Float = null + coverageBinSize: Float = null + coverageTotalLength: Int = null + coverageViz: [[Int!]!] = null } type MetricConsensusGenomeMinMaxColumns { producingRunId: Int ownerUserId: Int collectionId: Int - coverageDepth: Float referenceGenomeLength: Float percentGenomeCalled: Float percentIdentity: Float @@ -691,13 +843,16 @@ type MetricConsensusGenomeMinMaxColumns { nActg: Int nMissing: Int nAmbiguous: Int + coverageDepth: Float + coverageBreadth: Float + coverageBinSize: Float + coverageTotalLength: Int } type MetricConsensusGenomeNumericalColumns { producingRunId: Int ownerUserId: Int collectionId: Int - coverageDepth: Float referenceGenomeLength: Float percentGenomeCalled: Float percentIdentity: Float @@ -708,12 +863,15 @@ type MetricConsensusGenomeNumericalColumns { nActg: Int nMissing: Int nAmbiguous: Int + coverageDepth: Float + coverageBreadth: Float + coverageBinSize: Float + coverageTotalLength: Int } input MetricConsensusGenomeUpdateInput { collectionId: Int = null consensusGenomeId: ID = null - coverageDepth: Float = null referenceGenomeLength: Float = null percentGenomeCalled: Float = null percentIdentity: Float = null @@ -724,7 +882,11 @@ input MetricConsensusGenomeUpdateInput { nActg: Int = null nMissing: Int = null nAmbiguous: Int = null - coverageVizSummaryFileId: ID = null + coverageDepth: Float = null + coverageBreadth: Float = null + coverageBinSize: Float = null + coverageTotalLength: Int = null + coverageViz: [[Int!]!] = null } input MetricConsensusGenomeWhereClause { @@ -733,7 +895,6 @@ input MetricConsensusGenomeWhereClause { ownerUserId: IntComparators collectionId: IntComparators consensusGenome: ConsensusGenomeWhereClause - coverageDepth: FloatComparators referenceGenomeLength: FloatComparators percentGenomeCalled: FloatComparators percentIdentity: FloatComparators @@ -744,6 +905,10 @@ input MetricConsensusGenomeWhereClause { nActg: IntComparators nMissing: IntComparators nAmbiguous: IntComparators + coverageDepth: FloatComparators + coverageBreadth: FloatComparators + coverageBinSize: FloatComparators + coverageTotalLength: IntComparators } input MetricConsensusGenomeWhereClauseMutations { @@ -782,9 +947,9 @@ type Mutation { createReferenceGenome(input: ReferenceGenomeCreateInput!): ReferenceGenome! updateReferenceGenome(input: ReferenceGenomeUpdateInput!, where: ReferenceGenomeWhereClauseMutations!): [ReferenceGenome!]! deleteReferenceGenome(where: ReferenceGenomeWhereClauseMutations!): [ReferenceGenome!]! - createSequenceAlignmentIndex(input: SequenceAlignmentIndexCreateInput!): SequenceAlignmentIndex! - updateSequenceAlignmentIndex(input: SequenceAlignmentIndexUpdateInput!, where: SequenceAlignmentIndexWhereClauseMutations!): [SequenceAlignmentIndex!]! - deleteSequenceAlignmentIndex(where: SequenceAlignmentIndexWhereClauseMutations!): [SequenceAlignmentIndex!]! + createHostOrganism(input: HostOrganismCreateInput!): HostOrganism! + updateHostOrganism(input: HostOrganismUpdateInput!, where: HostOrganismWhereClauseMutations!): [HostOrganism!]! + deleteHostOrganism(where: HostOrganismWhereClauseMutations!): [HostOrganism!]! createMetadatum(input: MetadatumCreateInput!): Metadatum! updateMetadatum(input: MetadatumUpdateInput!, where: MetadatumWhereClauseMutations!): [Metadatum!]! deleteMetadatum(where: MetadatumWhereClauseMutations!): [Metadatum!]! @@ -806,6 +971,9 @@ type Mutation { createPhylogeneticTree(input: PhylogeneticTreeCreateInput!): PhylogeneticTree! updatePhylogeneticTree(input: PhylogeneticTreeUpdateInput!, where: PhylogeneticTreeWhereClauseMutations!): [PhylogeneticTree!]! deletePhylogeneticTree(where: PhylogeneticTreeWhereClauseMutations!): [PhylogeneticTree!]! + createBulkDownload(input: BulkDownloadCreateInput!): BulkDownload! + updateBulkDownload(input: BulkDownloadUpdateInput!, where: BulkDownloadWhereClauseMutations!): [BulkDownload!]! + deleteBulkDownload(where: BulkDownloadWhereClauseMutations!): [BulkDownload!]! } """An object with a Globally Unique ID""" @@ -880,6 +1048,9 @@ enum PhylogeneticTreeCountColumns { producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input PhylogeneticTreeCreateInput { @@ -950,7 +1121,7 @@ type Query { sequencingReads(where: SequencingReadWhereClause = null): [SequencingRead!]! genomicRanges(where: GenomicRangeWhereClause = null): [GenomicRange!]! referenceGenomes(where: ReferenceGenomeWhereClause = null): [ReferenceGenome!]! - sequenceAlignmentIndices(where: SequenceAlignmentIndexWhereClause = null): [SequenceAlignmentIndex!]! + hostOrganisms(where: HostOrganismWhereClause = null): [HostOrganism!]! metadatas(where: MetadatumWhereClause = null): [Metadatum!]! consensusGenomes(where: ConsensusGenomeWhereClause = null): [ConsensusGenome!]! metricsConsensusGenomes(where: MetricConsensusGenomeWhereClause = null): [MetricConsensusGenome!]! @@ -958,11 +1129,12 @@ type Query { upstreamDatabases(where: UpstreamDatabaseWhereClause = null): [UpstreamDatabase!]! contigs(where: ContigWhereClause = null): [Contig!]! phylogeneticTrees(where: PhylogeneticTreeWhereClause = null): [PhylogeneticTree!]! + bulkDownloads(where: BulkDownloadWhereClause = null): [BulkDownload!]! samplesAggregate(where: SampleWhereClause = null): SampleAggregate! sequencingReadsAggregate(where: SequencingReadWhereClause = null): SequencingReadAggregate! genomicRangesAggregate(where: GenomicRangeWhereClause = null): GenomicRangeAggregate! referenceGenomesAggregate(where: ReferenceGenomeWhereClause = null): ReferenceGenomeAggregate! - sequenceAlignmentIndicesAggregate(where: SequenceAlignmentIndexWhereClause = null): SequenceAlignmentIndexAggregate! + hostOrganismsAggregate(where: HostOrganismWhereClause = null): HostOrganismAggregate! metadatasAggregate(where: MetadatumWhereClause = null): MetadatumAggregate! consensusGenomesAggregate(where: ConsensusGenomeWhereClause = null): ConsensusGenomeAggregate! metricsConsensusGenomesAggregate(where: MetricConsensusGenomeWhereClause = null): MetricConsensusGenomeAggregate! @@ -970,6 +1142,7 @@ type Query { upstreamDatabasesAggregate(where: UpstreamDatabaseWhereClause = null): UpstreamDatabaseAggregate! contigsAggregate(where: ContigWhereClause = null): ContigAggregate! phylogeneticTreesAggregate(where: PhylogeneticTreeWhereClause = null): PhylogeneticTreeAggregate! + bulkDownloadsAggregate(where: BulkDownloadWhereClause = null): BulkDownloadAggregate! } type ReferenceGenome implements EntityInterface & Node { @@ -981,28 +1154,9 @@ type ReferenceGenome implements EntityInterface & Node { collectionId: Int! fileId: ID file(where: FileWhereClause = null): File - fileIndexId: ID - fileIndex(where: FileWhereClause = null): File - name: String! - description: String! taxon(where: TaxonWhereClause = null): Taxon accessionId: String - sequenceAlignmentIndices( - where: SequenceAlignmentIndexWhereClause = null - - """Returns the items in the list that come before the specified cursor.""" - before: String = null - - """Returns the items in the list that come after the specified cursor.""" - after: String = null - - """Returns the first n items from the list.""" - first: Int = null - - """Returns the items in the list that come after the specified cursor.""" - last: Int = null - ): SequenceAlignmentIndexConnection! - sequenceAlignmentIndicesAggregate(where: SequenceAlignmentIndexWhereClause = null): SequenceAlignmentIndexAggregate + accessionName: String consensusGenomes( where: ConsensusGenomeWhereClause = null @@ -1062,12 +1216,9 @@ type ReferenceGenomeConnection { enum ReferenceGenomeCountColumns { file - file_index - name - description taxon accession_id - sequence_alignment_indices + accession_name consensus_genomes genomic_ranges entity_id @@ -1075,16 +1226,17 @@ enum ReferenceGenomeCountColumns { producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input ReferenceGenomeCreateInput { collectionId: Int! fileId: ID = null - fileIndexId: ID = null - name: String! - description: String! taxonId: ID! accessionId: String = null + accessionName: String = null } """An edge in a connection.""" @@ -1100,9 +1252,8 @@ type ReferenceGenomeMinMaxColumns { producingRunId: Int ownerUserId: Int collectionId: Int - name: String - description: String accessionId: String + accessionName: String } type ReferenceGenomeNumericalColumns { @@ -1114,11 +1265,9 @@ type ReferenceGenomeNumericalColumns { input ReferenceGenomeUpdateInput { collectionId: Int = null fileId: ID = null - fileIndexId: ID = null - name: String = null - description: String = null taxonId: ID = null accessionId: String = null + accessionName: String = null } input ReferenceGenomeWhereClause { @@ -1126,11 +1275,9 @@ input ReferenceGenomeWhereClause { producingRunId: IntComparators ownerUserId: IntComparators collectionId: IntComparators - name: StrComparators - description: StrComparators taxon: TaxonWhereClause accessionId: StrComparators - sequenceAlignmentIndices: SequenceAlignmentIndexWhereClause + accessionName: StrComparators consensusGenomes: ConsensusGenomeWhereClause genomicRanges: GenomicRangeWhereClause } @@ -1146,10 +1293,11 @@ type Sample implements EntityInterface & Node { producingRunId: Int ownerUserId: Int! collectionId: Int! + railsSampleId: Int name: String! sampleType: String! waterControl: Boolean! - collectionDate: DateTime + collectionDate: DateTime! collectionLocation: String! description: String hostTaxon(where: TaxonWhereClause = null): Taxon @@ -1211,6 +1359,7 @@ type SampleConnection { } enum SampleCountColumns { + rails_sample_id name sample_type water_control @@ -1225,14 +1374,18 @@ enum SampleCountColumns { producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input SampleCreateInput { collectionId: Int! + railsSampleId: Int = null name: String! sampleType: String! waterControl: Boolean! - collectionDate: DateTime = null + collectionDate: DateTime! collectionLocation: String! description: String = null hostTaxonId: ID = null @@ -1251,6 +1404,7 @@ type SampleMinMaxColumns { producingRunId: Int ownerUserId: Int collectionId: Int + railsSampleId: Int name: String sampleType: String collectionDate: DateTime @@ -1262,10 +1416,12 @@ type SampleNumericalColumns { producingRunId: Int ownerUserId: Int collectionId: Int + railsSampleId: Int } input SampleUpdateInput { collectionId: Int = null + railsSampleId: Int = null name: String = null sampleType: String = null waterControl: Boolean = null @@ -1280,6 +1436,7 @@ input SampleWhereClause { producingRunId: IntComparators ownerUserId: IntComparators collectionId: IntComparators + railsSampleId: IntComparators name: StrComparators sampleType: StrComparators waterControl: BoolComparators @@ -1295,107 +1452,6 @@ input SampleWhereClauseMutations { id: UUIDComparators } -type SequenceAlignmentIndex implements EntityInterface & Node { - """The Globally Unique ID of this object""" - _id: GlobalID! - id: ID! - producingRunId: Int - ownerUserId: Int! - collectionId: Int! - indexFileId: ID - indexFile(where: FileWhereClause = null): File - referenceGenome(where: ReferenceGenomeWhereClause = null): ReferenceGenome - tool: AlignmentTool! - version: String -} - -type SequenceAlignmentIndexAggregate { - aggregate: SequenceAlignmentIndexAggregateFunctions -} - -type SequenceAlignmentIndexAggregateFunctions { - sum: SequenceAlignmentIndexNumericalColumns - avg: SequenceAlignmentIndexNumericalColumns - min: SequenceAlignmentIndexMinMaxColumns - max: SequenceAlignmentIndexMinMaxColumns - stddev: SequenceAlignmentIndexNumericalColumns - variance: SequenceAlignmentIndexNumericalColumns - count(distinct: Boolean = false, columns: SequenceAlignmentIndexCountColumns = null): Int -} - -"""A connection to a list of items.""" -type SequenceAlignmentIndexConnection { - """Pagination data for this connection""" - pageInfo: PageInfo! - - """Contains the nodes in this connection""" - edges: [SequenceAlignmentIndexEdge!]! -} - -enum SequenceAlignmentIndexCountColumns { - index_file - reference_genome - tool - version - entity_id - id - producing_run_id - owner_user_id - collection_id -} - -input SequenceAlignmentIndexCreateInput { - collectionId: Int! - indexFileId: ID = null - referenceGenomeId: ID = null - tool: AlignmentTool! - version: String = null -} - -"""An edge in a connection.""" -type SequenceAlignmentIndexEdge { - """A cursor for use in pagination""" - cursor: String! - - """The item at the end of the edge""" - node: SequenceAlignmentIndex! -} - -type SequenceAlignmentIndexMinMaxColumns { - producingRunId: Int - ownerUserId: Int - collectionId: Int - version: String -} - -type SequenceAlignmentIndexNumericalColumns { - producingRunId: Int - ownerUserId: Int - collectionId: Int -} - -input SequenceAlignmentIndexUpdateInput { - collectionId: Int = null - indexFileId: ID = null - referenceGenomeId: ID = null - tool: AlignmentTool = null - version: String = null -} - -input SequenceAlignmentIndexWhereClause { - id: UUIDComparators - producingRunId: IntComparators - ownerUserId: IntComparators - collectionId: IntComparators - referenceGenome: ReferenceGenomeWhereClause - tool: AlignmentToolEnumComparators - version: StrComparators -} - -input SequenceAlignmentIndexWhereClauseMutations { - id: UUIDComparators -} - enum SequencingProtocol { ampliseq artic @@ -1431,14 +1487,14 @@ type SequencingRead implements EntityInterface & Node { ownerUserId: Int! collectionId: Int! sample(where: SampleWhereClause = null): Sample - protocol: SequencingProtocol! + protocol: SequencingProtocol r1FileId: ID r1File(where: FileWhereClause = null): File r2FileId: ID r2File(where: FileWhereClause = null): File technology: SequencingTechnology! nucleicAcid: NucleicAcid! - hasErcc: Boolean! + clearlabsExport: Boolean! taxon(where: TaxonWhereClause = null): Taxon primerFile(where: GenomicRangeWhereClause = null): GenomicRange consensusGenomes( @@ -1505,7 +1561,7 @@ enum SequencingReadCountColumns { r2_file technology nucleic_acid - has_ercc + clearlabs_export taxon primer_file consensus_genomes @@ -1515,17 +1571,20 @@ enum SequencingReadCountColumns { producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input SequencingReadCreateInput { collectionId: Int! sampleId: ID = null - protocol: SequencingProtocol! + protocol: SequencingProtocol = null r1FileId: ID = null r2FileId: ID = null technology: SequencingTechnology! nucleicAcid: NucleicAcid! - hasErcc: Boolean! + clearlabsExport: Boolean! taxonId: ID = null primerFileId: ID = null } @@ -1559,7 +1618,7 @@ input SequencingReadUpdateInput { r2FileId: ID = null technology: SequencingTechnology = null nucleicAcid: NucleicAcid = null - hasErcc: Boolean = null + clearlabsExport: Boolean = null taxonId: ID = null primerFileId: ID = null } @@ -1573,7 +1632,7 @@ input SequencingReadWhereClause { protocol: SequencingProtocolEnumComparators technology: SequencingTechnologyEnumComparators nucleicAcid: NucleicAcidEnumComparators - hasErcc: BoolComparators + clearlabsExport: BoolComparators taxon: TaxonWhereClause primerFile: GenomicRangeWhereClause consensusGenomes: ConsensusGenomeWhereClause @@ -1761,6 +1820,9 @@ enum TaxonCountColumns { producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input TaxonCreateInput { @@ -1921,6 +1983,9 @@ enum UpstreamDatabaseCountColumns { producing_run_id owner_user_id collection_id + created_at + updated_at + deleted_at } input UpstreamDatabaseCreateInput { diff --git a/entities/api/schema.json b/entities/api/schema.json index 41d77cc9..d6e5c1d0 100644 --- a/entities/api/schema.json +++ b/entities/api/schema.json @@ -333,12 +333,12 @@ "name": "where", "type": { "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexWhereClause", + "name": "HostOrganismWhereClause", "ofType": null } } ], - "name": "sequenceAlignmentIndices", + "name": "hostOrganisms", "type": { "kind": "NON_NULL", "name": null, @@ -350,7 +350,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "SequenceAlignmentIndex", + "name": "HostOrganism", "ofType": null } } @@ -574,6 +574,37 @@ } } }, + { + "args": [ + { + "defaultValue": "null", + "name": "where", + "type": { + "kind": "INPUT_OBJECT", + "name": "BulkDownloadWhereClause", + "ofType": null + } + } + ], + "name": "bulkDownloads", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BulkDownload", + "ofType": null + } + } + } + } + }, { "args": [ { @@ -673,18 +704,18 @@ "name": "where", "type": { "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexWhereClause", + "name": "HostOrganismWhereClause", "ofType": null } } ], - "name": "sequenceAlignmentIndicesAggregate", + "name": "hostOrganismsAggregate", "type": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "OBJECT", - "name": "SequenceAlignmentIndexAggregate", + "name": "HostOrganismAggregate", "ofType": null } } @@ -849,6 +880,29 @@ "ofType": null } } + }, + { + "args": [ + { + "defaultValue": "null", + "name": "where", + "type": { + "kind": "INPUT_OBJECT", + "name": "BulkDownloadWhereClause", + "ofType": null + } + } + ], + "name": "bulkDownloadsAggregate", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BulkDownloadAggregate", + "ofType": null + } + } } ], "inputFields": null, @@ -916,28 +970,33 @@ }, { "kind": "OBJECT", - "name": "SequenceAlignmentIndex", + "name": "Contig", "ofType": null }, { "kind": "OBJECT", - "name": "Contig", + "name": "MetricConsensusGenome", "ofType": null }, { "kind": "OBJECT", - "name": "MetricConsensusGenome", + "name": "Metadatum", "ofType": null }, { "kind": "OBJECT", - "name": "Metadatum", + "name": "HostOrganism", "ofType": null }, { "kind": "OBJECT", "name": "PhylogeneticTree", "ofType": null + }, + { + "kind": "OBJECT", + "name": "BulkDownload", + "ofType": null } ] }, @@ -2066,6 +2125,15 @@ } } }, + { + "args": [], + "name": "railsSampleId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, { "args": [], "name": "name", @@ -2109,9 +2177,13 @@ "args": [], "name": "collectionDate", "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } } }, { @@ -2394,28 +2466,33 @@ }, { "kind": "OBJECT", - "name": "SequenceAlignmentIndex", + "name": "Contig", "ofType": null }, { "kind": "OBJECT", - "name": "Contig", + "name": "MetricConsensusGenome", "ofType": null }, { "kind": "OBJECT", - "name": "MetricConsensusGenome", + "name": "Metadatum", "ofType": null }, { "kind": "OBJECT", - "name": "Metadatum", + "name": "HostOrganism", "ofType": null }, { "kind": "OBJECT", "name": "PhylogeneticTree", "ofType": null + }, + { + "kind": "OBJECT", + "name": "BulkDownload", + "ofType": null } ] }, @@ -3865,7 +3942,7 @@ }, { "defaultValue": null, - "name": "hasErcc", + "name": "clearlabsExport", "type": { "kind": "INPUT_OBJECT", "name": "BoolComparators", @@ -3954,6 +4031,15 @@ "ofType": null } }, + { + "defaultValue": null, + "name": "railsSampleId", + "type": { + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null + } + }, { "defaultValue": null, "name": "name", @@ -4724,24 +4810,6 @@ "ofType": null } }, - { - "defaultValue": null, - "name": "name", - "type": { - "kind": "INPUT_OBJECT", - "name": "StrComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "description", - "type": { - "kind": "INPUT_OBJECT", - "name": "StrComparators", - "ofType": null - } - }, { "defaultValue": null, "name": "taxon", @@ -4762,10 +4830,10 @@ }, { "defaultValue": null, - "name": "sequenceAlignmentIndices", + "name": "accessionName", "type": { "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexWhereClause", + "name": "StrComparators", "ofType": null } }, @@ -4835,25 +4903,16 @@ }, { "defaultValue": null, - "name": "referenceGenome", - "type": { - "kind": "INPUT_OBJECT", - "name": "ReferenceGenomeWhereClause", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "tool", + "name": "sequencingRead", "type": { "kind": "INPUT_OBJECT", - "name": "AlignmentToolEnumComparators", + "name": "SequencingReadWhereClause", "ofType": null } }, { "defaultValue": null, - "name": "version", + "name": "sequence", "type": { "kind": "INPUT_OBJECT", "name": "StrComparators", @@ -4863,7 +4922,7 @@ ], "interfaces": null, "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexWhereClause", + "name": "ContigWhereClause", "possibleTypes": null }, { @@ -4872,142 +4931,97 @@ "inputFields": [ { "defaultValue": null, - "name": "_eq", + "name": "id", "type": { - "kind": "ENUM", - "name": "AlignmentTool", + "kind": "INPUT_OBJECT", + "name": "UUIDComparators", "ofType": null } }, { "defaultValue": null, - "name": "_neq", + "name": "producingRunId", "type": { - "kind": "ENUM", - "name": "AlignmentTool", + "kind": "INPUT_OBJECT", + "name": "IntComparators", "ofType": null } }, { "defaultValue": null, - "name": "_in", + "name": "ownerUserId", "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "AlignmentTool", - "ofType": null - } - } + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null } }, { "defaultValue": null, - "name": "_nin", + "name": "collectionId", "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "AlignmentTool", - "ofType": null - } - } + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null } }, { "defaultValue": null, - "name": "_gt", + "name": "consensusGenome", "type": { - "kind": "ENUM", - "name": "AlignmentTool", + "kind": "INPUT_OBJECT", + "name": "ConsensusGenomeWhereClause", "ofType": null } }, { "defaultValue": null, - "name": "_gte", + "name": "referenceGenomeLength", "type": { - "kind": "ENUM", - "name": "AlignmentTool", + "kind": "INPUT_OBJECT", + "name": "FloatComparators", "ofType": null } }, { "defaultValue": null, - "name": "_lt", + "name": "percentGenomeCalled", "type": { - "kind": "ENUM", - "name": "AlignmentTool", + "kind": "INPUT_OBJECT", + "name": "FloatComparators", "ofType": null } }, { "defaultValue": null, - "name": "_lte", + "name": "percentIdentity", "type": { - "kind": "ENUM", - "name": "AlignmentTool", + "kind": "INPUT_OBJECT", + "name": "FloatComparators", "ofType": null } }, { "defaultValue": null, - "name": "_is_null", + "name": "gcPercent", "type": { - "kind": "ENUM", - "name": "AlignmentTool", + "kind": "INPUT_OBJECT", + "name": "FloatComparators", "ofType": null } - } - ], - "interfaces": null, - "kind": "INPUT_OBJECT", - "name": "AlignmentToolEnumComparators", - "possibleTypes": null - }, - { - "enumValues": [ - { - "name": "bowtie2" }, - { - "name": "minimap2" - }, - { - "name": "czid_index_generation" - } - ], - "fields": null, - "inputFields": null, - "interfaces": null, - "kind": "ENUM", - "name": "AlignmentTool", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": null, - "inputFields": [ { "defaultValue": null, - "name": "id", + "name": "totalReads", "type": { "kind": "INPUT_OBJECT", - "name": "UUIDComparators", + "name": "IntComparators", "ofType": null } }, { "defaultValue": null, - "name": "producingRunId", + "name": "mappedReads", "type": { "kind": "INPUT_OBJECT", "name": "IntComparators", @@ -5016,7 +5030,7 @@ }, { "defaultValue": null, - "name": "ownerUserId", + "name": "refSnps", "type": { "kind": "INPUT_OBJECT", "name": "IntComparators", @@ -5025,7 +5039,7 @@ }, { "defaultValue": null, - "name": "collectionId", + "name": "nActg", "type": { "kind": "INPUT_OBJECT", "name": "IntComparators", @@ -5034,170 +5048,52 @@ }, { "defaultValue": null, - "name": "sequencingRead", + "name": "nMissing", "type": { "kind": "INPUT_OBJECT", - "name": "SequencingReadWhereClause", + "name": "IntComparators", "ofType": null } }, { "defaultValue": null, - "name": "sequence", + "name": "nAmbiguous", "type": { "kind": "INPUT_OBJECT", - "name": "StrComparators", + "name": "IntComparators", "ofType": null } - } - ], - "interfaces": null, - "kind": "INPUT_OBJECT", - "name": "ContigWhereClause", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": null, - "inputFields": [ + }, { "defaultValue": null, - "name": "id", + "name": "coverageDepth", "type": { "kind": "INPUT_OBJECT", - "name": "UUIDComparators", + "name": "FloatComparators", "ofType": null } }, { "defaultValue": null, - "name": "producingRunId", + "name": "coverageBreadth", "type": { "kind": "INPUT_OBJECT", - "name": "IntComparators", + "name": "FloatComparators", "ofType": null } }, { "defaultValue": null, - "name": "ownerUserId", + "name": "coverageBinSize", "type": { "kind": "INPUT_OBJECT", - "name": "IntComparators", + "name": "FloatComparators", "ofType": null } }, { "defaultValue": null, - "name": "collectionId", - "type": { - "kind": "INPUT_OBJECT", - "name": "IntComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "consensusGenome", - "type": { - "kind": "INPUT_OBJECT", - "name": "ConsensusGenomeWhereClause", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "coverageDepth", - "type": { - "kind": "INPUT_OBJECT", - "name": "FloatComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "referenceGenomeLength", - "type": { - "kind": "INPUT_OBJECT", - "name": "FloatComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "percentGenomeCalled", - "type": { - "kind": "INPUT_OBJECT", - "name": "FloatComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "percentIdentity", - "type": { - "kind": "INPUT_OBJECT", - "name": "FloatComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "gcPercent", - "type": { - "kind": "INPUT_OBJECT", - "name": "FloatComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "totalReads", - "type": { - "kind": "INPUT_OBJECT", - "name": "IntComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "mappedReads", - "type": { - "kind": "INPUT_OBJECT", - "name": "IntComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "refSnps", - "type": { - "kind": "INPUT_OBJECT", - "name": "IntComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "nActg", - "type": { - "kind": "INPUT_OBJECT", - "name": "IntComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "nMissing", - "type": { - "kind": "INPUT_OBJECT", - "name": "IntComparators", - "ofType": null - } - }, - { - "defaultValue": null, - "name": "nAmbiguous", + "name": "coverageTotalLength", "type": { "kind": "INPUT_OBJECT", "name": "IntComparators", @@ -5638,6 +5534,15 @@ }, { "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" } ], "fields": null, @@ -5876,15 +5781,6 @@ "ofType": null } }, - { - "args": [], - "name": "intermediateOutputsId", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, { "args": [ { @@ -5892,75 +5788,25 @@ "name": "where", "type": { "kind": "INPUT_OBJECT", - "name": "FileWhereClause", + "name": "MetricConsensusGenomeWhereClause", "ofType": null } } ], - "name": "intermediateOutputs", + "name": "metrics", "type": { "kind": "OBJECT", - "name": "File", + "name": "MetricConsensusGenome", "ofType": null } }, { - "args": [ - { - "defaultValue": "null", - "name": "where", - "type": { - "kind": "INPUT_OBJECT", - "name": "MetricConsensusGenomeWhereClause", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "before", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "after", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "first", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "last", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - } - ], - "name": "metrics", + "args": [], + "name": "intermediateOutputsId", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "MetricConsensusGenomeConnection", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null } }, { @@ -5970,15 +5816,15 @@ "name": "where", "type": { "kind": "INPUT_OBJECT", - "name": "MetricConsensusGenomeWhereClause", + "name": "FileWhereClause", "ofType": null } } ], - "name": "metricsAggregate", + "name": "intermediateOutputs", "type": { "kind": "OBJECT", - "name": "MetricConsensusGenomeAggregate", + "name": "File", "ofType": null } } @@ -6087,13 +5933,9 @@ "args": [], "name": "protocol", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SequencingProtocol", - "ofType": null - } + "kind": "ENUM", + "name": "SequencingProtocol", + "ofType": null } }, { @@ -6180,7 +6022,7 @@ }, { "args": [], - "name": "hasErcc", + "name": "clearlabsExport", "type": { "kind": "NON_NULL", "name": null, @@ -6702,15 +6544,6 @@ "ofType": null } }, - { - "args": [], - "name": "fileIndexId", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, { "args": [ { @@ -6718,150 +6551,36 @@ "name": "where", "type": { "kind": "INPUT_OBJECT", - "name": "FileWhereClause", + "name": "TaxonWhereClause", "ofType": null } } ], - "name": "fileIndex", + "name": "taxon", "type": { "kind": "OBJECT", - "name": "File", + "name": "Taxon", "ofType": null } }, { "args": [], - "name": "name", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - { - "args": [], - "name": "description", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - { - "args": [ - { - "defaultValue": "null", - "name": "where", - "type": { - "kind": "INPUT_OBJECT", - "name": "TaxonWhereClause", - "ofType": null - } - } - ], - "name": "taxon", + "name": "accessionId", "type": { - "kind": "OBJECT", - "name": "Taxon", + "kind": "SCALAR", + "name": "String", "ofType": null } }, { "args": [], - "name": "accessionId", + "name": "accessionName", "type": { "kind": "SCALAR", "name": "String", "ofType": null } }, - { - "args": [ - { - "defaultValue": "null", - "name": "where", - "type": { - "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexWhereClause", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "before", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "after", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "first", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "last", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - } - ], - "name": "sequenceAlignmentIndices", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SequenceAlignmentIndexConnection", - "ofType": null - } - } - }, - { - "args": [ - { - "defaultValue": "null", - "name": "where", - "type": { - "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexWhereClause", - "ofType": null - } - } - ], - "name": "sequenceAlignmentIndicesAggregate", - "type": { - "kind": "OBJECT", - "name": "SequenceAlignmentIndexAggregate", - "ofType": null - } - }, { "args": [ { @@ -7041,79 +6760,18 @@ "fields": [ { "args": [], - "name": "pageInfo", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - } - }, - { - "args": [], - "name": "edges", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SequenceAlignmentIndexEdge", - "ofType": null - } - } - } - } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SequenceAlignmentIndexConnection", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ - { - "args": [], - "name": "cursor", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - { - "args": [], - "name": "node", + "name": "aggregate", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SequenceAlignmentIndex", - "ofType": null - } + "kind": "OBJECT", + "name": "ConsensusGenomeAggregateFunctions", + "ofType": null } } ], "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "SequenceAlignmentIndexEdge", + "name": "ConsensusGenomeAggregate", "possibleTypes": null }, { @@ -7121,150 +6779,297 @@ "fields": [ { "args": [], - "name": "_id", + "name": "sum", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "GlobalID", - "ofType": null - } + "kind": "OBJECT", + "name": "ConsensusGenomeNumericalColumns", + "ofType": null } }, { "args": [], - "name": "id", + "name": "avg", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "OBJECT", + "name": "ConsensusGenomeNumericalColumns", + "ofType": null } }, { "args": [], - "name": "producingRunId", + "name": "min", "type": { - "kind": "SCALAR", - "name": "Int", + "kind": "OBJECT", + "name": "ConsensusGenomeMinMaxColumns", "ofType": null } }, { "args": [], - "name": "ownerUserId", + "name": "max", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } + "kind": "OBJECT", + "name": "ConsensusGenomeMinMaxColumns", + "ofType": null } }, { "args": [], - "name": "collectionId", + "name": "stddev", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } + "kind": "OBJECT", + "name": "ConsensusGenomeNumericalColumns", + "ofType": null } }, { "args": [], - "name": "indexFileId", + "name": "variance", "type": { - "kind": "SCALAR", - "name": "ID", + "kind": "OBJECT", + "name": "ConsensusGenomeNumericalColumns", "ofType": null } }, { "args": [ { - "defaultValue": "null", - "name": "where", + "defaultValue": "false", + "name": "distinct", "type": { - "kind": "INPUT_OBJECT", - "name": "FileWhereClause", + "kind": "SCALAR", + "name": "Boolean", "ofType": null } - } - ], - "name": "indexFile", - "type": { - "kind": "OBJECT", - "name": "File", - "ofType": null - } - }, - { - "args": [ + }, { "defaultValue": "null", - "name": "where", + "name": "columns", "type": { - "kind": "INPUT_OBJECT", - "name": "ReferenceGenomeWhereClause", + "kind": "ENUM", + "name": "ConsensusGenomeCountColumns", "ofType": null } } ], - "name": "referenceGenome", + "name": "count", "type": { - "kind": "OBJECT", - "name": "ReferenceGenome", + "kind": "SCALAR", + "name": "Int", "ofType": null } - }, + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "ConsensusGenomeAggregateFunctions", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ { "args": [], - "name": "tool", + "name": "producingRunId", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "AlignmentTool", - "ofType": null - } + "kind": "SCALAR", + "name": "Int", + "ofType": null } }, { "args": [], - "name": "version", + "name": "ownerUserId", "type": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null } - } + }, + { + "args": [], + "name": "collectionId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } ], "inputFields": null, - "interfaces": [ + "interfaces": [], + "kind": "OBJECT", + "name": "ConsensusGenomeNumericalColumns", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ { - "kind": "INTERFACE", - "name": "EntityInterface", - "ofType": null + "args": [], + "name": "producingRunId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } }, { - "kind": "INTERFACE", - "name": "Node", - "ofType": null + "args": [], + "name": "ownerUserId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "collectionId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "ConsensusGenomeMinMaxColumns", + "possibleTypes": null + }, + { + "enumValues": [ + { + "name": "taxon" + }, + { + "name": "sequence_read" + }, + { + "name": "reference_genome" + }, + { + "name": "sequence" + }, + { + "name": "metrics" + }, + { + "name": "intermediate_outputs" + }, + { + "name": "entity_id" + }, + { + "name": "id" + }, + { + "name": "producing_run_id" + }, + { + "name": "owner_user_id" + }, + { + "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" + } + ], + "fields": null, + "inputFields": null, + "interfaces": null, + "kind": "ENUM", + "name": "ConsensusGenomeCountColumns", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "pageInfo", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + } + }, + { + "args": [], + "name": "edges", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GenomicRangeEdge", + "ofType": null + } + } + } + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "GenomicRangeConnection", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "cursor", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "name": "node", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GenomicRange", + "ofType": null + } + } } ], + "inputFields": null, + "interfaces": [], "kind": "OBJECT", - "name": "SequenceAlignmentIndex", + "name": "GenomicRangeEdge", "possibleTypes": null }, { @@ -7275,7 +7080,7 @@ "name": "aggregate", "type": { "kind": "OBJECT", - "name": "SequenceAlignmentIndexAggregateFunctions", + "name": "GenomicRangeAggregateFunctions", "ofType": null } } @@ -7283,7 +7088,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "SequenceAlignmentIndexAggregate", + "name": "GenomicRangeAggregate", "possibleTypes": null }, { @@ -7294,7 +7099,7 @@ "name": "sum", "type": { "kind": "OBJECT", - "name": "SequenceAlignmentIndexNumericalColumns", + "name": "GenomicRangeNumericalColumns", "ofType": null } }, @@ -7303,7 +7108,7 @@ "name": "avg", "type": { "kind": "OBJECT", - "name": "SequenceAlignmentIndexNumericalColumns", + "name": "GenomicRangeNumericalColumns", "ofType": null } }, @@ -7312,7 +7117,7 @@ "name": "min", "type": { "kind": "OBJECT", - "name": "SequenceAlignmentIndexMinMaxColumns", + "name": "GenomicRangeMinMaxColumns", "ofType": null } }, @@ -7321,7 +7126,7 @@ "name": "max", "type": { "kind": "OBJECT", - "name": "SequenceAlignmentIndexMinMaxColumns", + "name": "GenomicRangeMinMaxColumns", "ofType": null } }, @@ -7330,7 +7135,7 @@ "name": "stddev", "type": { "kind": "OBJECT", - "name": "SequenceAlignmentIndexNumericalColumns", + "name": "GenomicRangeNumericalColumns", "ofType": null } }, @@ -7339,7 +7144,7 @@ "name": "variance", "type": { "kind": "OBJECT", - "name": "SequenceAlignmentIndexNumericalColumns", + "name": "GenomicRangeNumericalColumns", "ofType": null } }, @@ -7359,7 +7164,7 @@ "name": "columns", "type": { "kind": "ENUM", - "name": "SequenceAlignmentIndexCountColumns", + "name": "GenomicRangeCountColumns", "ofType": null } } @@ -7375,7 +7180,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "SequenceAlignmentIndexAggregateFunctions", + "name": "GenomicRangeAggregateFunctions", "possibleTypes": null }, { @@ -7412,7 +7217,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "SequenceAlignmentIndexNumericalColumns", + "name": "GenomicRangeNumericalColumns", "possibleTypes": null }, { @@ -7444,36 +7249,24 @@ "name": "Int", "ofType": null } - }, - { - "args": [], - "name": "version", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } } ], "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "SequenceAlignmentIndexMinMaxColumns", + "name": "GenomicRangeMinMaxColumns", "possibleTypes": null }, { "enumValues": [ - { - "name": "index_file" - }, { "name": "reference_genome" }, { - "name": "tool" + "name": "file" }, { - "name": "version" + "name": "sequencing_reads" }, { "name": "entity_id" @@ -7489,13 +7282,22 @@ }, { "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" } ], "fields": null, "inputFields": null, "interfaces": null, "kind": "ENUM", - "name": "SequenceAlignmentIndexCountColumns", + "name": "GenomicRangeCountColumns", "possibleTypes": null }, { @@ -7503,18 +7305,43 @@ "fields": [ { "args": [], - "name": "aggregate", + "name": "pageInfo", "type": { - "kind": "OBJECT", - "name": "ConsensusGenomeAggregateFunctions", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + } + }, + { + "args": [], + "name": "edges", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SequencingReadEdge", + "ofType": null + } + } + } } } ], "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ConsensusGenomeAggregate", + "name": "SequencingReadConnection", "possibleTypes": null }, { @@ -7522,19 +7349,74 @@ "fields": [ { "args": [], - "name": "sum", + "name": "cursor", "type": { - "kind": "OBJECT", - "name": "ConsensusGenomeNumericalColumns", - "ofType": null - } - }, - { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "name": "node", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SequencingRead", + "ofType": null + } + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "SequencingReadEdge", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "aggregate", + "type": { + "kind": "OBJECT", + "name": "SequencingReadAggregateFunctions", + "ofType": null + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "SequencingReadAggregate", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "sum", + "type": { + "kind": "OBJECT", + "name": "SequencingReadNumericalColumns", + "ofType": null + } + }, + { "args": [], "name": "avg", "type": { "kind": "OBJECT", - "name": "ConsensusGenomeNumericalColumns", + "name": "SequencingReadNumericalColumns", "ofType": null } }, @@ -7543,7 +7425,7 @@ "name": "min", "type": { "kind": "OBJECT", - "name": "ConsensusGenomeMinMaxColumns", + "name": "SequencingReadMinMaxColumns", "ofType": null } }, @@ -7552,7 +7434,7 @@ "name": "max", "type": { "kind": "OBJECT", - "name": "ConsensusGenomeMinMaxColumns", + "name": "SequencingReadMinMaxColumns", "ofType": null } }, @@ -7561,7 +7443,7 @@ "name": "stddev", "type": { "kind": "OBJECT", - "name": "ConsensusGenomeNumericalColumns", + "name": "SequencingReadNumericalColumns", "ofType": null } }, @@ -7570,7 +7452,7 @@ "name": "variance", "type": { "kind": "OBJECT", - "name": "ConsensusGenomeNumericalColumns", + "name": "SequencingReadNumericalColumns", "ofType": null } }, @@ -7590,7 +7472,7 @@ "name": "columns", "type": { "kind": "ENUM", - "name": "ConsensusGenomeCountColumns", + "name": "SequencingReadCountColumns", "ofType": null } } @@ -7606,7 +7488,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ConsensusGenomeAggregateFunctions", + "name": "SequencingReadAggregateFunctions", "possibleTypes": null }, { @@ -7643,7 +7525,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ConsensusGenomeNumericalColumns", + "name": "SequencingReadNumericalColumns", "possibleTypes": null }, { @@ -7680,28 +7562,43 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ConsensusGenomeMinMaxColumns", + "name": "SequencingReadMinMaxColumns", "possibleTypes": null }, { "enumValues": [ { - "name": "taxon" + "name": "sample" }, { - "name": "sequence_read" + "name": "protocol" }, { - "name": "reference_genome" + "name": "r1_file" }, { - "name": "sequence" + "name": "r2_file" }, { - "name": "intermediate_outputs" + "name": "technology" }, { - "name": "metrics" + "name": "nucleic_acid" + }, + { + "name": "clearlabs_export" + }, + { + "name": "taxon" + }, + { + "name": "primer_file" + }, + { + "name": "consensus_genomes" + }, + { + "name": "contigs" }, { "name": "entity_id" @@ -7717,13 +7614,22 @@ }, { "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" } ], "fields": null, "inputFields": null, "interfaces": null, "kind": "ENUM", - "name": "ConsensusGenomeCountColumns", + "name": "SequencingReadCountColumns", "possibleTypes": null }, { @@ -7756,7 +7662,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "GenomicRangeEdge", + "name": "ContigEdge", "ofType": null } } @@ -7767,7 +7673,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "GenomicRangeConnection", + "name": "ContigConnection", "possibleTypes": null }, { @@ -7794,7 +7700,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "GenomicRange", + "name": "Contig", "ofType": null } } @@ -7803,7 +7709,121 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "GenomicRangeEdge", + "name": "ContigEdge", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "_id", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GlobalID", + "ofType": null + } + } + }, + { + "args": [], + "name": "id", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + { + "args": [], + "name": "producingRunId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "ownerUserId", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + }, + { + "args": [], + "name": "collectionId", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + }, + { + "args": [ + { + "defaultValue": "null", + "name": "where", + "type": { + "kind": "INPUT_OBJECT", + "name": "SequencingReadWhereClause", + "ofType": null + } + } + ], + "name": "sequencingRead", + "type": { + "kind": "OBJECT", + "name": "SequencingRead", + "ofType": null + } + }, + { + "args": [], + "name": "sequence", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "EntityInterface", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "kind": "OBJECT", + "name": "Contig", "possibleTypes": null }, { @@ -7814,7 +7834,7 @@ "name": "aggregate", "type": { "kind": "OBJECT", - "name": "GenomicRangeAggregateFunctions", + "name": "ContigAggregateFunctions", "ofType": null } } @@ -7822,7 +7842,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "GenomicRangeAggregate", + "name": "ContigAggregate", "possibleTypes": null }, { @@ -7833,7 +7853,7 @@ "name": "sum", "type": { "kind": "OBJECT", - "name": "GenomicRangeNumericalColumns", + "name": "ContigNumericalColumns", "ofType": null } }, @@ -7842,7 +7862,7 @@ "name": "avg", "type": { "kind": "OBJECT", - "name": "GenomicRangeNumericalColumns", + "name": "ContigNumericalColumns", "ofType": null } }, @@ -7851,7 +7871,7 @@ "name": "min", "type": { "kind": "OBJECT", - "name": "GenomicRangeMinMaxColumns", + "name": "ContigMinMaxColumns", "ofType": null } }, @@ -7860,7 +7880,7 @@ "name": "max", "type": { "kind": "OBJECT", - "name": "GenomicRangeMinMaxColumns", + "name": "ContigMinMaxColumns", "ofType": null } }, @@ -7869,7 +7889,7 @@ "name": "stddev", "type": { "kind": "OBJECT", - "name": "GenomicRangeNumericalColumns", + "name": "ContigNumericalColumns", "ofType": null } }, @@ -7878,7 +7898,7 @@ "name": "variance", "type": { "kind": "OBJECT", - "name": "GenomicRangeNumericalColumns", + "name": "ContigNumericalColumns", "ofType": null } }, @@ -7898,7 +7918,7 @@ "name": "columns", "type": { "kind": "ENUM", - "name": "GenomicRangeCountColumns", + "name": "ContigCountColumns", "ofType": null } } @@ -7914,7 +7934,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "GenomicRangeAggregateFunctions", + "name": "ContigAggregateFunctions", "possibleTypes": null }, { @@ -7951,7 +7971,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "GenomicRangeNumericalColumns", + "name": "ContigNumericalColumns", "possibleTypes": null }, { @@ -7983,24 +8003,30 @@ "name": "Int", "ofType": null } + }, + { + "args": [], + "name": "sequence", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } } ], "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "GenomicRangeMinMaxColumns", + "name": "ContigMinMaxColumns", "possibleTypes": null }, { "enumValues": [ { - "name": "reference_genome" - }, - { - "name": "file" + "name": "sequencing_read" }, { - "name": "sequencing_reads" + "name": "sequence" }, { "name": "entity_id" @@ -8016,13 +8042,22 @@ }, { "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" } ], "fields": null, "inputFields": null, "interfaces": null, "kind": "ENUM", - "name": "GenomicRangeCountColumns", + "name": "ContigCountColumns", "possibleTypes": null }, { @@ -8030,198 +8065,150 @@ "fields": [ { "args": [], - "name": "pageInfo", + "name": "_id", "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "PageInfo", + "kind": "SCALAR", + "name": "GlobalID", "ofType": null } } }, { "args": [], - "name": "edges", + "name": "id", "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SequencingReadEdge", - "ofType": null - } - } + "kind": "SCALAR", + "name": "ID", + "ofType": null } } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SequencingReadConnection", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { "args": [], - "name": "cursor", + "name": "producingRunId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "ownerUserId", "type": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null } } }, { "args": [], - "name": "node", + "name": "collectionId", "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "SequencingRead", + "kind": "SCALAR", + "name": "Int", "ofType": null } } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SequencingReadEdge", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { - "args": [], - "name": "aggregate", + "args": [ + { + "defaultValue": "null", + "name": "where", + "type": { + "kind": "INPUT_OBJECT", + "name": "ConsensusGenomeWhereClause", + "ofType": null + } + } + ], + "name": "consensusGenome", "type": { "kind": "OBJECT", - "name": "SequencingReadAggregateFunctions", + "name": "ConsensusGenome", "ofType": null } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SequencingReadAggregate", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { "args": [], - "name": "sum", + "name": "referenceGenomeLength", "type": { - "kind": "OBJECT", - "name": "SequencingReadNumericalColumns", + "kind": "SCALAR", + "name": "Float", "ofType": null } }, { "args": [], - "name": "avg", + "name": "percentGenomeCalled", "type": { - "kind": "OBJECT", - "name": "SequencingReadNumericalColumns", + "kind": "SCALAR", + "name": "Float", "ofType": null } }, { "args": [], - "name": "min", + "name": "percentIdentity", "type": { - "kind": "OBJECT", - "name": "SequencingReadMinMaxColumns", + "kind": "SCALAR", + "name": "Float", "ofType": null } }, { "args": [], - "name": "max", + "name": "gcPercent", "type": { - "kind": "OBJECT", - "name": "SequencingReadMinMaxColumns", + "kind": "SCALAR", + "name": "Float", "ofType": null } }, { "args": [], - "name": "stddev", + "name": "totalReads", "type": { - "kind": "OBJECT", - "name": "SequencingReadNumericalColumns", + "kind": "SCALAR", + "name": "Int", "ofType": null } }, { "args": [], - "name": "variance", + "name": "mappedReads", "type": { - "kind": "OBJECT", - "name": "SequencingReadNumericalColumns", + "kind": "SCALAR", + "name": "Int", "ofType": null } }, { - "args": [ - { - "defaultValue": "false", - "name": "distinct", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "columns", - "type": { - "kind": "ENUM", - "name": "SequencingReadCountColumns", - "ofType": null - } - } - ], - "name": "count", + "args": [], + "name": "refSnps", "type": { "kind": "SCALAR", "name": "Int", "ofType": null } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SequencingReadAggregateFunctions", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { "args": [], - "name": "producingRunId", + "name": "nActg", "type": { "kind": "SCALAR", "name": "Int", @@ -8230,7 +8217,7 @@ }, { "args": [], - "name": "ownerUserId", + "name": "nMissing", "type": { "kind": "SCALAR", "name": "Int", @@ -8239,113 +8226,90 @@ }, { "args": [], - "name": "collectionId", + "name": "nAmbiguous", "type": { "kind": "SCALAR", "name": "Int", "ofType": null } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SequencingReadNumericalColumns", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { "args": [], - "name": "producingRunId", + "name": "coverageDepth", "type": { "kind": "SCALAR", - "name": "Int", + "name": "Float", "ofType": null } }, { "args": [], - "name": "ownerUserId", + "name": "coverageBreadth", "type": { "kind": "SCALAR", - "name": "Int", + "name": "Float", "ofType": null } }, { "args": [], - "name": "collectionId", + "name": "coverageBinSize", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "args": [], + "name": "coverageTotalLength", "type": { "kind": "SCALAR", "name": "Int", "ofType": null } + }, + { + "args": [], + "name": "coverageViz", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + } + } + } } ], "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SequencingReadMinMaxColumns", - "possibleTypes": null - }, - { - "enumValues": [ + "interfaces": [ { - "name": "sample" + "kind": "INTERFACE", + "name": "EntityInterface", + "ofType": null }, { - "name": "protocol" - }, - { - "name": "r1_file" - }, - { - "name": "r2_file" - }, - { - "name": "technology" - }, - { - "name": "nucleic_acid" - }, - { - "name": "has_ercc" - }, - { - "name": "taxon" - }, - { - "name": "primer_file" - }, - { - "name": "consensus_genomes" - }, - { - "name": "contigs" - }, - { - "name": "entity_id" - }, - { - "name": "id" - }, - { - "name": "producing_run_id" - }, - { - "name": "owner_user_id" - }, - { - "name": "collection_id" + "kind": "INTERFACE", + "name": "Node", + "ofType": null } ], - "fields": null, - "inputFields": null, - "interfaces": null, - "kind": "ENUM", - "name": "SequencingReadCountColumns", + "kind": "OBJECT", + "name": "MetricConsensusGenome", "possibleTypes": null }, { @@ -8378,7 +8342,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "ContigEdge", + "name": "ReferenceGenomeEdge", "ofType": null } } @@ -8389,7 +8353,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ContigConnection", + "name": "ReferenceGenomeConnection", "possibleTypes": null }, { @@ -8416,7 +8380,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "Contig", + "name": "ReferenceGenome", "ofType": null } } @@ -8425,121 +8389,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ContigEdge", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ - { - "args": [], - "name": "_id", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "GlobalID", - "ofType": null - } - } - }, - { - "args": [], - "name": "id", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - } - }, - { - "args": [], - "name": "producingRunId", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "ownerUserId", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - } - }, - { - "args": [], - "name": "collectionId", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - } - }, - { - "args": [ - { - "defaultValue": "null", - "name": "where", - "type": { - "kind": "INPUT_OBJECT", - "name": "SequencingReadWhereClause", - "ofType": null - } - } - ], - "name": "sequencingRead", - "type": { - "kind": "OBJECT", - "name": "SequencingRead", - "ofType": null - } - }, - { - "args": [], - "name": "sequence", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "EntityInterface", - "ofType": null - }, - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "kind": "OBJECT", - "name": "Contig", + "name": "ReferenceGenomeEdge", "possibleTypes": null }, { @@ -8550,7 +8400,7 @@ "name": "aggregate", "type": { "kind": "OBJECT", - "name": "ContigAggregateFunctions", + "name": "ReferenceGenomeAggregateFunctions", "ofType": null } } @@ -8558,7 +8408,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ContigAggregate", + "name": "ReferenceGenomeAggregate", "possibleTypes": null }, { @@ -8569,7 +8419,7 @@ "name": "sum", "type": { "kind": "OBJECT", - "name": "ContigNumericalColumns", + "name": "ReferenceGenomeNumericalColumns", "ofType": null } }, @@ -8578,7 +8428,7 @@ "name": "avg", "type": { "kind": "OBJECT", - "name": "ContigNumericalColumns", + "name": "ReferenceGenomeNumericalColumns", "ofType": null } }, @@ -8587,7 +8437,7 @@ "name": "min", "type": { "kind": "OBJECT", - "name": "ContigMinMaxColumns", + "name": "ReferenceGenomeMinMaxColumns", "ofType": null } }, @@ -8596,7 +8446,7 @@ "name": "max", "type": { "kind": "OBJECT", - "name": "ContigMinMaxColumns", + "name": "ReferenceGenomeMinMaxColumns", "ofType": null } }, @@ -8605,7 +8455,7 @@ "name": "stddev", "type": { "kind": "OBJECT", - "name": "ContigNumericalColumns", + "name": "ReferenceGenomeNumericalColumns", "ofType": null } }, @@ -8614,7 +8464,7 @@ "name": "variance", "type": { "kind": "OBJECT", - "name": "ContigNumericalColumns", + "name": "ReferenceGenomeNumericalColumns", "ofType": null } }, @@ -8634,7 +8484,7 @@ "name": "columns", "type": { "kind": "ENUM", - "name": "ContigCountColumns", + "name": "ReferenceGenomeCountColumns", "ofType": null } } @@ -8650,7 +8500,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ContigAggregateFunctions", + "name": "ReferenceGenomeAggregateFunctions", "possibleTypes": null }, { @@ -8687,7 +8537,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ContigNumericalColumns", + "name": "ReferenceGenomeNumericalColumns", "possibleTypes": null }, { @@ -8722,7 +8572,16 @@ }, { "args": [], - "name": "sequence", + "name": "accessionId", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "args": [], + "name": "accessionName", "type": { "kind": "SCALAR", "name": "String", @@ -8733,16 +8592,28 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ContigMinMaxColumns", + "name": "ReferenceGenomeMinMaxColumns", "possibleTypes": null }, { "enumValues": [ { - "name": "sequencing_read" + "name": "file" }, { - "name": "sequence" + "name": "taxon" + }, + { + "name": "accession_id" + }, + { + "name": "accession_name" + }, + { + "name": "consensus_genomes" + }, + { + "name": "genomic_ranges" }, { "name": "entity_id" @@ -8758,13 +8629,22 @@ }, { "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" } ], "fields": null, "inputFields": null, "interfaces": null, "kind": "ENUM", - "name": "ContigCountColumns", + "name": "ReferenceGenomeCountColumns", "possibleTypes": null }, { @@ -8797,7 +8677,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "MetricConsensusGenomeEdge", + "name": "SampleEdge", "ofType": null } } @@ -8808,7 +8688,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "MetricConsensusGenomeConnection", + "name": "SampleConnection", "possibleTypes": null }, { @@ -8835,7 +8715,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "MetricConsensusGenome", + "name": "Sample", "ofType": null } } @@ -8844,7 +8724,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "MetricConsensusGenomeEdge", + "name": "SampleEdge", "possibleTypes": null }, { @@ -8852,246 +8732,18 @@ "fields": [ { "args": [], - "name": "_id", + "name": "aggregate", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "GlobalID", - "ofType": null - } - } - }, - { - "args": [], - "name": "id", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - } - }, - { - "args": [], - "name": "producingRunId", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "ownerUserId", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - } - }, - { - "args": [], - "name": "collectionId", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - } - }, - { - "args": [ - { - "defaultValue": "null", - "name": "where", - "type": { - "kind": "INPUT_OBJECT", - "name": "ConsensusGenomeWhereClause", - "ofType": null - } - } - ], - "name": "consensusGenome", - "type": { - "kind": "OBJECT", - "name": "ConsensusGenome", - "ofType": null - } - }, - { - "args": [], - "name": "coverageDepth", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "referenceGenomeLength", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "percentGenomeCalled", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "percentIdentity", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "gcPercent", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "totalReads", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "mappedReads", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "refSnps", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "nActg", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "nMissing", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "nAmbiguous", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "coverageVizSummaryFileId", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - { - "args": [ - { - "defaultValue": "null", - "name": "where", - "type": { - "kind": "INPUT_OBJECT", - "name": "FileWhereClause", - "ofType": null - } - } - ], - "name": "coverageVizSummaryFile", - "type": { - "kind": "OBJECT", - "name": "File", - "ofType": null - } - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "EntityInterface", - "ofType": null - }, - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "kind": "OBJECT", - "name": "MetricConsensusGenome", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ - { - "args": [], - "name": "aggregate", - "type": { - "kind": "OBJECT", - "name": "MetricConsensusGenomeAggregateFunctions", - "ofType": null + "kind": "OBJECT", + "name": "SampleAggregateFunctions", + "ofType": null } } ], "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "MetricConsensusGenomeAggregate", + "name": "SampleAggregate", "possibleTypes": null }, { @@ -9102,7 +8754,7 @@ "name": "sum", "type": { "kind": "OBJECT", - "name": "MetricConsensusGenomeNumericalColumns", + "name": "SampleNumericalColumns", "ofType": null } }, @@ -9111,7 +8763,7 @@ "name": "avg", "type": { "kind": "OBJECT", - "name": "MetricConsensusGenomeNumericalColumns", + "name": "SampleNumericalColumns", "ofType": null } }, @@ -9120,7 +8772,7 @@ "name": "min", "type": { "kind": "OBJECT", - "name": "MetricConsensusGenomeMinMaxColumns", + "name": "SampleMinMaxColumns", "ofType": null } }, @@ -9129,7 +8781,7 @@ "name": "max", "type": { "kind": "OBJECT", - "name": "MetricConsensusGenomeMinMaxColumns", + "name": "SampleMinMaxColumns", "ofType": null } }, @@ -9138,7 +8790,7 @@ "name": "stddev", "type": { "kind": "OBJECT", - "name": "MetricConsensusGenomeNumericalColumns", + "name": "SampleNumericalColumns", "ofType": null } }, @@ -9147,7 +8799,7 @@ "name": "variance", "type": { "kind": "OBJECT", - "name": "MetricConsensusGenomeNumericalColumns", + "name": "SampleNumericalColumns", "ofType": null } }, @@ -9167,7 +8819,7 @@ "name": "columns", "type": { "kind": "ENUM", - "name": "MetricConsensusGenomeCountColumns", + "name": "SampleCountColumns", "ofType": null } } @@ -9183,7 +8835,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "MetricConsensusGenomeAggregateFunctions", + "name": "SampleAggregateFunctions", "possibleTypes": null }, { @@ -9218,128 +8870,38 @@ }, { "args": [], - "name": "coverageDepth", + "name": "railsSampleId", "type": { "kind": "SCALAR", - "name": "Float", + "name": "Int", "ofType": null } - }, + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "SampleNumericalColumns", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ { "args": [], - "name": "referenceGenomeLength", + "name": "producingRunId", "type": { "kind": "SCALAR", - "name": "Float", + "name": "Int", "ofType": null } }, { "args": [], - "name": "percentGenomeCalled", + "name": "ownerUserId", "type": { "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "percentIdentity", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "gcPercent", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "totalReads", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "mappedReads", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "refSnps", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "nActg", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "nMissing", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "nAmbiguous", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "MetricConsensusGenomeNumericalColumns", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ - { - "args": [], - "name": "producingRunId", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - { - "args": [], - "name": "ownerUserId", - "type": { - "kind": "SCALAR", - "name": "Int", + "name": "Int", "ofType": null } }, @@ -9354,52 +8916,7 @@ }, { "args": [], - "name": "coverageDepth", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "referenceGenomeLength", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "percentGenomeCalled", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "percentIdentity", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "gcPercent", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - { - "args": [], - "name": "totalReads", + "name": "railsSampleId", "type": { "kind": "SCALAR", "name": "Int", @@ -9408,46 +8925,46 @@ }, { "args": [], - "name": "mappedReads", + "name": "name", "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null } }, { "args": [], - "name": "refSnps", + "name": "sampleType", "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null } }, { "args": [], - "name": "nActg", + "name": "collectionDate", "type": { "kind": "SCALAR", - "name": "Int", + "name": "DateTime", "ofType": null } }, { "args": [], - "name": "nMissing", + "name": "collectionLocation", "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null } }, { "args": [], - "name": "nAmbiguous", + "name": "description", "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null } } @@ -9455,71 +8972,71 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "MetricConsensusGenomeMinMaxColumns", + "name": "SampleMinMaxColumns", "possibleTypes": null }, { "enumValues": [ { - "name": "consensus_genome" + "name": "rails_sample_id" }, { - "name": "coverage_depth" + "name": "name" }, { - "name": "reference_genome_length" + "name": "sample_type" }, { - "name": "percent_genome_called" + "name": "water_control" }, { - "name": "percent_identity" + "name": "collection_date" }, { - "name": "gc_percent" + "name": "collection_location" }, { - "name": "total_reads" + "name": "description" }, { - "name": "mapped_reads" + "name": "host_taxon" }, { - "name": "ref_snps" + "name": "sequencing_reads" }, { - "name": "n_actg" + "name": "metadatas" }, { - "name": "n_missing" + "name": "entity_id" }, { - "name": "n_ambiguous" + "name": "id" }, { - "name": "coverage_viz_summary_file" + "name": "producing_run_id" }, { - "name": "entity_id" + "name": "owner_user_id" }, { - "name": "id" + "name": "collection_id" }, { - "name": "producing_run_id" + "name": "created_at" }, { - "name": "owner_user_id" + "name": "updated_at" }, { - "name": "collection_id" + "name": "deleted_at" } ], "fields": null, "inputFields": null, "interfaces": null, "kind": "ENUM", - "name": "MetricConsensusGenomeCountColumns", + "name": "SampleCountColumns", "possibleTypes": null }, { @@ -9552,7 +9069,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "ReferenceGenomeEdge", + "name": "MetadatumEdge", "ofType": null } } @@ -9563,7 +9080,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ReferenceGenomeConnection", + "name": "MetadatumConnection", "possibleTypes": null }, { @@ -9590,7 +9107,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "ReferenceGenome", + "name": "Metadatum", "ofType": null } } @@ -9599,7 +9116,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ReferenceGenomeEdge", + "name": "MetadatumEdge", "possibleTypes": null }, { @@ -9607,56 +9124,183 @@ "fields": [ { "args": [], - "name": "aggregate", + "name": "_id", "type": { - "kind": "OBJECT", - "name": "ReferenceGenomeAggregateFunctions", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GlobalID", + "ofType": null + } } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "ReferenceGenomeAggregate", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { "args": [], - "name": "sum", + "name": "id", "type": { - "kind": "OBJECT", - "name": "ReferenceGenomeNumericalColumns", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } } }, { "args": [], - "name": "avg", + "name": "producingRunId", "type": { - "kind": "OBJECT", - "name": "ReferenceGenomeNumericalColumns", + "kind": "SCALAR", + "name": "Int", "ofType": null } }, { "args": [], - "name": "min", + "name": "ownerUserId", "type": { - "kind": "OBJECT", - "name": "ReferenceGenomeMinMaxColumns", - "ofType": null - } + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + }, + { + "args": [], + "name": "collectionId", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + }, + { + "args": [ + { + "defaultValue": "null", + "name": "where", + "type": { + "kind": "INPUT_OBJECT", + "name": "SampleWhereClause", + "ofType": null + } + } + ], + "name": "sample", + "type": { + "kind": "OBJECT", + "name": "Sample", + "ofType": null + } + }, + { + "args": [], + "name": "fieldName", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "name": "value", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "EntityInterface", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "kind": "OBJECT", + "name": "Metadatum", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "aggregate", + "type": { + "kind": "OBJECT", + "name": "MetadatumAggregateFunctions", + "ofType": null + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "MetadatumAggregate", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "sum", + "type": { + "kind": "OBJECT", + "name": "MetadatumNumericalColumns", + "ofType": null + } + }, + { + "args": [], + "name": "avg", + "type": { + "kind": "OBJECT", + "name": "MetadatumNumericalColumns", + "ofType": null + } + }, + { + "args": [], + "name": "min", + "type": { + "kind": "OBJECT", + "name": "MetadatumMinMaxColumns", + "ofType": null + } }, { "args": [], "name": "max", "type": { "kind": "OBJECT", - "name": "ReferenceGenomeMinMaxColumns", + "name": "MetadatumMinMaxColumns", "ofType": null } }, @@ -9665,7 +9309,7 @@ "name": "stddev", "type": { "kind": "OBJECT", - "name": "ReferenceGenomeNumericalColumns", + "name": "MetadatumNumericalColumns", "ofType": null } }, @@ -9674,7 +9318,7 @@ "name": "variance", "type": { "kind": "OBJECT", - "name": "ReferenceGenomeNumericalColumns", + "name": "MetadatumNumericalColumns", "ofType": null } }, @@ -9694,7 +9338,7 @@ "name": "columns", "type": { "kind": "ENUM", - "name": "ReferenceGenomeCountColumns", + "name": "MetadatumCountColumns", "ofType": null } } @@ -9710,7 +9354,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ReferenceGenomeAggregateFunctions", + "name": "MetadatumAggregateFunctions", "possibleTypes": null }, { @@ -9747,7 +9391,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ReferenceGenomeNumericalColumns", + "name": "MetadatumNumericalColumns", "possibleTypes": null }, { @@ -9782,16 +9426,7 @@ }, { "args": [], - "name": "name", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "args": [], - "name": "description", + "name": "fieldName", "type": { "kind": "SCALAR", "name": "String", @@ -9800,7 +9435,7 @@ }, { "args": [], - "name": "accessionId", + "name": "value", "type": { "kind": "SCALAR", "name": "String", @@ -9811,59 +9446,50 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "ReferenceGenomeMinMaxColumns", + "name": "MetadatumMinMaxColumns", "possibleTypes": null }, { "enumValues": [ { - "name": "file" - }, - { - "name": "file_index" - }, - { - "name": "name" - }, - { - "name": "description" + "name": "sample" }, { - "name": "taxon" + "name": "field_name" }, { - "name": "accession_id" + "name": "value" }, { - "name": "sequence_alignment_indices" + "name": "entity_id" }, { - "name": "consensus_genomes" + "name": "id" }, { - "name": "genomic_ranges" + "name": "producing_run_id" }, { - "name": "entity_id" + "name": "owner_user_id" }, { - "name": "id" + "name": "collection_id" }, { - "name": "producing_run_id" + "name": "created_at" }, { - "name": "owner_user_id" + "name": "updated_at" }, { - "name": "collection_id" + "name": "deleted_at" } ], "fields": null, "inputFields": null, "interfaces": null, "kind": "ENUM", - "name": "ReferenceGenomeCountColumns", + "name": "MetadatumCountColumns", "possibleTypes": null }, { @@ -9871,227 +9497,227 @@ "fields": [ { "args": [], - "name": "pageInfo", + "name": "_id", "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "PageInfo", + "kind": "SCALAR", + "name": "GlobalID", "ofType": null } } }, { "args": [], - "name": "edges", + "name": "id", "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SampleEdge", - "ofType": null - } - } + "kind": "SCALAR", + "name": "ID", + "ofType": null } } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SampleConnection", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { "args": [], - "name": "cursor", + "name": "producingRunId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "ownerUserId", "type": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null } } }, { "args": [], - "name": "node", + "name": "collectionId", "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "Sample", + "kind": "SCALAR", + "name": "Int", "ofType": null } } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SampleEdge", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { "args": [], - "name": "aggregate", + "name": "name", "type": { - "kind": "OBJECT", - "name": "SampleAggregateFunctions", - "ofType": null - } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SampleAggregate", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ - { - "args": [], - "name": "sum", - "type": { - "kind": "OBJECT", - "name": "SampleNumericalColumns", - "ofType": null - } - }, - { - "args": [], - "name": "avg", - "type": { - "kind": "OBJECT", - "name": "SampleNumericalColumns", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } } }, { "args": [], - "name": "min", + "name": "version", "type": { - "kind": "OBJECT", - "name": "SampleMinMaxColumns", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } } }, { "args": [], - "name": "max", + "name": "hostFilteringId", "type": { - "kind": "OBJECT", - "name": "SampleMinMaxColumns", + "kind": "SCALAR", + "name": "ID", "ofType": null } }, { - "args": [], - "name": "stddev", + "args": [ + { + "defaultValue": "null", + "name": "where", + "type": { + "kind": "INPUT_OBJECT", + "name": "FileWhereClause", + "ofType": null + } + } + ], + "name": "hostFiltering", "type": { "kind": "OBJECT", - "name": "SampleNumericalColumns", + "name": "File", "ofType": null } }, { "args": [], - "name": "variance", + "name": "sequenceId", "type": { - "kind": "OBJECT", - "name": "SampleNumericalColumns", + "kind": "SCALAR", + "name": "ID", "ofType": null } }, { "args": [ - { - "defaultValue": "false", - "name": "distinct", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, { "defaultValue": "null", - "name": "columns", + "name": "where", "type": { - "kind": "ENUM", - "name": "SampleCountColumns", + "kind": "INPUT_OBJECT", + "name": "FileWhereClause", "ofType": null } } ], - "name": "count", + "name": "sequence", "type": { - "kind": "SCALAR", - "name": "Int", + "kind": "OBJECT", + "name": "File", "ofType": null } } ], "inputFields": null, - "interfaces": [], + "interfaces": [ + { + "kind": "INTERFACE", + "name": "EntityInterface", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], "kind": "OBJECT", - "name": "SampleAggregateFunctions", + "name": "HostOrganism", "possibleTypes": null }, { "enumValues": null, - "fields": [ + "fields": null, + "inputFields": [ { - "args": [], + "defaultValue": null, + "name": "id", + "type": { + "kind": "INPUT_OBJECT", + "name": "UUIDComparators", + "ofType": null + } + }, + { + "defaultValue": null, "name": "producingRunId", "type": { - "kind": "SCALAR", - "name": "Int", + "kind": "INPUT_OBJECT", + "name": "IntComparators", "ofType": null } }, { - "args": [], + "defaultValue": null, "name": "ownerUserId", "type": { - "kind": "SCALAR", - "name": "Int", + "kind": "INPUT_OBJECT", + "name": "IntComparators", "ofType": null } }, { - "args": [], + "defaultValue": null, "name": "collectionId", "type": { - "kind": "SCALAR", - "name": "Int", + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "name", + "type": { + "kind": "INPUT_OBJECT", + "name": "StrComparators", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "version", + "type": { + "kind": "INPUT_OBJECT", + "name": "StrComparators", "ofType": null } } ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SampleNumericalColumns", + "interfaces": null, + "kind": "INPUT_OBJECT", + "name": "HostOrganismWhereClause", "possibleTypes": null }, { @@ -10099,25 +9725,33 @@ "fields": [ { "args": [], - "name": "producingRunId", + "name": "_id", "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "GlobalID", + "ofType": null + } } }, { "args": [], - "name": "ownerUserId", + "name": "id", "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } } }, { "args": [], - "name": "collectionId", + "name": "producingRunId", "type": { "kind": "SCALAR", "name": "Int", @@ -10126,186 +9760,268 @@ }, { "args": [], - "name": "name", + "name": "ownerUserId", "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } } }, { "args": [], - "name": "sampleType", + "name": "collectionId", "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } } }, { "args": [], - "name": "collectionDate", + "name": "treeId", "type": { "kind": "SCALAR", - "name": "DateTime", + "name": "ID", "ofType": null } }, { - "args": [], - "name": "collectionLocation", + "args": [ + { + "defaultValue": "null", + "name": "where", + "type": { + "kind": "INPUT_OBJECT", + "name": "FileWhereClause", + "ofType": null + } + } + ], + "name": "tree", "type": { - "kind": "SCALAR", - "name": "String", + "kind": "OBJECT", + "name": "File", "ofType": null } }, { "args": [], - "name": "description", + "name": "format", "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null + } } } ], "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "SampleMinMaxColumns", - "possibleTypes": null - }, - { - "enumValues": [ + "interfaces": [ { - "name": "name" - }, - { - "name": "sample_type" - }, - { - "name": "water_control" - }, - { - "name": "collection_date" - }, - { - "name": "collection_location" + "kind": "INTERFACE", + "name": "EntityInterface", + "ofType": null }, { - "name": "description" - }, + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "kind": "OBJECT", + "name": "PhylogeneticTree", + "possibleTypes": null + }, + { + "enumValues": [ { - "name": "host_taxon" + "name": "newick" }, { - "name": "sequencing_reads" + "name": "auspice_v1" }, { - "name": "metadatas" - }, + "name": "auspice_v2" + } + ], + "fields": null, + "inputFields": null, + "interfaces": null, + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": null, + "inputFields": [ { - "name": "entity_id" + "defaultValue": null, + "name": "id", + "type": { + "kind": "INPUT_OBJECT", + "name": "UUIDComparators", + "ofType": null + } }, { - "name": "id" + "defaultValue": null, + "name": "producingRunId", + "type": { + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null + } }, { - "name": "producing_run_id" + "defaultValue": null, + "name": "ownerUserId", + "type": { + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null + } }, { - "name": "owner_user_id" + "defaultValue": null, + "name": "collectionId", + "type": { + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null + } }, { - "name": "collection_id" + "defaultValue": null, + "name": "format", + "type": { + "kind": "INPUT_OBJECT", + "name": "PhylogeneticTreeFormatEnumComparators", + "ofType": null + } } ], - "fields": null, - "inputFields": null, "interfaces": null, - "kind": "ENUM", - "name": "SampleCountColumns", + "kind": "INPUT_OBJECT", + "name": "PhylogeneticTreeWhereClause", "possibleTypes": null }, { "enumValues": null, - "fields": [ + "fields": null, + "inputFields": [ { - "args": [], - "name": "pageInfo", + "defaultValue": null, + "name": "_eq", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null } }, { - "args": [], - "name": "edges", + "defaultValue": null, + "name": "_neq", "type": { - "kind": "NON_NULL", + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_in", + "type": { + "kind": "LIST", "name": null, "ofType": { - "kind": "LIST", + "kind": "NON_NULL", "name": null, "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "MetadatumEdge", - "ofType": null - } + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null } } } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "MetadatumConnection", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { - "args": [], - "name": "cursor", + "defaultValue": null, + "name": "_nin", "type": { - "kind": "NON_NULL", + "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null + } } } }, { - "args": [], - "name": "node", + "defaultValue": null, + "name": "_gt", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Metadatum", - "ofType": null - } + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_gte", + "type": { + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_lt", + "type": { + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_lte", + "type": { + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_is_null", + "type": { + "kind": "ENUM", + "name": "PhylogeneticTreeFormat", + "ofType": null } } ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "MetadatumEdge", + "interfaces": null, + "kind": "INPUT_OBJECT", + "name": "PhylogeneticTreeFormatEnumComparators", "possibleTypes": null }, { @@ -10372,6 +10088,28 @@ } } }, + { + "args": [], + "name": "downloadType", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } + } + }, + { + "args": [], + "name": "fileId", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, { "args": [ { @@ -10379,60 +10117,212 @@ "name": "where", "type": { "kind": "INPUT_OBJECT", - "name": "SampleWhereClause", + "name": "FileWhereClause", "ofType": null } } ], - "name": "sample", + "name": "file", "type": { "kind": "OBJECT", - "name": "Sample", + "name": "File", "ofType": null } - }, + } + ], + "inputFields": null, + "interfaces": [ { - "args": [], - "name": "fieldName", + "kind": "INTERFACE", + "name": "EntityInterface", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "kind": "OBJECT", + "name": "BulkDownload", + "possibleTypes": null + }, + { + "enumValues": [ + { + "name": "concatenate" + }, + { + "name": "zip" + } + ], + "fields": null, + "inputFields": null, + "interfaces": null, + "kind": "ENUM", + "name": "BulkDownloadType", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": null, + "inputFields": [ + { + "defaultValue": null, + "name": "id", "type": { - "kind": "NON_NULL", + "kind": "INPUT_OBJECT", + "name": "UUIDComparators", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "producingRunId", + "type": { + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "ownerUserId", + "type": { + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "collectionId", + "type": { + "kind": "INPUT_OBJECT", + "name": "IntComparators", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "downloadType", + "type": { + "kind": "INPUT_OBJECT", + "name": "BulkDownloadTypeEnumComparators", + "ofType": null + } + } + ], + "interfaces": null, + "kind": "INPUT_OBJECT", + "name": "BulkDownloadWhereClause", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": null, + "inputFields": [ + { + "defaultValue": null, + "name": "_eq", + "type": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_neq", + "type": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_in", + "type": { + "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } } } }, { - "args": [], - "name": "value", + "defaultValue": null, + "name": "_nin", "type": { - "kind": "NON_NULL", + "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } } } - } - ], - "inputFields": null, - "interfaces": [ + }, { - "kind": "INTERFACE", - "name": "EntityInterface", - "ofType": null + "defaultValue": null, + "name": "_gt", + "type": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } }, { - "kind": "INTERFACE", - "name": "Node", - "ofType": null + "defaultValue": null, + "name": "_gte", + "type": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_lt", + "type": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_lte", + "type": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } + }, + { + "defaultValue": null, + "name": "_is_null", + "type": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } } ], - "kind": "OBJECT", - "name": "Metadatum", + "interfaces": null, + "kind": "INPUT_OBJECT", + "name": "BulkDownloadTypeEnumComparators", "possibleTypes": null }, { @@ -10443,7 +10333,7 @@ "name": "aggregate", "type": { "kind": "OBJECT", - "name": "MetadatumAggregateFunctions", + "name": "HostOrganismAggregateFunctions", "ofType": null } } @@ -10451,7 +10341,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "MetadatumAggregate", + "name": "HostOrganismAggregate", "possibleTypes": null }, { @@ -10462,96 +10352,589 @@ "name": "sum", "type": { "kind": "OBJECT", - "name": "MetadatumNumericalColumns", + "name": "HostOrganismNumericalColumns", + "ofType": null + } + }, + { + "args": [], + "name": "avg", + "type": { + "kind": "OBJECT", + "name": "HostOrganismNumericalColumns", + "ofType": null + } + }, + { + "args": [], + "name": "min", + "type": { + "kind": "OBJECT", + "name": "HostOrganismMinMaxColumns", + "ofType": null + } + }, + { + "args": [], + "name": "max", + "type": { + "kind": "OBJECT", + "name": "HostOrganismMinMaxColumns", + "ofType": null + } + }, + { + "args": [], + "name": "stddev", + "type": { + "kind": "OBJECT", + "name": "HostOrganismNumericalColumns", + "ofType": null + } + }, + { + "args": [], + "name": "variance", + "type": { + "kind": "OBJECT", + "name": "HostOrganismNumericalColumns", + "ofType": null + } + }, + { + "args": [ + { + "defaultValue": "false", + "name": "distinct", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "columns", + "type": { + "kind": "ENUM", + "name": "HostOrganismCountColumns", + "ofType": null + } + } + ], + "name": "count", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "HostOrganismAggregateFunctions", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "producingRunId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "ownerUserId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "collectionId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "HostOrganismNumericalColumns", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "producingRunId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "ownerUserId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "collectionId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "name", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "args": [], + "name": "version", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "HostOrganismMinMaxColumns", + "possibleTypes": null + }, + { + "enumValues": [ + { + "name": "name" + }, + { + "name": "version" + }, + { + "name": "host_filtering" + }, + { + "name": "sequence" + }, + { + "name": "entity_id" + }, + { + "name": "id" + }, + { + "name": "producing_run_id" + }, + { + "name": "owner_user_id" + }, + { + "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" + } + ], + "fields": null, + "inputFields": null, + "interfaces": null, + "kind": "ENUM", + "name": "HostOrganismCountColumns", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "aggregate", + "type": { + "kind": "OBJECT", + "name": "MetricConsensusGenomeAggregateFunctions", + "ofType": null + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "MetricConsensusGenomeAggregate", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "sum", + "type": { + "kind": "OBJECT", + "name": "MetricConsensusGenomeNumericalColumns", + "ofType": null + } + }, + { + "args": [], + "name": "avg", + "type": { + "kind": "OBJECT", + "name": "MetricConsensusGenomeNumericalColumns", + "ofType": null + } + }, + { + "args": [], + "name": "min", + "type": { + "kind": "OBJECT", + "name": "MetricConsensusGenomeMinMaxColumns", + "ofType": null + } + }, + { + "args": [], + "name": "max", + "type": { + "kind": "OBJECT", + "name": "MetricConsensusGenomeMinMaxColumns", + "ofType": null + } + }, + { + "args": [], + "name": "stddev", + "type": { + "kind": "OBJECT", + "name": "MetricConsensusGenomeNumericalColumns", + "ofType": null + } + }, + { + "args": [], + "name": "variance", + "type": { + "kind": "OBJECT", + "name": "MetricConsensusGenomeNumericalColumns", + "ofType": null + } + }, + { + "args": [ + { + "defaultValue": "false", + "name": "distinct", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "columns", + "type": { + "kind": "ENUM", + "name": "MetricConsensusGenomeCountColumns", + "ofType": null + } + } + ], + "name": "count", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "MetricConsensusGenomeAggregateFunctions", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "producingRunId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "ownerUserId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "collectionId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "referenceGenomeLength", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "args": [], + "name": "percentGenomeCalled", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "args": [], + "name": "percentIdentity", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "args": [], + "name": "gcPercent", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "args": [], + "name": "totalReads", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "mappedReads", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "refSnps", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "nActg", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "nMissing", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "nAmbiguous", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "coverageDepth", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "args": [], + "name": "coverageBreadth", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "args": [], + "name": "coverageBinSize", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "args": [], + "name": "coverageTotalLength", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "MetricConsensusGenomeNumericalColumns", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ + { + "args": [], + "name": "producingRunId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "ownerUserId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "args": [], + "name": "collectionId", + "type": { + "kind": "SCALAR", + "name": "Int", "ofType": null } }, { "args": [], - "name": "avg", + "name": "referenceGenomeLength", "type": { - "kind": "OBJECT", - "name": "MetadatumNumericalColumns", + "kind": "SCALAR", + "name": "Float", "ofType": null } }, { "args": [], - "name": "min", + "name": "percentGenomeCalled", "type": { - "kind": "OBJECT", - "name": "MetadatumMinMaxColumns", + "kind": "SCALAR", + "name": "Float", "ofType": null } }, { "args": [], - "name": "max", + "name": "percentIdentity", "type": { - "kind": "OBJECT", - "name": "MetadatumMinMaxColumns", + "kind": "SCALAR", + "name": "Float", "ofType": null } }, { "args": [], - "name": "stddev", + "name": "gcPercent", "type": { - "kind": "OBJECT", - "name": "MetadatumNumericalColumns", + "kind": "SCALAR", + "name": "Float", "ofType": null } }, { "args": [], - "name": "variance", + "name": "totalReads", "type": { - "kind": "OBJECT", - "name": "MetadatumNumericalColumns", + "kind": "SCALAR", + "name": "Int", "ofType": null } }, { - "args": [ - { - "defaultValue": "false", - "name": "distinct", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "columns", - "type": { - "kind": "ENUM", - "name": "MetadatumCountColumns", - "ofType": null - } - } - ], - "name": "count", + "args": [], + "name": "mappedReads", "type": { "kind": "SCALAR", "name": "Int", "ofType": null } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "MetadatumAggregateFunctions", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { "args": [], - "name": "producingRunId", + "name": "refSnps", "type": { "kind": "SCALAR", "name": "Int", @@ -10560,7 +10943,7 @@ }, { "args": [], - "name": "ownerUserId", + "name": "nActg", "type": { "kind": "SCALAR", "name": "Int", @@ -10569,26 +10952,16 @@ }, { "args": [], - "name": "collectionId", + "name": "nMissing", "type": { "kind": "SCALAR", "name": "Int", "ofType": null } - } - ], - "inputFields": null, - "interfaces": [], - "kind": "OBJECT", - "name": "MetadatumNumericalColumns", - "possibleTypes": null - }, - { - "enumValues": null, - "fields": [ + }, { "args": [], - "name": "producingRunId", + "name": "nAmbiguous", "type": { "kind": "SCALAR", "name": "Int", @@ -10597,37 +10970,37 @@ }, { "args": [], - "name": "ownerUserId", + "name": "coverageDepth", "type": { "kind": "SCALAR", - "name": "Int", + "name": "Float", "ofType": null } }, { "args": [], - "name": "collectionId", + "name": "coverageBreadth", "type": { "kind": "SCALAR", - "name": "Int", + "name": "Float", "ofType": null } }, { "args": [], - "name": "fieldName", + "name": "coverageBinSize", "type": { "kind": "SCALAR", - "name": "String", + "name": "Float", "ofType": null } }, { "args": [], - "name": "value", + "name": "coverageTotalLength", "type": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null } } @@ -10635,19 +11008,58 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "MetadatumMinMaxColumns", + "name": "MetricConsensusGenomeMinMaxColumns", "possibleTypes": null }, { "enumValues": [ { - "name": "sample" + "name": "consensus_genome" }, { - "name": "field_name" + "name": "reference_genome_length" }, { - "name": "value" + "name": "percent_genome_called" + }, + { + "name": "percent_identity" + }, + { + "name": "gc_percent" + }, + { + "name": "total_reads" + }, + { + "name": "mapped_reads" + }, + { + "name": "ref_snps" + }, + { + "name": "n_actg" + }, + { + "name": "n_missing" + }, + { + "name": "n_ambiguous" + }, + { + "name": "coverage_depth" + }, + { + "name": "coverage_breadth" + }, + { + "name": "coverage_bin_size" + }, + { + "name": "coverage_total_length" + }, + { + "name": "coverage_viz" }, { "name": "entity_id" @@ -10663,13 +11075,22 @@ }, { "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" } ], "fields": null, "inputFields": null, "interfaces": null, "kind": "ENUM", - "name": "MetadatumCountColumns", + "name": "MetricConsensusGenomeCountColumns", "possibleTypes": null }, { @@ -10677,303 +11098,233 @@ "fields": [ { "args": [], - "name": "_id", + "name": "aggregate", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "GlobalID", - "ofType": null - } + "kind": "OBJECT", + "name": "UpstreamDatabaseAggregateFunctions", + "ofType": null } - }, + } + ], + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "UpstreamDatabaseAggregate", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": [ { "args": [], - "name": "id", + "name": "sum", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "OBJECT", + "name": "UpstreamDatabaseNumericalColumns", + "ofType": null } }, { "args": [], - "name": "producingRunId", + "name": "avg", "type": { - "kind": "SCALAR", - "name": "Int", + "kind": "OBJECT", + "name": "UpstreamDatabaseNumericalColumns", "ofType": null } }, { "args": [], - "name": "ownerUserId", + "name": "min", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } + "kind": "OBJECT", + "name": "UpstreamDatabaseMinMaxColumns", + "ofType": null } }, { "args": [], - "name": "collectionId", + "name": "max", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } + "kind": "OBJECT", + "name": "UpstreamDatabaseMinMaxColumns", + "ofType": null } }, { "args": [], - "name": "treeId", + "name": "stddev", "type": { - "kind": "SCALAR", - "name": "ID", + "kind": "OBJECT", + "name": "UpstreamDatabaseNumericalColumns", "ofType": null } }, { - "args": [ - { - "defaultValue": "null", - "name": "where", - "type": { - "kind": "INPUT_OBJECT", - "name": "FileWhereClause", - "ofType": null - } - } - ], - "name": "tree", + "args": [], + "name": "variance", "type": { "kind": "OBJECT", - "name": "File", + "name": "UpstreamDatabaseNumericalColumns", "ofType": null } }, { - "args": [], - "name": "format", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null + "args": [ + { + "defaultValue": "false", + "name": "distinct", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "columns", + "type": { + "kind": "ENUM", + "name": "UpstreamDatabaseCountColumns", + "ofType": null + } } + ], + "name": "count", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null } } ], "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "EntityInterface", - "ofType": null - }, - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], + "interfaces": [], "kind": "OBJECT", - "name": "PhylogeneticTree", + "name": "UpstreamDatabaseAggregateFunctions", "possibleTypes": null }, { - "enumValues": [ + "enumValues": null, + "fields": [ { - "name": "newick" + "args": [], + "name": "producingRunId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } }, { - "name": "auspice_v1" + "args": [], + "name": "ownerUserId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } }, { - "name": "auspice_v2" + "args": [], + "name": "collectionId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } } ], - "fields": null, "inputFields": null, - "interfaces": null, - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", + "interfaces": [], + "kind": "OBJECT", + "name": "UpstreamDatabaseNumericalColumns", "possibleTypes": null }, { "enumValues": null, - "fields": null, - "inputFields": [ - { - "defaultValue": null, - "name": "id", - "type": { - "kind": "INPUT_OBJECT", - "name": "UUIDComparators", - "ofType": null - } - }, + "fields": [ { - "defaultValue": null, + "args": [], "name": "producingRunId", "type": { - "kind": "INPUT_OBJECT", - "name": "IntComparators", + "kind": "SCALAR", + "name": "Int", "ofType": null } }, { - "defaultValue": null, + "args": [], "name": "ownerUserId", "type": { - "kind": "INPUT_OBJECT", - "name": "IntComparators", + "kind": "SCALAR", + "name": "Int", "ofType": null } }, { - "defaultValue": null, + "args": [], "name": "collectionId", "type": { - "kind": "INPUT_OBJECT", - "name": "IntComparators", + "kind": "SCALAR", + "name": "Int", "ofType": null } }, { - "defaultValue": null, - "name": "format", + "args": [], + "name": "name", "type": { - "kind": "INPUT_OBJECT", - "name": "PhylogeneticTreeFormatEnumComparators", + "kind": "SCALAR", + "name": "String", "ofType": null } } ], - "interfaces": null, - "kind": "INPUT_OBJECT", - "name": "PhylogeneticTreeWhereClause", + "inputFields": null, + "interfaces": [], + "kind": "OBJECT", + "name": "UpstreamDatabaseMinMaxColumns", "possibleTypes": null }, { - "enumValues": null, - "fields": null, - "inputFields": [ + "enumValues": [ { - "defaultValue": null, - "name": "_eq", - "type": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null - } + "name": "name" }, { - "defaultValue": null, - "name": "_neq", - "type": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null - } + "name": "taxa" }, { - "defaultValue": null, - "name": "_in", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null - } - } - } + "name": "entity_id" }, { - "defaultValue": null, - "name": "_nin", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null - } - } - } + "name": "id" }, { - "defaultValue": null, - "name": "_gt", - "type": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null - } + "name": "producing_run_id" }, { - "defaultValue": null, - "name": "_gte", - "type": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null - } + "name": "owner_user_id" }, { - "defaultValue": null, - "name": "_lt", - "type": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null - } + "name": "collection_id" }, { - "defaultValue": null, - "name": "_lte", - "type": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null - } + "name": "created_at" }, { - "defaultValue": null, - "name": "_is_null", - "type": { - "kind": "ENUM", - "name": "PhylogeneticTreeFormat", - "ofType": null - } + "name": "updated_at" + }, + { + "name": "deleted_at" } ], + "fields": null, + "inputFields": null, "interfaces": null, - "kind": "INPUT_OBJECT", - "name": "PhylogeneticTreeFormatEnumComparators", + "kind": "ENUM", + "name": "UpstreamDatabaseCountColumns", "possibleTypes": null }, { @@ -10984,7 +11335,7 @@ "name": "aggregate", "type": { "kind": "OBJECT", - "name": "UpstreamDatabaseAggregateFunctions", + "name": "PhylogeneticTreeAggregateFunctions", "ofType": null } } @@ -10992,7 +11343,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "UpstreamDatabaseAggregate", + "name": "PhylogeneticTreeAggregate", "possibleTypes": null }, { @@ -11003,7 +11354,7 @@ "name": "sum", "type": { "kind": "OBJECT", - "name": "UpstreamDatabaseNumericalColumns", + "name": "PhylogeneticTreeNumericalColumns", "ofType": null } }, @@ -11012,7 +11363,7 @@ "name": "avg", "type": { "kind": "OBJECT", - "name": "UpstreamDatabaseNumericalColumns", + "name": "PhylogeneticTreeNumericalColumns", "ofType": null } }, @@ -11021,7 +11372,7 @@ "name": "min", "type": { "kind": "OBJECT", - "name": "UpstreamDatabaseMinMaxColumns", + "name": "PhylogeneticTreeMinMaxColumns", "ofType": null } }, @@ -11030,7 +11381,7 @@ "name": "max", "type": { "kind": "OBJECT", - "name": "UpstreamDatabaseMinMaxColumns", + "name": "PhylogeneticTreeMinMaxColumns", "ofType": null } }, @@ -11039,7 +11390,7 @@ "name": "stddev", "type": { "kind": "OBJECT", - "name": "UpstreamDatabaseNumericalColumns", + "name": "PhylogeneticTreeNumericalColumns", "ofType": null } }, @@ -11048,7 +11399,7 @@ "name": "variance", "type": { "kind": "OBJECT", - "name": "UpstreamDatabaseNumericalColumns", + "name": "PhylogeneticTreeNumericalColumns", "ofType": null } }, @@ -11068,7 +11419,7 @@ "name": "columns", "type": { "kind": "ENUM", - "name": "UpstreamDatabaseCountColumns", + "name": "PhylogeneticTreeCountColumns", "ofType": null } } @@ -11084,7 +11435,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "UpstreamDatabaseAggregateFunctions", + "name": "PhylogeneticTreeAggregateFunctions", "possibleTypes": null }, { @@ -11121,7 +11472,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "UpstreamDatabaseNumericalColumns", + "name": "PhylogeneticTreeNumericalColumns", "possibleTypes": null }, { @@ -11153,30 +11504,21 @@ "name": "Int", "ofType": null } - }, - { - "args": [], - "name": "name", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } } ], "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "UpstreamDatabaseMinMaxColumns", + "name": "PhylogeneticTreeMinMaxColumns", "possibleTypes": null }, { "enumValues": [ { - "name": "name" + "name": "tree" }, { - "name": "taxa" + "name": "format" }, { "name": "entity_id" @@ -11192,13 +11534,22 @@ }, { "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" } ], "fields": null, "inputFields": null, "interfaces": null, "kind": "ENUM", - "name": "UpstreamDatabaseCountColumns", + "name": "PhylogeneticTreeCountColumns", "possibleTypes": null }, { @@ -11209,7 +11560,7 @@ "name": "aggregate", "type": { "kind": "OBJECT", - "name": "PhylogeneticTreeAggregateFunctions", + "name": "BulkDownloadAggregateFunctions", "ofType": null } } @@ -11217,7 +11568,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "PhylogeneticTreeAggregate", + "name": "BulkDownloadAggregate", "possibleTypes": null }, { @@ -11228,7 +11579,7 @@ "name": "sum", "type": { "kind": "OBJECT", - "name": "PhylogeneticTreeNumericalColumns", + "name": "BulkDownloadNumericalColumns", "ofType": null } }, @@ -11237,7 +11588,7 @@ "name": "avg", "type": { "kind": "OBJECT", - "name": "PhylogeneticTreeNumericalColumns", + "name": "BulkDownloadNumericalColumns", "ofType": null } }, @@ -11246,7 +11597,7 @@ "name": "min", "type": { "kind": "OBJECT", - "name": "PhylogeneticTreeMinMaxColumns", + "name": "BulkDownloadMinMaxColumns", "ofType": null } }, @@ -11255,7 +11606,7 @@ "name": "max", "type": { "kind": "OBJECT", - "name": "PhylogeneticTreeMinMaxColumns", + "name": "BulkDownloadMinMaxColumns", "ofType": null } }, @@ -11264,7 +11615,7 @@ "name": "stddev", "type": { "kind": "OBJECT", - "name": "PhylogeneticTreeNumericalColumns", + "name": "BulkDownloadNumericalColumns", "ofType": null } }, @@ -11273,7 +11624,7 @@ "name": "variance", "type": { "kind": "OBJECT", - "name": "PhylogeneticTreeNumericalColumns", + "name": "BulkDownloadNumericalColumns", "ofType": null } }, @@ -11293,7 +11644,7 @@ "name": "columns", "type": { "kind": "ENUM", - "name": "PhylogeneticTreeCountColumns", + "name": "BulkDownloadCountColumns", "ofType": null } } @@ -11309,7 +11660,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "PhylogeneticTreeAggregateFunctions", + "name": "BulkDownloadAggregateFunctions", "possibleTypes": null }, { @@ -11346,7 +11697,7 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "PhylogeneticTreeNumericalColumns", + "name": "BulkDownloadNumericalColumns", "possibleTypes": null }, { @@ -11383,16 +11734,16 @@ "inputFields": null, "interfaces": [], "kind": "OBJECT", - "name": "PhylogeneticTreeMinMaxColumns", + "name": "BulkDownloadMinMaxColumns", "possibleTypes": null }, { "enumValues": [ { - "name": "tree" + "name": "download_type" }, { - "name": "format" + "name": "file" }, { "name": "entity_id" @@ -11408,13 +11759,22 @@ }, { "name": "collection_id" + }, + { + "name": "created_at" + }, + { + "name": "updated_at" + }, + { + "name": "deleted_at" } ], "fields": null, "inputFields": null, "interfaces": null, "kind": "ENUM", - "name": "PhylogeneticTreeCountColumns", + "name": "BulkDownloadCountColumns", "possibleTypes": null }, { @@ -12051,19 +12411,19 @@ "name": null, "ofType": { "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexCreateInput", + "name": "HostOrganismCreateInput", "ofType": null } } } ], - "name": "createSequenceAlignmentIndex", + "name": "createHostOrganism", "type": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "OBJECT", - "name": "SequenceAlignmentIndex", + "name": "HostOrganism", "ofType": null } } @@ -12078,7 +12438,7 @@ "name": null, "ofType": { "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexUpdateInput", + "name": "HostOrganismUpdateInput", "ofType": null } } @@ -12091,13 +12451,13 @@ "name": null, "ofType": { "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexWhereClauseMutations", + "name": "HostOrganismWhereClauseMutations", "ofType": null } } } ], - "name": "updateSequenceAlignmentIndex", + "name": "updateHostOrganism", "type": { "kind": "NON_NULL", "name": null, @@ -12109,7 +12469,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "SequenceAlignmentIndex", + "name": "HostOrganism", "ofType": null } } @@ -12126,13 +12486,13 @@ "name": null, "ofType": { "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexWhereClauseMutations", + "name": "HostOrganismWhereClauseMutations", "ofType": null } } } ], - "name": "deleteSequenceAlignmentIndex", + "name": "deleteHostOrganism", "type": { "kind": "NON_NULL", "name": null, @@ -12144,7 +12504,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "SequenceAlignmentIndex", + "name": "HostOrganism", "ofType": null } } @@ -12920,6 +13280,116 @@ } } } + }, + { + "args": [ + { + "defaultValue": null, + "name": "input", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "BulkDownloadCreateInput", + "ofType": null + } + } + } + ], + "name": "createBulkDownload", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BulkDownload", + "ofType": null + } + } + }, + { + "args": [ + { + "defaultValue": null, + "name": "input", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "BulkDownloadUpdateInput", + "ofType": null + } + } + }, + { + "defaultValue": null, + "name": "where", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "BulkDownloadWhereClauseMutations", + "ofType": null + } + } + } + ], + "name": "updateBulkDownload", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BulkDownload", + "ofType": null + } + } + } + } + }, + { + "args": [ + { + "defaultValue": null, + "name": "where", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "BulkDownloadWhereClauseMutations", + "ofType": null + } + } + } + ], + "name": "deleteBulkDownload", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BulkDownload", + "ofType": null + } + } + } + } } ], "inputFields": null, @@ -13211,6 +13681,15 @@ } } }, + { + "defaultValue": "null", + "name": "railsSampleId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, { "defaultValue": null, "name": "name", @@ -13251,12 +13730,16 @@ } }, { - "defaultValue": "null", + "defaultValue": null, "name": "collectionDate", "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } } }, { @@ -13309,6 +13792,15 @@ "ofType": null } }, + { + "defaultValue": "null", + "name": "railsSampleId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, { "defaultValue": "null", "name": "name", @@ -13424,16 +13916,12 @@ } }, { - "defaultValue": null, + "defaultValue": "null", "name": "protocol", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SequencingProtocol", - "ofType": null - } + "kind": "ENUM", + "name": "SequencingProtocol", + "ofType": null } }, { @@ -13482,7 +13970,7 @@ }, { "defaultValue": null, - "name": "hasErcc", + "name": "clearlabsExport", "type": { "kind": "NON_NULL", "name": null, @@ -13586,7 +14074,7 @@ }, { "defaultValue": "null", - "name": "hasErcc", + "name": "clearlabsExport", "type": { "kind": "SCALAR", "name": "Boolean", @@ -13654,16 +14142,12 @@ } }, { - "defaultValue": null, + "defaultValue": "null", "name": "referenceGenomeId", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null } }, { @@ -13763,57 +14247,31 @@ "ofType": null } }, - { - "defaultValue": "null", - "name": "fileIndexId", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, { "defaultValue": null, - "name": "name", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - { - "defaultValue": null, - "name": "description", + "name": "taxonId", "type": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "String", + "name": "ID", "ofType": null } } }, { - "defaultValue": null, - "name": "taxonId", + "defaultValue": "null", + "name": "accessionId", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null } }, { "defaultValue": "null", - "name": "accessionId", + "name": "accessionName", "type": { "kind": "SCALAR", "name": "String", @@ -13850,7 +14308,7 @@ }, { "defaultValue": "null", - "name": "fileIndexId", + "name": "taxonId", "type": { "kind": "SCALAR", "name": "ID", @@ -13859,16 +14317,7 @@ }, { "defaultValue": "null", - "name": "name", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "description", + "name": "accessionId", "type": { "kind": "SCALAR", "name": "String", @@ -13877,16 +14326,7 @@ }, { "defaultValue": "null", - "name": "taxonId", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - { - "defaultValue": "null", - "name": "accessionId", + "name": "accessionName", "type": { "kind": "SCALAR", "name": "String", @@ -13935,9 +14375,35 @@ } } }, + { + "defaultValue": null, + "name": "name", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "name": "version", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, { "defaultValue": "null", - "name": "indexFileId", + "name": "hostFilteringId", "type": { "kind": "SCALAR", "name": "ID", @@ -13946,39 +14412,17 @@ }, { "defaultValue": "null", - "name": "referenceGenomeId", + "name": "sequenceId", "type": { "kind": "SCALAR", "name": "ID", "ofType": null } - }, - { - "defaultValue": null, - "name": "tool", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "AlignmentTool", - "ofType": null - } - } - }, - { - "defaultValue": "null", - "name": "version", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } } ], "interfaces": null, "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexCreateInput", + "name": "HostOrganismCreateInput", "possibleTypes": null }, { @@ -13996,44 +14440,44 @@ }, { "defaultValue": "null", - "name": "indexFileId", + "name": "name", "type": { "kind": "SCALAR", - "name": "ID", + "name": "String", "ofType": null } }, { "defaultValue": "null", - "name": "referenceGenomeId", + "name": "version", "type": { "kind": "SCALAR", - "name": "ID", + "name": "String", "ofType": null } }, { "defaultValue": "null", - "name": "tool", + "name": "hostFilteringId", "type": { - "kind": "ENUM", - "name": "AlignmentTool", + "kind": "SCALAR", + "name": "ID", "ofType": null } }, { "defaultValue": "null", - "name": "version", + "name": "sequenceId", "type": { "kind": "SCALAR", - "name": "String", + "name": "ID", "ofType": null } } ], "interfaces": null, "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexUpdateInput", + "name": "HostOrganismUpdateInput", "possibleTypes": null }, { @@ -14052,7 +14496,7 @@ ], "interfaces": null, "kind": "INPUT_OBJECT", - "name": "SequenceAlignmentIndexWhereClauseMutations", + "name": "HostOrganismWhereClauseMutations", "possibleTypes": null }, { @@ -14247,6 +14691,15 @@ "ofType": null } }, + { + "defaultValue": "null", + "name": "metricsId", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, { "defaultValue": "null", "name": "intermediateOutputsId", @@ -14311,6 +14764,15 @@ "ofType": null } }, + { + "defaultValue": "null", + "name": "metricsId", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, { "defaultValue": "null", "name": "intermediateOutputsId", @@ -14375,15 +14837,6 @@ } } }, - { - "defaultValue": "null", - "name": "coverageDepth", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, { "defaultValue": "null", "name": "referenceGenomeLength", @@ -14476,12 +14929,64 @@ }, { "defaultValue": "null", - "name": "coverageVizSummaryFileId", + "name": "coverageDepth", "type": { "kind": "SCALAR", - "name": "ID", + "name": "Float", "ofType": null } + }, + { + "defaultValue": "null", + "name": "coverageBreadth", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "coverageBinSize", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "coverageTotalLength", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "coverageViz", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + } + } + } } ], "interfaces": null, @@ -14511,15 +15016,6 @@ "ofType": null } }, - { - "defaultValue": "null", - "name": "coverageDepth", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, { "defaultValue": "null", "name": "referenceGenomeLength", @@ -14612,12 +15108,64 @@ }, { "defaultValue": "null", - "name": "coverageVizSummaryFileId", + "name": "coverageDepth", "type": { "kind": "SCALAR", - "name": "ID", + "name": "Float", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "coverageBreadth", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "coverageBinSize", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "coverageTotalLength", + "type": { + "kind": "SCALAR", + "name": "Int", "ofType": null } + }, + { + "defaultValue": "null", + "name": "coverageViz", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + } + } + } } ], "interfaces": null, @@ -15154,6 +15702,107 @@ "name": "PhylogeneticTreeWhereClauseMutations", "possibleTypes": null }, + { + "enumValues": null, + "fields": null, + "inputFields": [ + { + "defaultValue": null, + "name": "collectionId", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + }, + { + "defaultValue": null, + "name": "downloadType", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } + } + }, + { + "defaultValue": "null", + "name": "fileId", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + ], + "interfaces": null, + "kind": "INPUT_OBJECT", + "name": "BulkDownloadCreateInput", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": null, + "inputFields": [ + { + "defaultValue": "null", + "name": "collectionId", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "downloadType", + "type": { + "kind": "ENUM", + "name": "BulkDownloadType", + "ofType": null + } + }, + { + "defaultValue": "null", + "name": "fileId", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + ], + "interfaces": null, + "kind": "INPUT_OBJECT", + "name": "BulkDownloadUpdateInput", + "possibleTypes": null + }, + { + "enumValues": null, + "fields": null, + "inputFields": [ + { + "defaultValue": null, + "name": "id", + "type": { + "kind": "INPUT_OBJECT", + "name": "UUIDComparators", + "ofType": null + } + } + ], + "interfaces": null, + "kind": "INPUT_OBJECT", + "name": "BulkDownloadWhereClauseMutations", + "possibleTypes": null + }, { "enumValues": null, "fields": [ diff --git a/entities/api/types/bulk_download.py b/entities/api/types/bulk_download.py new file mode 100644 index 00000000..57297a7b --- /dev/null +++ b/entities/api/types/bulk_download.py @@ -0,0 +1,384 @@ +""" +GraphQL type for BulkDownload + +Auto-generated by running 'make codegen'. Do not edit. +Make changes to the template codegen/templates/api/types/class_name.py.j2 instead. +""" + +# ruff: noqa: E501 Line too long + + +import typing +from typing import TYPE_CHECKING, Annotated, Optional, Sequence, Callable + +import database.models as db +import strawberry +from platformics.api.core.helpers import get_db_rows, get_aggregate_db_rows +from api.files import File, FileWhereClause +from api.types.entities import EntityInterface +from cerbos.sdk.client import CerbosClient +from cerbos.sdk.model import Principal, Resource +from fastapi import Depends +from platformics.api.core.errors import PlatformicsException +from platformics.api.core.deps import get_cerbos_client, get_db_session, require_auth_principal +from platformics.api.core.gql_to_sql import ( + aggregator_map, + EnumComparators, + IntComparators, + UUIDComparators, +) +from platformics.api.core.strawberry_extensions import DependencyExtension +from platformics.security.authorization import CerbosAction +from sqlalchemy import inspect +from sqlalchemy.engine.row import RowMapping +from sqlalchemy.ext.asyncio import AsyncSession +from strawberry.types import Info +from typing_extensions import TypedDict +import enum +from support.enums import BulkDownloadType + +E = typing.TypeVar("E", db.File, db.Entity) +T = typing.TypeVar("T") + +if TYPE_CHECKING: + pass +else: + pass + + +""" +------------------------------------------------------------------------------ +Dataloaders +------------------------------------------------------------------------------ +These are batching functions for loading related objects to avoid N+1 queries. +""" +""" +------------------------------------------------------------------------------ +Dataloader for File object +------------------------------------------------------------------------------ +""" + + +def load_files_from(attr_name: str) -> Callable: + @strawberry.field + async def load_files( + root: "BulkDownload", + info: Info, + where: Annotated["FileWhereClause", strawberry.lazy("api.files")] | None = None, + ) -> Optional[Annotated["File", strawberry.lazy("api.files")]]: + """ + Given a list of BulkDownload IDs for a certain file type, return related Files + """ + dataloader = info.context["sqlalchemy_loader"] + mapper = inspect(db.BulkDownload) + relationship = mapper.relationships[attr_name] + return await dataloader.loader_for(relationship, where).load(getattr(root, f"{attr_name}_id")) # type:ignore + + return load_files + + +""" +------------------------------------------------------------------------------ +Define Strawberry GQL types +------------------------------------------------------------------------------ +""" + +""" +Only let users specify IDs in WHERE clause when mutating data (for safety). +We can extend that list as we gather more use cases from the FE team. +""" + + +@strawberry.input +class BulkDownloadWhereClauseMutations(TypedDict): + id: UUIDComparators | None + + +""" +Supported WHERE clause attributes +""" + + +@strawberry.input +class BulkDownloadWhereClause(TypedDict): + id: UUIDComparators | None + producing_run_id: IntComparators | None + owner_user_id: IntComparators | None + collection_id: IntComparators | None + download_type: Optional[EnumComparators[BulkDownloadType]] | None + + +""" +Define BulkDownload type +""" + + +@strawberry.type +class BulkDownload(EntityInterface): + id: strawberry.ID + producing_run_id: Optional[int] + owner_user_id: int + collection_id: int + download_type: BulkDownloadType + file_id: Optional[strawberry.ID] + file: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("file") # type: ignore + + +""" +We need to add this to each Queryable type so that strawberry will accept either our +Strawberry type *or* a SQLAlchemy model instance as a valid response class from a resolver +""" +BulkDownload.__strawberry_definition__.is_type_of = ( # type: ignore + lambda obj, info: type(obj) == db.BulkDownload or type(obj) == BulkDownload +) + +""" +------------------------------------------------------------------------------ +Aggregation types +------------------------------------------------------------------------------ +""" + +""" +Define columns that support numerical aggregations +""" + + +@strawberry.type +class BulkDownloadNumericalColumns: + producing_run_id: Optional[int] = None + owner_user_id: Optional[int] = None + collection_id: Optional[int] = None + + +""" +Define columns that support min/max aggregations +""" + + +@strawberry.type +class BulkDownloadMinMaxColumns: + producing_run_id: Optional[int] = None + owner_user_id: Optional[int] = None + collection_id: Optional[int] = None + + +""" +Define enum of all columns to support count and count(distinct) aggregations +""" + + +@strawberry.enum +class BulkDownloadCountColumns(enum.Enum): + download_type = "download_type" + file = "file" + entity_id = "entity_id" + id = "id" + producing_run_id = "producing_run_id" + owner_user_id = "owner_user_id" + collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" + + +""" +All supported aggregation functions +""" + + +@strawberry.type +class BulkDownloadAggregateFunctions: + # This is a hack to accept "distinct" and "columns" as arguments to "count" + @strawberry.field + def count( + self, distinct: Optional[bool] = False, columns: Optional[BulkDownloadCountColumns] = None + ) -> Optional[int]: + # Count gets set with the proper value in the resolver, so we just return it here + return self.count # type: ignore + + sum: Optional[BulkDownloadNumericalColumns] = None + avg: Optional[BulkDownloadNumericalColumns] = None + min: Optional[BulkDownloadMinMaxColumns] = None + max: Optional[BulkDownloadMinMaxColumns] = None + stddev: Optional[BulkDownloadNumericalColumns] = None + variance: Optional[BulkDownloadNumericalColumns] = None + + +""" +Wrapper around BulkDownloadAggregateFunctions +""" + + +@strawberry.type +class BulkDownloadAggregate: + aggregate: Optional[BulkDownloadAggregateFunctions] = None + + +""" +------------------------------------------------------------------------------ +Mutation types +------------------------------------------------------------------------------ +""" + + +@strawberry.input() +class BulkDownloadCreateInput: + collection_id: int + download_type: BulkDownloadType + file_id: Optional[strawberry.ID] = None + + +@strawberry.input() +class BulkDownloadUpdateInput: + collection_id: Optional[int] = None + download_type: Optional[BulkDownloadType] = None + file_id: Optional[strawberry.ID] = None + + +""" +------------------------------------------------------------------------------ +Utilities +------------------------------------------------------------------------------ +""" + + +@strawberry.field(extensions=[DependencyExtension()]) +async def resolve_bulk_downloads( + session: AsyncSession = Depends(get_db_session, use_cache=False), + cerbos_client: CerbosClient = Depends(get_cerbos_client), + principal: Principal = Depends(require_auth_principal), + where: Optional[BulkDownloadWhereClause] = None, +) -> typing.Sequence[BulkDownload]: + """ + Resolve BulkDownload objects. Used for queries (see api/queries.py). + """ + return await get_db_rows(db.BulkDownload, session, cerbos_client, principal, where, []) # type: ignore + + +def format_bulk_download_aggregate_output(query_results: RowMapping) -> BulkDownloadAggregateFunctions: + """ + Given a row from the DB containing the results of an aggregate query, + format the results using the proper GraphQL types. + """ + output = BulkDownloadAggregateFunctions() + for aggregate_name, value in query_results.items(): + if aggregate_name == "count": + output.count = value + else: + aggregator_fn, col_name = aggregate_name.split("_", 1) + # Filter out the group_by key from the results if one was provided. + if aggregator_fn in aggregator_map.keys(): + if not getattr(output, aggregator_fn): + if aggregate_name in ["min", "max"]: + setattr(output, aggregator_fn, BulkDownloadMinMaxColumns()) + else: + setattr(output, aggregator_fn, BulkDownloadNumericalColumns()) + setattr(getattr(output, aggregator_fn), col_name, value) + return output + + +@strawberry.field(extensions=[DependencyExtension()]) +async def resolve_bulk_downloads_aggregate( + info: Info, + session: AsyncSession = Depends(get_db_session, use_cache=False), + cerbos_client: CerbosClient = Depends(get_cerbos_client), + principal: Principal = Depends(require_auth_principal), + where: Optional[BulkDownloadWhereClause] = None, +) -> BulkDownloadAggregate: + """ + Aggregate values for BulkDownload objects. Used for queries (see api/queries.py). + """ + # Get the selected aggregate functions and columns to operate on + # TODO: not sure why selected_fields is a list + # The first list of selections will always be ["aggregate"], so just grab the first item + selections = info.selected_fields[0].selections[0].selections + rows = await get_aggregate_db_rows(db.BulkDownload, session, cerbos_client, principal, where, selections, []) # type: ignore + aggregate_output = format_bulk_download_aggregate_output(rows) + return BulkDownloadAggregate(aggregate=aggregate_output) + + +@strawberry.mutation(extensions=[DependencyExtension()]) +async def create_bulk_download( + input: BulkDownloadCreateInput, + session: AsyncSession = Depends(get_db_session, use_cache=False), + cerbos_client: CerbosClient = Depends(get_cerbos_client), + principal: Principal = Depends(require_auth_principal), +) -> db.Entity: + """ + Create a new BulkDownload object. Used for mutations (see api/mutations.py). + """ + params = input.__dict__ + + # Validate that user can create entity in this collection + attr = {"collection_id": input.collection_id} + resource = Resource(id="NEW_ID", kind=db.BulkDownload.__tablename__, attr=attr) + if not cerbos_client.is_allowed("create", principal, resource): + raise PlatformicsException("Unauthorized: Cannot create entity in this collection") + + # Save to DB + params["owner_user_id"] = int(principal.id) + new_entity = db.BulkDownload(**params) + session.add(new_entity) + await session.commit() + return new_entity + + +@strawberry.mutation(extensions=[DependencyExtension()]) +async def update_bulk_download( + input: BulkDownloadUpdateInput, + where: BulkDownloadWhereClauseMutations, + session: AsyncSession = Depends(get_db_session, use_cache=False), + cerbos_client: CerbosClient = Depends(get_cerbos_client), + principal: Principal = Depends(require_auth_principal), +) -> Sequence[db.Entity]: + """ + Update BulkDownload objects. Used for mutations (see api/mutations.py). + """ + params = input.__dict__ + + # Need at least one thing to update + num_params = len([x for x in params if params[x] is not None]) + if num_params == 0: + raise PlatformicsException("No fields to update") + + # Fetch entities for update, if we have access to them + entities = await get_db_rows(db.BulkDownload, session, cerbos_client, principal, where, [], CerbosAction.UPDATE) + if len(entities) == 0: + raise PlatformicsException("Unauthorized: Cannot update entities") + + # Validate that the user has access to the new collection ID + if input.collection_id: + attr = {"collection_id": input.collection_id} + resource = Resource(id="SOME_ID", kind=db.BulkDownload.__tablename__, attr=attr) + if not cerbos_client.is_allowed(CerbosAction.UPDATE, principal, resource): + raise PlatformicsException("Unauthorized: Cannot access new collection") + + # Update DB + for entity in entities: + for key in params: + if params[key]: + setattr(entity, key, params[key]) + await session.commit() + return entities + + +@strawberry.mutation(extensions=[DependencyExtension()]) +async def delete_bulk_download( + where: BulkDownloadWhereClauseMutations, + session: AsyncSession = Depends(get_db_session, use_cache=False), + cerbos_client: CerbosClient = Depends(get_cerbos_client), + principal: Principal = Depends(require_auth_principal), +) -> Sequence[db.Entity]: + """ + Delete BulkDownload objects. Used for mutations (see api/mutations.py). + """ + # Fetch entities for deletion, if we have access to them + entities = await get_db_rows(db.BulkDownload, session, cerbos_client, principal, where, [], CerbosAction.DELETE) + if len(entities) == 0: + raise PlatformicsException("Unauthorized: Cannot delete entities") + + # Update DB + for entity in entities: + await session.delete(entity) + await session.commit() + return entities diff --git a/entities/api/types/consensus_genome.py b/entities/api/types/consensus_genome.py index 64189257..1357145c 100644 --- a/entities/api/types/consensus_genome.py +++ b/entities/api/types/consensus_genome.py @@ -16,10 +16,6 @@ from platformics.api.core.helpers import get_db_rows, get_aggregate_db_rows from api.files import File, FileWhereClause from api.types.entities import EntityInterface -from api.types.metric_consensus_genome import ( - MetricConsensusGenomeAggregate, - format_metric_consensus_genome_aggregate_output, -) from cerbos.sdk.client import CerbosClient from cerbos.sdk.model import Principal, Resource from fastapi import Depends @@ -35,7 +31,6 @@ from sqlalchemy import inspect from sqlalchemy.engine.row import RowMapping from sqlalchemy.ext.asyncio import AsyncSession -from strawberry import relay from strawberry.types import Info from typing_extensions import TypedDict import enum @@ -106,41 +101,19 @@ async def load_reference_genome_rows( return await dataloader.loader_for(relationship, where).load(root.reference_genome_id) # type:ignore -@relay.connection( - relay.ListConnection[ - Annotated["MetricConsensusGenome", strawberry.lazy("api.types.metric_consensus_genome")] - ] # type:ignore -) +@strawberry.field async def load_metric_consensus_genome_rows( root: "ConsensusGenome", info: Info, where: Annotated["MetricConsensusGenomeWhereClause", strawberry.lazy("api.types.metric_consensus_genome")] | None = None, -) -> Sequence[Annotated["MetricConsensusGenome", strawberry.lazy("api.types.metric_consensus_genome")]]: +) -> Optional[Annotated["MetricConsensusGenome", strawberry.lazy("api.types.metric_consensus_genome")]]: dataloader = info.context["sqlalchemy_loader"] mapper = inspect(db.ConsensusGenome) relationship = mapper.relationships["metrics"] return await dataloader.loader_for(relationship, where).load(root.id) # type:ignore -@strawberry.field -async def load_metric_consensus_genome_aggregate_rows( - root: "ConsensusGenome", - info: Info, - where: Annotated["MetricConsensusGenomeWhereClause", strawberry.lazy("api.types.metric_consensus_genome")] - | None = None, -) -> Optional[Annotated["MetricConsensusGenomeAggregate", strawberry.lazy("api.types.metric_consensus_genome")]]: - selections = info.selected_fields[0].selections[0].selections - dataloader = info.context["sqlalchemy_loader"] - mapper = inspect(db.ConsensusGenome) - relationship = mapper.relationships["metrics"] - rows = await dataloader.aggregate_loader_for(relationship, where, selections).load(root.id) # type:ignore - # Aggregate queries always return a single row, so just grab the first one - result = rows[0] if rows else None - aggregate_output = format_metric_consensus_genome_aggregate_output(result) - return MetricConsensusGenomeAggregate(aggregate=aggregate_output) - - """ ------------------------------------------------------------------------------ Dataloader for File object @@ -224,14 +197,11 @@ class ConsensusGenome(EntityInterface): ] = load_reference_genome_rows # type:ignore sequence_id: Optional[strawberry.ID] sequence: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("sequence") # type: ignore - intermediate_outputs_id: Optional[strawberry.ID] - intermediate_outputs: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("intermediate_outputs") # type: ignore - metrics: Sequence[ + metrics: Optional[ Annotated["MetricConsensusGenome", strawberry.lazy("api.types.metric_consensus_genome")] ] = load_metric_consensus_genome_rows # type:ignore - metrics_aggregate: Optional[ - Annotated["MetricConsensusGenomeAggregate", strawberry.lazy("api.types.metric_consensus_genome")] - ] = load_metric_consensus_genome_aggregate_rows # type:ignore + intermediate_outputs_id: Optional[strawberry.ID] + intermediate_outputs: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("intermediate_outputs") # type: ignore """ @@ -283,13 +253,16 @@ class ConsensusGenomeCountColumns(enum.Enum): sequence_read = "sequence_read" reference_genome = "reference_genome" sequence = "sequence" - intermediate_outputs = "intermediate_outputs" metrics = "metrics" + intermediate_outputs = "intermediate_outputs" entity_id = "entity_id" id = "id" producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ @@ -339,6 +312,7 @@ class ConsensusGenomeCreateInput: sequence_read_id: strawberry.ID reference_genome_id: strawberry.ID sequence_id: Optional[strawberry.ID] = None + metrics_id: Optional[strawberry.ID] = None intermediate_outputs_id: Optional[strawberry.ID] = None @@ -349,6 +323,7 @@ class ConsensusGenomeUpdateInput: sequence_read_id: Optional[strawberry.ID] = None reference_genome_id: Optional[strawberry.ID] = None sequence_id: Optional[strawberry.ID] = None + metrics_id: Optional[strawberry.ID] = None intermediate_outputs_id: Optional[strawberry.ID] = None diff --git a/entities/api/types/contig.py b/entities/api/types/contig.py index d97e53c5..1594ad6b 100644 --- a/entities/api/types/contig.py +++ b/entities/api/types/contig.py @@ -172,6 +172,9 @@ class ContigCountColumns(enum.Enum): producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ diff --git a/entities/api/types/genomic_range.py b/entities/api/types/genomic_range.py index f3b7d1e8..6e82dc05 100644 --- a/entities/api/types/genomic_range.py +++ b/entities/api/types/genomic_range.py @@ -242,6 +242,9 @@ class GenomicRangeCountColumns(enum.Enum): producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ @@ -287,7 +290,7 @@ class GenomicRangeAggregate: @strawberry.input() class GenomicRangeCreateInput: collection_id: int - reference_genome_id: strawberry.ID + reference_genome_id: Optional[strawberry.ID] = None file_id: Optional[strawberry.ID] = None diff --git a/entities/api/types/sequence_alignment_index.py b/entities/api/types/host_organism.py similarity index 61% rename from entities/api/types/sequence_alignment_index.py rename to entities/api/types/host_organism.py index 853e46c3..40e511ba 100644 --- a/entities/api/types/sequence_alignment_index.py +++ b/entities/api/types/host_organism.py @@ -1,5 +1,5 @@ """ -GraphQL type for SequenceAlignmentIndex +GraphQL type for HostOrganism Auto-generated by running 'make codegen'. Do not edit. Make changes to the template codegen/templates/api/types/class_name.py.j2 instead. @@ -23,7 +23,6 @@ from platformics.api.core.deps import get_cerbos_client, get_db_session, require_auth_principal from platformics.api.core.gql_to_sql import ( aggregator_map, - EnumComparators, IntComparators, StrComparators, UUIDComparators, @@ -36,18 +35,13 @@ from strawberry.types import Info from typing_extensions import TypedDict import enum -from support.enums import AlignmentTool E = typing.TypeVar("E", db.File, db.Entity) T = typing.TypeVar("T") if TYPE_CHECKING: - from api.types.reference_genome import ReferenceGenomeWhereClause, ReferenceGenome - pass else: - ReferenceGenomeWhereClause = "ReferenceGenomeWhereClause" - ReferenceGenome = "ReferenceGenome" pass @@ -57,20 +51,6 @@ ------------------------------------------------------------------------------ These are batching functions for loading related objects to avoid N+1 queries. """ - - -@strawberry.field -async def load_reference_genome_rows( - root: "SequenceAlignmentIndex", - info: Info, - where: Annotated["ReferenceGenomeWhereClause", strawberry.lazy("api.types.reference_genome")] | None = None, -) -> Optional[Annotated["ReferenceGenome", strawberry.lazy("api.types.reference_genome")]]: - dataloader = info.context["sqlalchemy_loader"] - mapper = inspect(db.SequenceAlignmentIndex) - relationship = mapper.relationships["reference_genome"] - return await dataloader.loader_for(relationship, where).load(root.reference_genome_id) # type:ignore - - """ ------------------------------------------------------------------------------ Dataloader for File object @@ -81,15 +61,15 @@ async def load_reference_genome_rows( def load_files_from(attr_name: str) -> Callable: @strawberry.field async def load_files( - root: "SequenceAlignmentIndex", + root: "HostOrganism", info: Info, where: Annotated["FileWhereClause", strawberry.lazy("api.files")] | None = None, ) -> Optional[Annotated["File", strawberry.lazy("api.files")]]: """ - Given a list of SequenceAlignmentIndex IDs for a certain file type, return related Files + Given a list of HostOrganism IDs for a certain file type, return related Files """ dataloader = info.context["sqlalchemy_loader"] - mapper = inspect(db.SequenceAlignmentIndex) + mapper = inspect(db.HostOrganism) relationship = mapper.relationships[attr_name] return await dataloader.loader_for(relationship, where).load(getattr(root, f"{attr_name}_id")) # type:ignore @@ -109,7 +89,7 @@ async def load_files( @strawberry.input -class SequenceAlignmentIndexWhereClauseMutations(TypedDict): +class HostOrganismWhereClauseMutations(TypedDict): id: UUIDComparators | None @@ -119,44 +99,40 @@ class SequenceAlignmentIndexWhereClauseMutations(TypedDict): @strawberry.input -class SequenceAlignmentIndexWhereClause(TypedDict): +class HostOrganismWhereClause(TypedDict): id: UUIDComparators | None producing_run_id: IntComparators | None owner_user_id: IntComparators | None collection_id: IntComparators | None - reference_genome: Optional[ - Annotated["ReferenceGenomeWhereClause", strawberry.lazy("api.types.reference_genome")] - ] | None - tool: Optional[EnumComparators[AlignmentTool]] | None + name: Optional[StrComparators] | None version: Optional[StrComparators] | None """ -Define SequenceAlignmentIndex type +Define HostOrganism type """ @strawberry.type -class SequenceAlignmentIndex(EntityInterface): +class HostOrganism(EntityInterface): id: strawberry.ID producing_run_id: Optional[int] owner_user_id: int collection_id: int - index_file_id: Optional[strawberry.ID] - index_file: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("index_file") # type: ignore - reference_genome: Optional[ - Annotated["ReferenceGenome", strawberry.lazy("api.types.reference_genome")] - ] = load_reference_genome_rows # type:ignore - tool: AlignmentTool - version: Optional[str] = None + name: str + version: str + host_filtering_id: Optional[strawberry.ID] + host_filtering: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("host_filtering") # type: ignore + sequence_id: Optional[strawberry.ID] + sequence: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("sequence") # type: ignore """ We need to add this to each Queryable type so that strawberry will accept either our Strawberry type *or* a SQLAlchemy model instance as a valid response class from a resolver """ -SequenceAlignmentIndex.__strawberry_definition__.is_type_of = ( # type: ignore - lambda obj, info: type(obj) == db.SequenceAlignmentIndex or type(obj) == SequenceAlignmentIndex +HostOrganism.__strawberry_definition__.is_type_of = ( # type: ignore + lambda obj, info: type(obj) == db.HostOrganism or type(obj) == HostOrganism ) """ @@ -171,7 +147,7 @@ class SequenceAlignmentIndex(EntityInterface): @strawberry.type -class SequenceAlignmentIndexNumericalColumns: +class HostOrganismNumericalColumns: producing_run_id: Optional[int] = None owner_user_id: Optional[int] = None collection_id: Optional[int] = None @@ -183,10 +159,11 @@ class SequenceAlignmentIndexNumericalColumns: @strawberry.type -class SequenceAlignmentIndexMinMaxColumns: +class HostOrganismMinMaxColumns: producing_run_id: Optional[int] = None owner_user_id: Optional[int] = None collection_id: Optional[int] = None + name: Optional[str] = None version: Optional[str] = None @@ -196,16 +173,19 @@ class SequenceAlignmentIndexMinMaxColumns: @strawberry.enum -class SequenceAlignmentIndexCountColumns(enum.Enum): - index_file = "index_file" - reference_genome = "reference_genome" - tool = "tool" +class HostOrganismCountColumns(enum.Enum): + name = "name" version = "version" + host_filtering = "host_filtering" + sequence = "sequence" entity_id = "entity_id" id = "id" producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ @@ -214,31 +194,31 @@ class SequenceAlignmentIndexCountColumns(enum.Enum): @strawberry.type -class SequenceAlignmentIndexAggregateFunctions: +class HostOrganismAggregateFunctions: # This is a hack to accept "distinct" and "columns" as arguments to "count" @strawberry.field def count( - self, distinct: Optional[bool] = False, columns: Optional[SequenceAlignmentIndexCountColumns] = None + self, distinct: Optional[bool] = False, columns: Optional[HostOrganismCountColumns] = None ) -> Optional[int]: # Count gets set with the proper value in the resolver, so we just return it here return self.count # type: ignore - sum: Optional[SequenceAlignmentIndexNumericalColumns] = None - avg: Optional[SequenceAlignmentIndexNumericalColumns] = None - min: Optional[SequenceAlignmentIndexMinMaxColumns] = None - max: Optional[SequenceAlignmentIndexMinMaxColumns] = None - stddev: Optional[SequenceAlignmentIndexNumericalColumns] = None - variance: Optional[SequenceAlignmentIndexNumericalColumns] = None + sum: Optional[HostOrganismNumericalColumns] = None + avg: Optional[HostOrganismNumericalColumns] = None + min: Optional[HostOrganismMinMaxColumns] = None + max: Optional[HostOrganismMinMaxColumns] = None + stddev: Optional[HostOrganismNumericalColumns] = None + variance: Optional[HostOrganismNumericalColumns] = None """ -Wrapper around SequenceAlignmentIndexAggregateFunctions +Wrapper around HostOrganismAggregateFunctions """ @strawberry.type -class SequenceAlignmentIndexAggregate: - aggregate: Optional[SequenceAlignmentIndexAggregateFunctions] = None +class HostOrganismAggregate: + aggregate: Optional[HostOrganismAggregateFunctions] = None """ @@ -249,21 +229,21 @@ class SequenceAlignmentIndexAggregate: @strawberry.input() -class SequenceAlignmentIndexCreateInput: +class HostOrganismCreateInput: collection_id: int - index_file_id: Optional[strawberry.ID] = None - reference_genome_id: Optional[strawberry.ID] = None - tool: AlignmentTool - version: Optional[str] = None + name: str + version: str + host_filtering_id: Optional[strawberry.ID] = None + sequence_id: Optional[strawberry.ID] = None @strawberry.input() -class SequenceAlignmentIndexUpdateInput: +class HostOrganismUpdateInput: collection_id: Optional[int] = None - index_file_id: Optional[strawberry.ID] = None - reference_genome_id: Optional[strawberry.ID] = None - tool: Optional[AlignmentTool] = None + name: Optional[str] = None version: Optional[str] = None + host_filtering_id: Optional[strawberry.ID] = None + sequence_id: Optional[strawberry.ID] = None """ @@ -274,26 +254,24 @@ class SequenceAlignmentIndexUpdateInput: @strawberry.field(extensions=[DependencyExtension()]) -async def resolve_sequence_alignment_indices( +async def resolve_host_organisms( session: AsyncSession = Depends(get_db_session, use_cache=False), cerbos_client: CerbosClient = Depends(get_cerbos_client), principal: Principal = Depends(require_auth_principal), - where: Optional[SequenceAlignmentIndexWhereClause] = None, -) -> typing.Sequence[SequenceAlignmentIndex]: + where: Optional[HostOrganismWhereClause] = None, +) -> typing.Sequence[HostOrganism]: """ - Resolve SequenceAlignmentIndex objects. Used for queries (see api/queries.py). + Resolve HostOrganism objects. Used for queries (see api/queries.py). """ - return await get_db_rows(db.SequenceAlignmentIndex, session, cerbos_client, principal, where, []) # type: ignore + return await get_db_rows(db.HostOrganism, session, cerbos_client, principal, where, []) # type: ignore -def format_sequence_alignment_index_aggregate_output( - query_results: RowMapping, -) -> SequenceAlignmentIndexAggregateFunctions: +def format_host_organism_aggregate_output(query_results: RowMapping) -> HostOrganismAggregateFunctions: """ Given a row from the DB containing the results of an aggregate query, format the results using the proper GraphQL types. """ - output = SequenceAlignmentIndexAggregateFunctions() + output = HostOrganismAggregateFunctions() for aggregate_name, value in query_results.items(): if aggregate_name == "count": output.count = value @@ -303,69 +281,69 @@ def format_sequence_alignment_index_aggregate_output( if aggregator_fn in aggregator_map.keys(): if not getattr(output, aggregator_fn): if aggregate_name in ["min", "max"]: - setattr(output, aggregator_fn, SequenceAlignmentIndexMinMaxColumns()) + setattr(output, aggregator_fn, HostOrganismMinMaxColumns()) else: - setattr(output, aggregator_fn, SequenceAlignmentIndexNumericalColumns()) + setattr(output, aggregator_fn, HostOrganismNumericalColumns()) setattr(getattr(output, aggregator_fn), col_name, value) return output @strawberry.field(extensions=[DependencyExtension()]) -async def resolve_sequence_alignment_indices_aggregate( +async def resolve_host_organisms_aggregate( info: Info, session: AsyncSession = Depends(get_db_session, use_cache=False), cerbos_client: CerbosClient = Depends(get_cerbos_client), principal: Principal = Depends(require_auth_principal), - where: Optional[SequenceAlignmentIndexWhereClause] = None, -) -> SequenceAlignmentIndexAggregate: + where: Optional[HostOrganismWhereClause] = None, +) -> HostOrganismAggregate: """ - Aggregate values for SequenceAlignmentIndex objects. Used for queries (see api/queries.py). + Aggregate values for HostOrganism objects. Used for queries (see api/queries.py). """ # Get the selected aggregate functions and columns to operate on # TODO: not sure why selected_fields is a list # The first list of selections will always be ["aggregate"], so just grab the first item selections = info.selected_fields[0].selections[0].selections - rows = await get_aggregate_db_rows(db.SequenceAlignmentIndex, session, cerbos_client, principal, where, selections, []) # type: ignore - aggregate_output = format_sequence_alignment_index_aggregate_output(rows) - return SequenceAlignmentIndexAggregate(aggregate=aggregate_output) + rows = await get_aggregate_db_rows(db.HostOrganism, session, cerbos_client, principal, where, selections, []) # type: ignore + aggregate_output = format_host_organism_aggregate_output(rows) + return HostOrganismAggregate(aggregate=aggregate_output) @strawberry.mutation(extensions=[DependencyExtension()]) -async def create_sequence_alignment_index( - input: SequenceAlignmentIndexCreateInput, +async def create_host_organism( + input: HostOrganismCreateInput, session: AsyncSession = Depends(get_db_session, use_cache=False), cerbos_client: CerbosClient = Depends(get_cerbos_client), principal: Principal = Depends(require_auth_principal), ) -> db.Entity: """ - Create a new SequenceAlignmentIndex object. Used for mutations (see api/mutations.py). + Create a new HostOrganism object. Used for mutations (see api/mutations.py). """ params = input.__dict__ # Validate that user can create entity in this collection attr = {"collection_id": input.collection_id} - resource = Resource(id="NEW_ID", kind=db.SequenceAlignmentIndex.__tablename__, attr=attr) + resource = Resource(id="NEW_ID", kind=db.HostOrganism.__tablename__, attr=attr) if not cerbos_client.is_allowed("create", principal, resource): raise PlatformicsException("Unauthorized: Cannot create entity in this collection") # Save to DB params["owner_user_id"] = int(principal.id) - new_entity = db.SequenceAlignmentIndex(**params) + new_entity = db.HostOrganism(**params) session.add(new_entity) await session.commit() return new_entity @strawberry.mutation(extensions=[DependencyExtension()]) -async def update_sequence_alignment_index( - input: SequenceAlignmentIndexUpdateInput, - where: SequenceAlignmentIndexWhereClauseMutations, +async def update_host_organism( + input: HostOrganismUpdateInput, + where: HostOrganismWhereClauseMutations, session: AsyncSession = Depends(get_db_session, use_cache=False), cerbos_client: CerbosClient = Depends(get_cerbos_client), principal: Principal = Depends(require_auth_principal), ) -> Sequence[db.Entity]: """ - Update SequenceAlignmentIndex objects. Used for mutations (see api/mutations.py). + Update HostOrganism objects. Used for mutations (see api/mutations.py). """ params = input.__dict__ @@ -375,16 +353,14 @@ async def update_sequence_alignment_index( raise PlatformicsException("No fields to update") # Fetch entities for update, if we have access to them - entities = await get_db_rows( - db.SequenceAlignmentIndex, session, cerbos_client, principal, where, [], CerbosAction.UPDATE - ) + entities = await get_db_rows(db.HostOrganism, session, cerbos_client, principal, where, [], CerbosAction.UPDATE) if len(entities) == 0: raise PlatformicsException("Unauthorized: Cannot update entities") # Validate that the user has access to the new collection ID if input.collection_id: attr = {"collection_id": input.collection_id} - resource = Resource(id="SOME_ID", kind=db.SequenceAlignmentIndex.__tablename__, attr=attr) + resource = Resource(id="SOME_ID", kind=db.HostOrganism.__tablename__, attr=attr) if not cerbos_client.is_allowed(CerbosAction.UPDATE, principal, resource): raise PlatformicsException("Unauthorized: Cannot access new collection") @@ -398,19 +374,17 @@ async def update_sequence_alignment_index( @strawberry.mutation(extensions=[DependencyExtension()]) -async def delete_sequence_alignment_index( - where: SequenceAlignmentIndexWhereClauseMutations, +async def delete_host_organism( + where: HostOrganismWhereClauseMutations, session: AsyncSession = Depends(get_db_session, use_cache=False), cerbos_client: CerbosClient = Depends(get_cerbos_client), principal: Principal = Depends(require_auth_principal), ) -> Sequence[db.Entity]: """ - Delete SequenceAlignmentIndex objects. Used for mutations (see api/mutations.py). + Delete HostOrganism objects. Used for mutations (see api/mutations.py). """ # Fetch entities for deletion, if we have access to them - entities = await get_db_rows( - db.SequenceAlignmentIndex, session, cerbos_client, principal, where, [], CerbosAction.DELETE - ) + entities = await get_db_rows(db.HostOrganism, session, cerbos_client, principal, where, [], CerbosAction.DELETE) if len(entities) == 0: raise PlatformicsException("Unauthorized: Cannot delete entities") diff --git a/entities/api/types/metadatum.py b/entities/api/types/metadatum.py index b3855e4a..75bb8fcc 100644 --- a/entities/api/types/metadatum.py +++ b/entities/api/types/metadatum.py @@ -172,6 +172,9 @@ class MetadatumCountColumns(enum.Enum): producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ diff --git a/entities/api/types/metric_consensus_genome.py b/entities/api/types/metric_consensus_genome.py index 77b667e7..248ea0a6 100644 --- a/entities/api/types/metric_consensus_genome.py +++ b/entities/api/types/metric_consensus_genome.py @@ -9,12 +9,11 @@ import typing -from typing import TYPE_CHECKING, Annotated, Optional, Sequence, Callable +from typing import TYPE_CHECKING, Annotated, Optional, Sequence, List import database.models as db import strawberry from platformics.api.core.helpers import get_db_rows, get_aggregate_db_rows -from api.files import File, FileWhereClause from api.types.entities import EntityInterface from cerbos.sdk.client import CerbosClient from cerbos.sdk.model import Principal, Resource @@ -69,31 +68,6 @@ async def load_consensus_genome_rows( return await dataloader.loader_for(relationship, where).load(root.consensus_genome_id) # type:ignore -""" ------------------------------------------------------------------------------- -Dataloader for File object ------------------------------------------------------------------------------- -""" - - -def load_files_from(attr_name: str) -> Callable: - @strawberry.field - async def load_files( - root: "MetricConsensusGenome", - info: Info, - where: Annotated["FileWhereClause", strawberry.lazy("api.files")] | None = None, - ) -> Optional[Annotated["File", strawberry.lazy("api.files")]]: - """ - Given a list of MetricConsensusGenome IDs for a certain file type, return related Files - """ - dataloader = info.context["sqlalchemy_loader"] - mapper = inspect(db.MetricConsensusGenome) - relationship = mapper.relationships[attr_name] - return await dataloader.loader_for(relationship, where).load(getattr(root, f"{attr_name}_id")) # type:ignore - - return load_files - - """ ------------------------------------------------------------------------------ Define Strawberry GQL types @@ -125,7 +99,6 @@ class MetricConsensusGenomeWhereClause(TypedDict): consensus_genome: Optional[ Annotated["ConsensusGenomeWhereClause", strawberry.lazy("api.types.consensus_genome")] ] | None - coverage_depth: Optional[FloatComparators] | None reference_genome_length: Optional[FloatComparators] | None percent_genome_called: Optional[FloatComparators] | None percent_identity: Optional[FloatComparators] | None @@ -136,6 +109,10 @@ class MetricConsensusGenomeWhereClause(TypedDict): n_actg: Optional[IntComparators] | None n_missing: Optional[IntComparators] | None n_ambiguous: Optional[IntComparators] | None + coverage_depth: Optional[FloatComparators] | None + coverage_breadth: Optional[FloatComparators] | None + coverage_bin_size: Optional[FloatComparators] | None + coverage_total_length: Optional[IntComparators] | None """ @@ -152,7 +129,6 @@ class MetricConsensusGenome(EntityInterface): consensus_genome: Optional[ Annotated["ConsensusGenome", strawberry.lazy("api.types.consensus_genome")] ] = load_consensus_genome_rows # type:ignore - coverage_depth: Optional[float] = None reference_genome_length: Optional[float] = None percent_genome_called: Optional[float] = None percent_identity: Optional[float] = None @@ -163,8 +139,11 @@ class MetricConsensusGenome(EntityInterface): n_actg: Optional[int] = None n_missing: Optional[int] = None n_ambiguous: Optional[int] = None - coverage_viz_summary_file_id: Optional[strawberry.ID] - coverage_viz_summary_file: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("coverage_viz_summary_file") # type: ignore + coverage_depth: Optional[float] = None + coverage_breadth: Optional[float] = None + coverage_bin_size: Optional[float] = None + coverage_total_length: Optional[int] = None + coverage_viz: Optional[List[List[int]]] = None """ @@ -191,7 +170,6 @@ class MetricConsensusGenomeNumericalColumns: producing_run_id: Optional[int] = None owner_user_id: Optional[int] = None collection_id: Optional[int] = None - coverage_depth: Optional[float] = None reference_genome_length: Optional[float] = None percent_genome_called: Optional[float] = None percent_identity: Optional[float] = None @@ -202,6 +180,10 @@ class MetricConsensusGenomeNumericalColumns: n_actg: Optional[int] = None n_missing: Optional[int] = None n_ambiguous: Optional[int] = None + coverage_depth: Optional[float] = None + coverage_breadth: Optional[float] = None + coverage_bin_size: Optional[float] = None + coverage_total_length: Optional[int] = None """ @@ -214,7 +196,6 @@ class MetricConsensusGenomeMinMaxColumns: producing_run_id: Optional[int] = None owner_user_id: Optional[int] = None collection_id: Optional[int] = None - coverage_depth: Optional[float] = None reference_genome_length: Optional[float] = None percent_genome_called: Optional[float] = None percent_identity: Optional[float] = None @@ -225,6 +206,10 @@ class MetricConsensusGenomeMinMaxColumns: n_actg: Optional[int] = None n_missing: Optional[int] = None n_ambiguous: Optional[int] = None + coverage_depth: Optional[float] = None + coverage_breadth: Optional[float] = None + coverage_bin_size: Optional[float] = None + coverage_total_length: Optional[int] = None """ @@ -235,7 +220,6 @@ class MetricConsensusGenomeMinMaxColumns: @strawberry.enum class MetricConsensusGenomeCountColumns(enum.Enum): consensus_genome = "consensus_genome" - coverage_depth = "coverage_depth" reference_genome_length = "reference_genome_length" percent_genome_called = "percent_genome_called" percent_identity = "percent_identity" @@ -246,12 +230,19 @@ class MetricConsensusGenomeCountColumns(enum.Enum): n_actg = "n_actg" n_missing = "n_missing" n_ambiguous = "n_ambiguous" - coverage_viz_summary_file = "coverage_viz_summary_file" + coverage_depth = "coverage_depth" + coverage_breadth = "coverage_breadth" + coverage_bin_size = "coverage_bin_size" + coverage_total_length = "coverage_total_length" + coverage_viz = "coverage_viz" entity_id = "entity_id" id = "id" producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ @@ -298,7 +289,6 @@ class MetricConsensusGenomeAggregate: class MetricConsensusGenomeCreateInput: collection_id: int consensus_genome_id: strawberry.ID - coverage_depth: Optional[float] = None reference_genome_length: Optional[float] = None percent_genome_called: Optional[float] = None percent_identity: Optional[float] = None @@ -309,14 +299,17 @@ class MetricConsensusGenomeCreateInput: n_actg: Optional[int] = None n_missing: Optional[int] = None n_ambiguous: Optional[int] = None - coverage_viz_summary_file_id: Optional[strawberry.ID] = None + coverage_depth: Optional[float] = None + coverage_breadth: Optional[float] = None + coverage_bin_size: Optional[float] = None + coverage_total_length: Optional[int] = None + coverage_viz: Optional[List[List[int]]] = None @strawberry.input() class MetricConsensusGenomeUpdateInput: collection_id: Optional[int] = None consensus_genome_id: Optional[strawberry.ID] = None - coverage_depth: Optional[float] = None reference_genome_length: Optional[float] = None percent_genome_called: Optional[float] = None percent_identity: Optional[float] = None @@ -327,7 +320,11 @@ class MetricConsensusGenomeUpdateInput: n_actg: Optional[int] = None n_missing: Optional[int] = None n_ambiguous: Optional[int] = None - coverage_viz_summary_file_id: Optional[strawberry.ID] = None + coverage_depth: Optional[float] = None + coverage_breadth: Optional[float] = None + coverage_bin_size: Optional[float] = None + coverage_total_length: Optional[int] = None + coverage_viz: Optional[List[List[int]]] = None """ diff --git a/entities/api/types/phylogenetic_tree.py b/entities/api/types/phylogenetic_tree.py index f6d68a3c..7d848c4b 100644 --- a/entities/api/types/phylogenetic_tree.py +++ b/entities/api/types/phylogenetic_tree.py @@ -176,6 +176,9 @@ class PhylogeneticTreeCountColumns(enum.Enum): producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ diff --git a/entities/api/types/reference_genome.py b/entities/api/types/reference_genome.py index f5a7ea30..e5dffa2d 100644 --- a/entities/api/types/reference_genome.py +++ b/entities/api/types/reference_genome.py @@ -16,10 +16,6 @@ from platformics.api.core.helpers import get_db_rows, get_aggregate_db_rows from api.files import File, FileWhereClause from api.types.entities import EntityInterface -from api.types.sequence_alignment_index import ( - SequenceAlignmentIndexAggregate, - format_sequence_alignment_index_aggregate_output, -) from api.types.consensus_genome import ConsensusGenomeAggregate, format_consensus_genome_aggregate_output from api.types.genomic_range import GenomicRangeAggregate, format_genomic_range_aggregate_output from cerbos.sdk.client import CerbosClient @@ -48,7 +44,6 @@ if TYPE_CHECKING: from api.types.taxon import TaxonWhereClause, Taxon - from api.types.sequence_alignment_index import SequenceAlignmentIndexWhereClause, SequenceAlignmentIndex from api.types.consensus_genome import ConsensusGenomeWhereClause, ConsensusGenome from api.types.genomic_range import GenomicRangeWhereClause, GenomicRange @@ -56,8 +51,6 @@ else: TaxonWhereClause = "TaxonWhereClause" Taxon = "Taxon" - SequenceAlignmentIndexWhereClause = "SequenceAlignmentIndexWhereClause" - SequenceAlignmentIndex = "SequenceAlignmentIndex" ConsensusGenomeWhereClause = "ConsensusGenomeWhereClause" ConsensusGenome = "ConsensusGenome" GenomicRangeWhereClause = "GenomicRangeWhereClause" @@ -85,41 +78,6 @@ async def load_taxon_rows( return await dataloader.loader_for(relationship, where).load(root.taxon_id) # type:ignore -@relay.connection( - relay.ListConnection[ - Annotated["SequenceAlignmentIndex", strawberry.lazy("api.types.sequence_alignment_index")] - ] # type:ignore -) -async def load_sequence_alignment_index_rows( - root: "ReferenceGenome", - info: Info, - where: Annotated["SequenceAlignmentIndexWhereClause", strawberry.lazy("api.types.sequence_alignment_index")] - | None = None, -) -> Sequence[Annotated["SequenceAlignmentIndex", strawberry.lazy("api.types.sequence_alignment_index")]]: - dataloader = info.context["sqlalchemy_loader"] - mapper = inspect(db.ReferenceGenome) - relationship = mapper.relationships["sequence_alignment_indices"] - return await dataloader.loader_for(relationship, where).load(root.id) # type:ignore - - -@strawberry.field -async def load_sequence_alignment_index_aggregate_rows( - root: "ReferenceGenome", - info: Info, - where: Annotated["SequenceAlignmentIndexWhereClause", strawberry.lazy("api.types.sequence_alignment_index")] - | None = None, -) -> Optional[Annotated["SequenceAlignmentIndexAggregate", strawberry.lazy("api.types.sequence_alignment_index")]]: - selections = info.selected_fields[0].selections[0].selections - dataloader = info.context["sqlalchemy_loader"] - mapper = inspect(db.ReferenceGenome) - relationship = mapper.relationships["sequence_alignment_indices"] - rows = await dataloader.aggregate_loader_for(relationship, where, selections).load(root.id) # type:ignore - # Aggregate queries always return a single row, so just grab the first one - result = rows[0] if rows else None - aggregate_output = format_sequence_alignment_index_aggregate_output(result) - return SequenceAlignmentIndexAggregate(aggregate=aggregate_output) - - @relay.connection( relay.ListConnection[Annotated["ConsensusGenome", strawberry.lazy("api.types.consensus_genome")]] # type:ignore ) @@ -235,13 +193,9 @@ class ReferenceGenomeWhereClause(TypedDict): producing_run_id: IntComparators | None owner_user_id: IntComparators | None collection_id: IntComparators | None - name: Optional[StrComparators] | None - description: Optional[StrComparators] | None taxon: Optional[Annotated["TaxonWhereClause", strawberry.lazy("api.types.taxon")]] | None accession_id: Optional[StrComparators] | None - sequence_alignment_indices: Optional[ - Annotated["SequenceAlignmentIndexWhereClause", strawberry.lazy("api.types.sequence_alignment_index")] - ] | None + accession_name: Optional[StrComparators] | None consensus_genomes: Optional[ Annotated["ConsensusGenomeWhereClause", strawberry.lazy("api.types.consensus_genome")] ] | None @@ -261,18 +215,9 @@ class ReferenceGenome(EntityInterface): collection_id: int file_id: Optional[strawberry.ID] file: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("file") # type: ignore - file_index_id: Optional[strawberry.ID] - file_index: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("file_index") # type: ignore - name: str - description: str taxon: Optional[Annotated["Taxon", strawberry.lazy("api.types.taxon")]] = load_taxon_rows # type:ignore accession_id: Optional[str] = None - sequence_alignment_indices: Sequence[ - Annotated["SequenceAlignmentIndex", strawberry.lazy("api.types.sequence_alignment_index")] - ] = load_sequence_alignment_index_rows # type:ignore - sequence_alignment_indices_aggregate: Optional[ - Annotated["SequenceAlignmentIndexAggregate", strawberry.lazy("api.types.sequence_alignment_index")] - ] = load_sequence_alignment_index_aggregate_rows # type:ignore + accession_name: Optional[str] = None consensus_genomes: Sequence[ Annotated["ConsensusGenome", strawberry.lazy("api.types.consensus_genome")] ] = load_consensus_genome_rows # type:ignore @@ -323,9 +268,8 @@ class ReferenceGenomeMinMaxColumns: producing_run_id: Optional[int] = None owner_user_id: Optional[int] = None collection_id: Optional[int] = None - name: Optional[str] = None - description: Optional[str] = None accession_id: Optional[str] = None + accession_name: Optional[str] = None """ @@ -336,12 +280,9 @@ class ReferenceGenomeMinMaxColumns: @strawberry.enum class ReferenceGenomeCountColumns(enum.Enum): file = "file" - file_index = "file_index" - name = "name" - description = "description" taxon = "taxon" accession_id = "accession_id" - sequence_alignment_indices = "sequence_alignment_indices" + accession_name = "accession_name" consensus_genomes = "consensus_genomes" genomic_ranges = "genomic_ranges" entity_id = "entity_id" @@ -349,6 +290,9 @@ class ReferenceGenomeCountColumns(enum.Enum): producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ @@ -395,22 +339,18 @@ class ReferenceGenomeAggregate: class ReferenceGenomeCreateInput: collection_id: int file_id: Optional[strawberry.ID] = None - file_index_id: Optional[strawberry.ID] = None - name: str - description: str taxon_id: strawberry.ID accession_id: Optional[str] = None + accession_name: Optional[str] = None @strawberry.input() class ReferenceGenomeUpdateInput: collection_id: Optional[int] = None file_id: Optional[strawberry.ID] = None - file_index_id: Optional[strawberry.ID] = None - name: Optional[str] = None - description: Optional[str] = None taxon_id: Optional[strawberry.ID] = None accession_id: Optional[str] = None + accession_name: Optional[str] = None """ diff --git a/entities/api/types/sample.py b/entities/api/types/sample.py index 384acb54..00e567ce 100644 --- a/entities/api/types/sample.py +++ b/entities/api/types/sample.py @@ -170,6 +170,7 @@ class SampleWhereClause(TypedDict): producing_run_id: IntComparators | None owner_user_id: IntComparators | None collection_id: IntComparators | None + rails_sample_id: Optional[IntComparators] | None name: Optional[StrComparators] | None sample_type: Optional[StrComparators] | None water_control: Optional[BoolComparators] | None @@ -194,10 +195,11 @@ class Sample(EntityInterface): producing_run_id: Optional[int] owner_user_id: int collection_id: int + rails_sample_id: Optional[int] = None name: str sample_type: str water_control: bool - collection_date: Optional[datetime.datetime] = None + collection_date: datetime.datetime collection_location: str description: Optional[str] = None host_taxon: Optional[Annotated["Taxon", strawberry.lazy("api.types.taxon")]] = load_taxon_rows # type:ignore @@ -239,6 +241,7 @@ class SampleNumericalColumns: producing_run_id: Optional[int] = None owner_user_id: Optional[int] = None collection_id: Optional[int] = None + rails_sample_id: Optional[int] = None """ @@ -251,6 +254,7 @@ class SampleMinMaxColumns: producing_run_id: Optional[int] = None owner_user_id: Optional[int] = None collection_id: Optional[int] = None + rails_sample_id: Optional[int] = None name: Optional[str] = None sample_type: Optional[str] = None collection_date: Optional[datetime.datetime] = None @@ -265,6 +269,7 @@ class SampleMinMaxColumns: @strawberry.enum class SampleCountColumns(enum.Enum): + rails_sample_id = "rails_sample_id" name = "name" sample_type = "sample_type" water_control = "water_control" @@ -279,6 +284,9 @@ class SampleCountColumns(enum.Enum): producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ @@ -322,10 +330,11 @@ class SampleAggregate: @strawberry.input() class SampleCreateInput: collection_id: int + rails_sample_id: Optional[int] = None name: str sample_type: str water_control: bool - collection_date: Optional[datetime.datetime] = None + collection_date: datetime.datetime collection_location: str description: Optional[str] = None host_taxon_id: Optional[strawberry.ID] = None @@ -334,6 +343,7 @@ class SampleCreateInput: @strawberry.input() class SampleUpdateInput: collection_id: Optional[int] = None + rails_sample_id: Optional[int] = None name: Optional[str] = None sample_type: Optional[str] = None water_control: Optional[bool] = None diff --git a/entities/api/types/sequencing_read.py b/entities/api/types/sequencing_read.py index 5bb5a8b0..e3c1e2b5 100644 --- a/entities/api/types/sequencing_read.py +++ b/entities/api/types/sequencing_read.py @@ -229,7 +229,7 @@ class SequencingReadWhereClause(TypedDict): protocol: Optional[EnumComparators[SequencingProtocol]] | None technology: Optional[EnumComparators[SequencingTechnology]] | None nucleic_acid: Optional[EnumComparators[NucleicAcid]] | None - has_ercc: Optional[BoolComparators] | None + clearlabs_export: Optional[BoolComparators] | None taxon: Optional[Annotated["TaxonWhereClause", strawberry.lazy("api.types.taxon")]] | None primer_file: Optional[Annotated["GenomicRangeWhereClause", strawberry.lazy("api.types.genomic_range")]] | None consensus_genomes: Optional[ @@ -250,14 +250,14 @@ class SequencingRead(EntityInterface): owner_user_id: int collection_id: int sample: Optional[Annotated["Sample", strawberry.lazy("api.types.sample")]] = load_sample_rows # type:ignore - protocol: SequencingProtocol + protocol: Optional[SequencingProtocol] = None r1_file_id: Optional[strawberry.ID] r1_file: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("r1_file") # type: ignore r2_file_id: Optional[strawberry.ID] r2_file: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("r2_file") # type: ignore technology: SequencingTechnology nucleic_acid: NucleicAcid - has_ercc: bool + clearlabs_export: bool taxon: Optional[Annotated["Taxon", strawberry.lazy("api.types.taxon")]] = load_taxon_rows # type:ignore primer_file: Optional[ Annotated["GenomicRange", strawberry.lazy("api.types.genomic_range")] @@ -325,7 +325,7 @@ class SequencingReadCountColumns(enum.Enum): r2_file = "r2_file" technology = "technology" nucleic_acid = "nucleic_acid" - has_ercc = "has_ercc" + clearlabs_export = "clearlabs_export" taxon = "taxon" primer_file = "primer_file" consensus_genomes = "consensus_genomes" @@ -335,6 +335,9 @@ class SequencingReadCountColumns(enum.Enum): producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ @@ -381,12 +384,12 @@ class SequencingReadAggregate: class SequencingReadCreateInput: collection_id: int sample_id: Optional[strawberry.ID] = None - protocol: SequencingProtocol + protocol: Optional[SequencingProtocol] = None r1_file_id: Optional[strawberry.ID] = None r2_file_id: Optional[strawberry.ID] = None technology: SequencingTechnology nucleic_acid: NucleicAcid - has_ercc: bool + clearlabs_export: bool taxon_id: Optional[strawberry.ID] = None primer_file_id: Optional[strawberry.ID] = None @@ -400,7 +403,7 @@ class SequencingReadUpdateInput: r2_file_id: Optional[strawberry.ID] = None technology: Optional[SequencingTechnology] = None nucleic_acid: Optional[NucleicAcid] = None - has_ercc: Optional[bool] = None + clearlabs_export: Optional[bool] = None taxon_id: Optional[strawberry.ID] = None primer_file_id: Optional[strawberry.ID] = None diff --git a/entities/api/types/taxon.py b/entities/api/types/taxon.py index 6d0d8528..8442c281 100644 --- a/entities/api/types/taxon.py +++ b/entities/api/types/taxon.py @@ -384,6 +384,9 @@ class TaxonCountColumns(enum.Enum): producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ diff --git a/entities/api/types/upstream_database.py b/entities/api/types/upstream_database.py index 26f1c809..9568bf68 100644 --- a/entities/api/types/upstream_database.py +++ b/entities/api/types/upstream_database.py @@ -192,6 +192,9 @@ class UpstreamDatabaseCountColumns(enum.Enum): producing_run_id = "producing_run_id" owner_user_id = "owner_user_id" collection_id = "collection_id" + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" """ diff --git a/entities/cerbos/policies/sequence_alignment_index.yaml b/entities/cerbos/policies/bulk_download.yaml similarity index 94% rename from entities/cerbos/policies/sequence_alignment_index.yaml rename to entities/cerbos/policies/bulk_download.yaml index cca152ac..6d1d6e98 100644 --- a/entities/cerbos/policies/sequence_alignment_index.yaml +++ b/entities/cerbos/policies/bulk_download.yaml @@ -6,7 +6,7 @@ resourcePolicy: version: "default" importDerivedRoles: - common_roles - resource: "sequence_alignment_index" + resource: "bulk_download" rules: - actions: ['view', 'create', 'update'] effect: EFFECT_ALLOW diff --git a/entities/cerbos/policies/host_organism.yaml b/entities/cerbos/policies/host_organism.yaml new file mode 100644 index 00000000..05754d9b --- /dev/null +++ b/entities/cerbos/policies/host_organism.yaml @@ -0,0 +1,22 @@ +# Auto-generated by running 'make codegen'. Do not edit. +# Make changes to the template codegen/templates/cerbos/policies/class_name.yaml.j2 instead. +# yaml-language-server: $schema=https://api.cerbos.dev/latest/cerbos/policy/v1/Policy.schema.json +apiVersion: api.cerbos.dev/v1 +resourcePolicy: + version: "default" + importDerivedRoles: + - common_roles + resource: "host_organism" + rules: + - actions: ['view', 'create', 'update'] + effect: EFFECT_ALLOW + derivedRoles: + - project_member + + - actions: ['download', 'delete'] + effect: EFFECT_ALLOW + derivedRoles: + - owner + schemas: + principalSchema: + ref: cerbos:///principal.json diff --git a/entities/cli/gql_schema.py b/entities/cli/gql_schema.py index 88720132..190d0b78 100644 --- a/entities/cli/gql_schema.py +++ b/entities/cli/gql_schema.py @@ -14,18 +14,36 @@ ######################################################################## # Scalars and Enumerations ######################################################################## -class AlignmentTool(sgqlc.types.Enum): +Boolean = sgqlc.types.Boolean + + +class BulkDownloadCountColumns(sgqlc.types.Enum): __schema__ = gql_schema - __choices__ = ("bowtie2", "czid_index_generation", "minimap2") + __choices__ = ( + "collection_id", + "created_at", + "deleted_at", + "download_type", + "entity_id", + "file", + "id", + "owner_user_id", + "producing_run_id", + "updated_at", + ) -Boolean = sgqlc.types.Boolean +class BulkDownloadType(sgqlc.types.Enum): + __schema__ = gql_schema + __choices__ = ("concatenate", "zip") class ConsensusGenomeCountColumns(sgqlc.types.Enum): __schema__ = gql_schema __choices__ = ( "collection_id", + "created_at", + "deleted_at", "entity_id", "id", "intermediate_outputs", @@ -36,6 +54,7 @@ class ConsensusGenomeCountColumns(sgqlc.types.Enum): "sequence", "sequence_read", "taxon", + "updated_at", ) @@ -43,12 +62,15 @@ class ContigCountColumns(sgqlc.types.Enum): __schema__ = gql_schema __choices__ = ( "collection_id", + "created_at", + "deleted_at", "entity_id", "id", "owner_user_id", "producing_run_id", "sequence", "sequencing_read", + "updated_at", ) @@ -72,6 +94,8 @@ class GenomicRangeCountColumns(sgqlc.types.Enum): __schema__ = gql_schema __choices__ = ( "collection_id", + "created_at", + "deleted_at", "entity_id", "file", "id", @@ -79,6 +103,7 @@ class GenomicRangeCountColumns(sgqlc.types.Enum): "producing_run_id", "reference_genome", "sequencing_reads", + "updated_at", ) @@ -86,6 +111,24 @@ class GlobalID(sgqlc.types.Scalar): __schema__ = gql_schema +class HostOrganismCountColumns(sgqlc.types.Enum): + __schema__ = gql_schema + __choices__ = ( + "collection_id", + "created_at", + "deleted_at", + "entity_id", + "host_filtering", + "id", + "name", + "owner_user_id", + "producing_run_id", + "sequence", + "updated_at", + "version", + ) + + ID = sgqlc.types.ID Int = sgqlc.types.Int @@ -99,12 +142,15 @@ class MetadatumCountColumns(sgqlc.types.Enum): __schema__ = gql_schema __choices__ = ( "collection_id", + "created_at", + "deleted_at", "entity_id", "field_name", "id", "owner_user_id", "producing_run_id", "sample", + "updated_at", "value", ) @@ -114,8 +160,13 @@ class MetricConsensusGenomeCountColumns(sgqlc.types.Enum): __choices__ = ( "collection_id", "consensus_genome", + "coverage_bin_size", + "coverage_breadth", "coverage_depth", - "coverage_viz_summary_file", + "coverage_total_length", + "coverage_viz", + "created_at", + "deleted_at", "entity_id", "gc_percent", "id", @@ -130,6 +181,7 @@ class MetricConsensusGenomeCountColumns(sgqlc.types.Enum): "ref_snps", "reference_genome_length", "total_reads", + "updated_at", ) @@ -140,7 +192,18 @@ class NucleicAcid(sgqlc.types.Enum): class PhylogeneticTreeCountColumns(sgqlc.types.Enum): __schema__ = gql_schema - __choices__ = ("collection_id", "entity_id", "format", "id", "owner_user_id", "producing_run_id", "tree") + __choices__ = ( + "collection_id", + "created_at", + "deleted_at", + "entity_id", + "format", + "id", + "owner_user_id", + "producing_run_id", + "tree", + "updated_at", + ) class PhylogeneticTreeFormat(sgqlc.types.Enum): @@ -152,19 +215,19 @@ class ReferenceGenomeCountColumns(sgqlc.types.Enum): __schema__ = gql_schema __choices__ = ( "accession_id", + "accession_name", "collection_id", "consensus_genomes", - "description", + "created_at", + "deleted_at", "entity_id", "file", - "file_index", "genomic_ranges", "id", - "name", "owner_user_id", "producing_run_id", - "sequence_alignment_indices", "taxon", + "updated_at", ) @@ -174,6 +237,8 @@ class SampleCountColumns(sgqlc.types.Enum): "collection_date", "collection_id", "collection_location", + "created_at", + "deleted_at", "description", "entity_id", "host_taxon", @@ -182,27 +247,14 @@ class SampleCountColumns(sgqlc.types.Enum): "name", "owner_user_id", "producing_run_id", + "rails_sample_id", "sample_type", "sequencing_reads", + "updated_at", "water_control", ) -class SequenceAlignmentIndexCountColumns(sgqlc.types.Enum): - __schema__ = gql_schema - __choices__ = ( - "collection_id", - "entity_id", - "id", - "index_file", - "owner_user_id", - "producing_run_id", - "reference_genome", - "tool", - "version", - ) - - class SequencingProtocol(sgqlc.types.Enum): __schema__ = gql_schema __choices__ = ( @@ -224,11 +276,13 @@ class SequencingProtocol(sgqlc.types.Enum): class SequencingReadCountColumns(sgqlc.types.Enum): __schema__ = gql_schema __choices__ = ( + "clearlabs_export", "collection_id", "consensus_genomes", "contigs", + "created_at", + "deleted_at", "entity_id", - "has_ercc", "id", "nucleic_acid", "owner_user_id", @@ -240,6 +294,7 @@ class SequencingReadCountColumns(sgqlc.types.Enum): "sample", "taxon", "technology", + "updated_at", ) @@ -257,6 +312,8 @@ class TaxonCountColumns(sgqlc.types.Enum): "collection_id", "common_name", "consensus_genomes", + "created_at", + "deleted_at", "description", "entity_id", "id", @@ -278,6 +335,7 @@ class TaxonCountColumns(sgqlc.types.Enum): "tax_species", "tax_subspecies", "tax_superkingdom", + "updated_at", "upstream_database", "upstream_database_identifier", "wikipedia_id", @@ -305,26 +363,23 @@ class UUID(sgqlc.types.Scalar): class UpstreamDatabaseCountColumns(sgqlc.types.Enum): __schema__ = gql_schema - __choices__ = ("collection_id", "entity_id", "id", "name", "owner_user_id", "producing_run_id", "taxa") + __choices__ = ( + "collection_id", + "created_at", + "deleted_at", + "entity_id", + "id", + "name", + "owner_user_id", + "producing_run_id", + "taxa", + "updated_at", + ) ######################################################################## # Input Objects ######################################################################## -class AlignmentToolEnumComparators(sgqlc.types.Input): - __schema__ = gql_schema - __field_names__ = ("_eq", "_neq", "_in", "_nin", "_gt", "_gte", "_lt", "_lte", "_is_null") - _eq = sgqlc.types.Field(AlignmentTool, graphql_name="_eq") - _neq = sgqlc.types.Field(AlignmentTool, graphql_name="_neq") - _in = sgqlc.types.Field(sgqlc.types.list_of(sgqlc.types.non_null(AlignmentTool)), graphql_name="_in") - _nin = sgqlc.types.Field(sgqlc.types.list_of(sgqlc.types.non_null(AlignmentTool)), graphql_name="_nin") - _gt = sgqlc.types.Field(AlignmentTool, graphql_name="_gt") - _gte = sgqlc.types.Field(AlignmentTool, graphql_name="_gte") - _lt = sgqlc.types.Field(AlignmentTool, graphql_name="_lt") - _lte = sgqlc.types.Field(AlignmentTool, graphql_name="_lte") - _is_null = sgqlc.types.Field(AlignmentTool, graphql_name="_is_null") - - class BoolComparators(sgqlc.types.Input): __schema__ = gql_schema __field_names__ = ("_eq", "_neq", "_in", "_nin", "_gt", "_gte", "_lt", "_lte", "_is_null") @@ -339,6 +394,52 @@ class BoolComparators(sgqlc.types.Input): _is_null = sgqlc.types.Field(Int, graphql_name="_is_null") +class BulkDownloadCreateInput(sgqlc.types.Input): + __schema__ = gql_schema + __field_names__ = ("collection_id", "download_type", "file_id") + collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") + download_type = sgqlc.types.Field(sgqlc.types.non_null(BulkDownloadType), graphql_name="downloadType") + file_id = sgqlc.types.Field(ID, graphql_name="fileId") + + +class BulkDownloadTypeEnumComparators(sgqlc.types.Input): + __schema__ = gql_schema + __field_names__ = ("_eq", "_neq", "_in", "_nin", "_gt", "_gte", "_lt", "_lte", "_is_null") + _eq = sgqlc.types.Field(BulkDownloadType, graphql_name="_eq") + _neq = sgqlc.types.Field(BulkDownloadType, graphql_name="_neq") + _in = sgqlc.types.Field(sgqlc.types.list_of(sgqlc.types.non_null(BulkDownloadType)), graphql_name="_in") + _nin = sgqlc.types.Field(sgqlc.types.list_of(sgqlc.types.non_null(BulkDownloadType)), graphql_name="_nin") + _gt = sgqlc.types.Field(BulkDownloadType, graphql_name="_gt") + _gte = sgqlc.types.Field(BulkDownloadType, graphql_name="_gte") + _lt = sgqlc.types.Field(BulkDownloadType, graphql_name="_lt") + _lte = sgqlc.types.Field(BulkDownloadType, graphql_name="_lte") + _is_null = sgqlc.types.Field(BulkDownloadType, graphql_name="_is_null") + + +class BulkDownloadUpdateInput(sgqlc.types.Input): + __schema__ = gql_schema + __field_names__ = ("collection_id", "download_type", "file_id") + collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") + download_type = sgqlc.types.Field(BulkDownloadType, graphql_name="downloadType") + file_id = sgqlc.types.Field(ID, graphql_name="fileId") + + +class BulkDownloadWhereClause(sgqlc.types.Input): + __schema__ = gql_schema + __field_names__ = ("id", "producing_run_id", "owner_user_id", "collection_id", "download_type") + id = sgqlc.types.Field("UUIDComparators", graphql_name="id") + producing_run_id = sgqlc.types.Field("IntComparators", graphql_name="producingRunId") + owner_user_id = sgqlc.types.Field("IntComparators", graphql_name="ownerUserId") + collection_id = sgqlc.types.Field("IntComparators", graphql_name="collectionId") + download_type = sgqlc.types.Field(BulkDownloadTypeEnumComparators, graphql_name="downloadType") + + +class BulkDownloadWhereClauseMutations(sgqlc.types.Input): + __schema__ = gql_schema + __field_names__ = ("id",) + id = sgqlc.types.Field("UUIDComparators", graphql_name="id") + + class ConsensusGenomeCreateInput(sgqlc.types.Input): __schema__ = gql_schema __field_names__ = ( @@ -347,6 +448,7 @@ class ConsensusGenomeCreateInput(sgqlc.types.Input): "sequence_read_id", "reference_genome_id", "sequence_id", + "metrics_id", "intermediate_outputs_id", ) collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") @@ -354,6 +456,7 @@ class ConsensusGenomeCreateInput(sgqlc.types.Input): sequence_read_id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="sequenceReadId") reference_genome_id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="referenceGenomeId") sequence_id = sgqlc.types.Field(ID, graphql_name="sequenceId") + metrics_id = sgqlc.types.Field(ID, graphql_name="metricsId") intermediate_outputs_id = sgqlc.types.Field(ID, graphql_name="intermediateOutputsId") @@ -365,6 +468,7 @@ class ConsensusGenomeUpdateInput(sgqlc.types.Input): "sequence_read_id", "reference_genome_id", "sequence_id", + "metrics_id", "intermediate_outputs_id", ) collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") @@ -372,6 +476,7 @@ class ConsensusGenomeUpdateInput(sgqlc.types.Input): sequence_read_id = sgqlc.types.Field(ID, graphql_name="sequenceReadId") reference_genome_id = sgqlc.types.Field(ID, graphql_name="referenceGenomeId") sequence_id = sgqlc.types.Field(ID, graphql_name="sequenceId") + metrics_id = sgqlc.types.Field(ID, graphql_name="metricsId") intermediate_outputs_id = sgqlc.types.Field(ID, graphql_name="intermediateOutputsId") @@ -537,7 +642,7 @@ class GenomicRangeCreateInput(sgqlc.types.Input): __schema__ = gql_schema __field_names__ = ("collection_id", "reference_genome_id", "file_id") collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") - reference_genome_id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="referenceGenomeId") + reference_genome_id = sgqlc.types.Field(ID, graphql_name="referenceGenomeId") file_id = sgqlc.types.Field(ID, graphql_name="fileId") @@ -573,6 +678,43 @@ class GenomicRangeWhereClauseMutations(sgqlc.types.Input): id = sgqlc.types.Field("UUIDComparators", graphql_name="id") +class HostOrganismCreateInput(sgqlc.types.Input): + __schema__ = gql_schema + __field_names__ = ("collection_id", "name", "version", "host_filtering_id", "sequence_id") + collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") + name = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="name") + version = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="version") + host_filtering_id = sgqlc.types.Field(ID, graphql_name="hostFilteringId") + sequence_id = sgqlc.types.Field(ID, graphql_name="sequenceId") + + +class HostOrganismUpdateInput(sgqlc.types.Input): + __schema__ = gql_schema + __field_names__ = ("collection_id", "name", "version", "host_filtering_id", "sequence_id") + collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") + name = sgqlc.types.Field(String, graphql_name="name") + version = sgqlc.types.Field(String, graphql_name="version") + host_filtering_id = sgqlc.types.Field(ID, graphql_name="hostFilteringId") + sequence_id = sgqlc.types.Field(ID, graphql_name="sequenceId") + + +class HostOrganismWhereClause(sgqlc.types.Input): + __schema__ = gql_schema + __field_names__ = ("id", "producing_run_id", "owner_user_id", "collection_id", "name", "version") + id = sgqlc.types.Field("UUIDComparators", graphql_name="id") + producing_run_id = sgqlc.types.Field("IntComparators", graphql_name="producingRunId") + owner_user_id = sgqlc.types.Field("IntComparators", graphql_name="ownerUserId") + collection_id = sgqlc.types.Field("IntComparators", graphql_name="collectionId") + name = sgqlc.types.Field("StrComparators", graphql_name="name") + version = sgqlc.types.Field("StrComparators", graphql_name="version") + + +class HostOrganismWhereClauseMutations(sgqlc.types.Input): + __schema__ = gql_schema + __field_names__ = ("id",) + id = sgqlc.types.Field("UUIDComparators", graphql_name="id") + + class IntComparators(sgqlc.types.Input): __schema__ = gql_schema __field_names__ = ("_eq", "_neq", "_in", "_nin", "_gt", "_gte", "_lt", "_lte", "_is_null") @@ -628,7 +770,6 @@ class MetricConsensusGenomeCreateInput(sgqlc.types.Input): __field_names__ = ( "collection_id", "consensus_genome_id", - "coverage_depth", "reference_genome_length", "percent_genome_called", "percent_identity", @@ -639,11 +780,14 @@ class MetricConsensusGenomeCreateInput(sgqlc.types.Input): "n_actg", "n_missing", "n_ambiguous", - "coverage_viz_summary_file_id", + "coverage_depth", + "coverage_breadth", + "coverage_bin_size", + "coverage_total_length", + "coverage_viz", ) collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") consensus_genome_id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="consensusGenomeId") - coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") reference_genome_length = sgqlc.types.Field(Float, graphql_name="referenceGenomeLength") percent_genome_called = sgqlc.types.Field(Float, graphql_name="percentGenomeCalled") percent_identity = sgqlc.types.Field(Float, graphql_name="percentIdentity") @@ -654,7 +798,14 @@ class MetricConsensusGenomeCreateInput(sgqlc.types.Input): n_actg = sgqlc.types.Field(Int, graphql_name="nActg") n_missing = sgqlc.types.Field(Int, graphql_name="nMissing") n_ambiguous = sgqlc.types.Field(Int, graphql_name="nAmbiguous") - coverage_viz_summary_file_id = sgqlc.types.Field(ID, graphql_name="coverageVizSummaryFileId") + coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") + coverage_breadth = sgqlc.types.Field(Float, graphql_name="coverageBreadth") + coverage_bin_size = sgqlc.types.Field(Float, graphql_name="coverageBinSize") + coverage_total_length = sgqlc.types.Field(Int, graphql_name="coverageTotalLength") + coverage_viz = sgqlc.types.Field( + sgqlc.types.list_of(sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null(Int)))), + graphql_name="coverageViz", + ) class MetricConsensusGenomeUpdateInput(sgqlc.types.Input): @@ -662,7 +813,6 @@ class MetricConsensusGenomeUpdateInput(sgqlc.types.Input): __field_names__ = ( "collection_id", "consensus_genome_id", - "coverage_depth", "reference_genome_length", "percent_genome_called", "percent_identity", @@ -673,11 +823,14 @@ class MetricConsensusGenomeUpdateInput(sgqlc.types.Input): "n_actg", "n_missing", "n_ambiguous", - "coverage_viz_summary_file_id", + "coverage_depth", + "coverage_breadth", + "coverage_bin_size", + "coverage_total_length", + "coverage_viz", ) collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") consensus_genome_id = sgqlc.types.Field(ID, graphql_name="consensusGenomeId") - coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") reference_genome_length = sgqlc.types.Field(Float, graphql_name="referenceGenomeLength") percent_genome_called = sgqlc.types.Field(Float, graphql_name="percentGenomeCalled") percent_identity = sgqlc.types.Field(Float, graphql_name="percentIdentity") @@ -688,7 +841,14 @@ class MetricConsensusGenomeUpdateInput(sgqlc.types.Input): n_actg = sgqlc.types.Field(Int, graphql_name="nActg") n_missing = sgqlc.types.Field(Int, graphql_name="nMissing") n_ambiguous = sgqlc.types.Field(Int, graphql_name="nAmbiguous") - coverage_viz_summary_file_id = sgqlc.types.Field(ID, graphql_name="coverageVizSummaryFileId") + coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") + coverage_breadth = sgqlc.types.Field(Float, graphql_name="coverageBreadth") + coverage_bin_size = sgqlc.types.Field(Float, graphql_name="coverageBinSize") + coverage_total_length = sgqlc.types.Field(Int, graphql_name="coverageTotalLength") + coverage_viz = sgqlc.types.Field( + sgqlc.types.list_of(sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null(Int)))), + graphql_name="coverageViz", + ) class MetricConsensusGenomeWhereClause(sgqlc.types.Input): @@ -699,7 +859,6 @@ class MetricConsensusGenomeWhereClause(sgqlc.types.Input): "owner_user_id", "collection_id", "consensus_genome", - "coverage_depth", "reference_genome_length", "percent_genome_called", "percent_identity", @@ -710,13 +869,16 @@ class MetricConsensusGenomeWhereClause(sgqlc.types.Input): "n_actg", "n_missing", "n_ambiguous", + "coverage_depth", + "coverage_breadth", + "coverage_bin_size", + "coverage_total_length", ) id = sgqlc.types.Field("UUIDComparators", graphql_name="id") producing_run_id = sgqlc.types.Field(IntComparators, graphql_name="producingRunId") owner_user_id = sgqlc.types.Field(IntComparators, graphql_name="ownerUserId") collection_id = sgqlc.types.Field(IntComparators, graphql_name="collectionId") consensus_genome = sgqlc.types.Field(ConsensusGenomeWhereClause, graphql_name="consensusGenome") - coverage_depth = sgqlc.types.Field(FloatComparators, graphql_name="coverageDepth") reference_genome_length = sgqlc.types.Field(FloatComparators, graphql_name="referenceGenomeLength") percent_genome_called = sgqlc.types.Field(FloatComparators, graphql_name="percentGenomeCalled") percent_identity = sgqlc.types.Field(FloatComparators, graphql_name="percentIdentity") @@ -727,6 +889,10 @@ class MetricConsensusGenomeWhereClause(sgqlc.types.Input): n_actg = sgqlc.types.Field(IntComparators, graphql_name="nActg") n_missing = sgqlc.types.Field(IntComparators, graphql_name="nMissing") n_ambiguous = sgqlc.types.Field(IntComparators, graphql_name="nAmbiguous") + coverage_depth = sgqlc.types.Field(FloatComparators, graphql_name="coverageDepth") + coverage_breadth = sgqlc.types.Field(FloatComparators, graphql_name="coverageBreadth") + coverage_bin_size = sgqlc.types.Field(FloatComparators, graphql_name="coverageBinSize") + coverage_total_length = sgqlc.types.Field(IntComparators, graphql_name="coverageTotalLength") class MetricConsensusGenomeWhereClauseMutations(sgqlc.types.Input): @@ -797,26 +963,22 @@ class PhylogeneticTreeWhereClauseMutations(sgqlc.types.Input): class ReferenceGenomeCreateInput(sgqlc.types.Input): __schema__ = gql_schema - __field_names__ = ("collection_id", "file_id", "file_index_id", "name", "description", "taxon_id", "accession_id") + __field_names__ = ("collection_id", "file_id", "taxon_id", "accession_id", "accession_name") collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") file_id = sgqlc.types.Field(ID, graphql_name="fileId") - file_index_id = sgqlc.types.Field(ID, graphql_name="fileIndexId") - name = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="name") - description = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="description") taxon_id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="taxonId") accession_id = sgqlc.types.Field(String, graphql_name="accessionId") + accession_name = sgqlc.types.Field(String, graphql_name="accessionName") class ReferenceGenomeUpdateInput(sgqlc.types.Input): __schema__ = gql_schema - __field_names__ = ("collection_id", "file_id", "file_index_id", "name", "description", "taxon_id", "accession_id") + __field_names__ = ("collection_id", "file_id", "taxon_id", "accession_id", "accession_name") collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") file_id = sgqlc.types.Field(ID, graphql_name="fileId") - file_index_id = sgqlc.types.Field(ID, graphql_name="fileIndexId") - name = sgqlc.types.Field(String, graphql_name="name") - description = sgqlc.types.Field(String, graphql_name="description") taxon_id = sgqlc.types.Field(ID, graphql_name="taxonId") accession_id = sgqlc.types.Field(String, graphql_name="accessionId") + accession_name = sgqlc.types.Field(String, graphql_name="accessionName") class ReferenceGenomeWhereClause(sgqlc.types.Input): @@ -826,11 +988,9 @@ class ReferenceGenomeWhereClause(sgqlc.types.Input): "producing_run_id", "owner_user_id", "collection_id", - "name", - "description", "taxon", "accession_id", - "sequence_alignment_indices", + "accession_name", "consensus_genomes", "genomic_ranges", ) @@ -838,13 +998,9 @@ class ReferenceGenomeWhereClause(sgqlc.types.Input): producing_run_id = sgqlc.types.Field(IntComparators, graphql_name="producingRunId") owner_user_id = sgqlc.types.Field(IntComparators, graphql_name="ownerUserId") collection_id = sgqlc.types.Field(IntComparators, graphql_name="collectionId") - name = sgqlc.types.Field("StrComparators", graphql_name="name") - description = sgqlc.types.Field("StrComparators", graphql_name="description") taxon = sgqlc.types.Field("TaxonWhereClause", graphql_name="taxon") accession_id = sgqlc.types.Field("StrComparators", graphql_name="accessionId") - sequence_alignment_indices = sgqlc.types.Field( - "SequenceAlignmentIndexWhereClause", graphql_name="sequenceAlignmentIndices" - ) + accession_name = sgqlc.types.Field("StrComparators", graphql_name="accessionName") consensus_genomes = sgqlc.types.Field(ConsensusGenomeWhereClause, graphql_name="consensusGenomes") genomic_ranges = sgqlc.types.Field(GenomicRangeWhereClause, graphql_name="genomicRanges") @@ -859,6 +1015,7 @@ class SampleCreateInput(sgqlc.types.Input): __schema__ = gql_schema __field_names__ = ( "collection_id", + "rails_sample_id", "name", "sample_type", "water_control", @@ -868,10 +1025,11 @@ class SampleCreateInput(sgqlc.types.Input): "host_taxon_id", ) collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") + rails_sample_id = sgqlc.types.Field(Int, graphql_name="railsSampleId") name = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="name") sample_type = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="sampleType") water_control = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name="waterControl") - collection_date = sgqlc.types.Field(DateTime, graphql_name="collectionDate") + collection_date = sgqlc.types.Field(sgqlc.types.non_null(DateTime), graphql_name="collectionDate") collection_location = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="collectionLocation") description = sgqlc.types.Field(String, graphql_name="description") host_taxon_id = sgqlc.types.Field(ID, graphql_name="hostTaxonId") @@ -881,6 +1039,7 @@ class SampleUpdateInput(sgqlc.types.Input): __schema__ = gql_schema __field_names__ = ( "collection_id", + "rails_sample_id", "name", "sample_type", "water_control", @@ -890,6 +1049,7 @@ class SampleUpdateInput(sgqlc.types.Input): "host_taxon_id", ) collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") + rails_sample_id = sgqlc.types.Field(Int, graphql_name="railsSampleId") name = sgqlc.types.Field(String, graphql_name="name") sample_type = sgqlc.types.Field(String, graphql_name="sampleType") water_control = sgqlc.types.Field(Boolean, graphql_name="waterControl") @@ -906,6 +1066,7 @@ class SampleWhereClause(sgqlc.types.Input): "producing_run_id", "owner_user_id", "collection_id", + "rails_sample_id", "name", "sample_type", "water_control", @@ -920,6 +1081,7 @@ class SampleWhereClause(sgqlc.types.Input): producing_run_id = sgqlc.types.Field(IntComparators, graphql_name="producingRunId") owner_user_id = sgqlc.types.Field(IntComparators, graphql_name="ownerUserId") collection_id = sgqlc.types.Field(IntComparators, graphql_name="collectionId") + rails_sample_id = sgqlc.types.Field(IntComparators, graphql_name="railsSampleId") name = sgqlc.types.Field("StrComparators", graphql_name="name") sample_type = sgqlc.types.Field("StrComparators", graphql_name="sampleType") water_control = sgqlc.types.Field(BoolComparators, graphql_name="waterControl") @@ -937,52 +1099,6 @@ class SampleWhereClauseMutations(sgqlc.types.Input): id = sgqlc.types.Field("UUIDComparators", graphql_name="id") -class SequenceAlignmentIndexCreateInput(sgqlc.types.Input): - __schema__ = gql_schema - __field_names__ = ("collection_id", "index_file_id", "reference_genome_id", "tool", "version") - collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") - index_file_id = sgqlc.types.Field(ID, graphql_name="indexFileId") - reference_genome_id = sgqlc.types.Field(ID, graphql_name="referenceGenomeId") - tool = sgqlc.types.Field(sgqlc.types.non_null(AlignmentTool), graphql_name="tool") - version = sgqlc.types.Field(String, graphql_name="version") - - -class SequenceAlignmentIndexUpdateInput(sgqlc.types.Input): - __schema__ = gql_schema - __field_names__ = ("collection_id", "index_file_id", "reference_genome_id", "tool", "version") - collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") - index_file_id = sgqlc.types.Field(ID, graphql_name="indexFileId") - reference_genome_id = sgqlc.types.Field(ID, graphql_name="referenceGenomeId") - tool = sgqlc.types.Field(AlignmentTool, graphql_name="tool") - version = sgqlc.types.Field(String, graphql_name="version") - - -class SequenceAlignmentIndexWhereClause(sgqlc.types.Input): - __schema__ = gql_schema - __field_names__ = ( - "id", - "producing_run_id", - "owner_user_id", - "collection_id", - "reference_genome", - "tool", - "version", - ) - id = sgqlc.types.Field("UUIDComparators", graphql_name="id") - producing_run_id = sgqlc.types.Field(IntComparators, graphql_name="producingRunId") - owner_user_id = sgqlc.types.Field(IntComparators, graphql_name="ownerUserId") - collection_id = sgqlc.types.Field(IntComparators, graphql_name="collectionId") - reference_genome = sgqlc.types.Field(ReferenceGenomeWhereClause, graphql_name="referenceGenome") - tool = sgqlc.types.Field(AlignmentToolEnumComparators, graphql_name="tool") - version = sgqlc.types.Field("StrComparators", graphql_name="version") - - -class SequenceAlignmentIndexWhereClauseMutations(sgqlc.types.Input): - __schema__ = gql_schema - __field_names__ = ("id",) - id = sgqlc.types.Field("UUIDComparators", graphql_name="id") - - class SequencingProtocolEnumComparators(sgqlc.types.Input): __schema__ = gql_schema __field_names__ = ("_eq", "_neq", "_in", "_nin", "_gt", "_gte", "_lt", "_lte", "_is_null") @@ -1007,18 +1123,18 @@ class SequencingReadCreateInput(sgqlc.types.Input): "r2_file_id", "technology", "nucleic_acid", - "has_ercc", + "clearlabs_export", "taxon_id", "primer_file_id", ) collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") sample_id = sgqlc.types.Field(ID, graphql_name="sampleId") - protocol = sgqlc.types.Field(sgqlc.types.non_null(SequencingProtocol), graphql_name="protocol") + protocol = sgqlc.types.Field(SequencingProtocol, graphql_name="protocol") r1_file_id = sgqlc.types.Field(ID, graphql_name="r1FileId") r2_file_id = sgqlc.types.Field(ID, graphql_name="r2FileId") technology = sgqlc.types.Field(sgqlc.types.non_null(SequencingTechnology), graphql_name="technology") nucleic_acid = sgqlc.types.Field(sgqlc.types.non_null(NucleicAcid), graphql_name="nucleicAcid") - has_ercc = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name="hasErcc") + clearlabs_export = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name="clearlabsExport") taxon_id = sgqlc.types.Field(ID, graphql_name="taxonId") primer_file_id = sgqlc.types.Field(ID, graphql_name="primerFileId") @@ -1033,7 +1149,7 @@ class SequencingReadUpdateInput(sgqlc.types.Input): "r2_file_id", "technology", "nucleic_acid", - "has_ercc", + "clearlabs_export", "taxon_id", "primer_file_id", ) @@ -1044,7 +1160,7 @@ class SequencingReadUpdateInput(sgqlc.types.Input): r2_file_id = sgqlc.types.Field(ID, graphql_name="r2FileId") technology = sgqlc.types.Field(SequencingTechnology, graphql_name="technology") nucleic_acid = sgqlc.types.Field(NucleicAcid, graphql_name="nucleicAcid") - has_ercc = sgqlc.types.Field(Boolean, graphql_name="hasErcc") + clearlabs_export = sgqlc.types.Field(Boolean, graphql_name="clearlabsExport") taxon_id = sgqlc.types.Field(ID, graphql_name="taxonId") primer_file_id = sgqlc.types.Field(ID, graphql_name="primerFileId") @@ -1060,7 +1176,7 @@ class SequencingReadWhereClause(sgqlc.types.Input): "protocol", "technology", "nucleic_acid", - "has_ercc", + "clearlabs_export", "taxon", "primer_file", "consensus_genomes", @@ -1074,7 +1190,7 @@ class SequencingReadWhereClause(sgqlc.types.Input): protocol = sgqlc.types.Field(SequencingProtocolEnumComparators, graphql_name="protocol") technology = sgqlc.types.Field("SequencingTechnologyEnumComparators", graphql_name="technology") nucleic_acid = sgqlc.types.Field(NucleicAcidEnumComparators, graphql_name="nucleicAcid") - has_ercc = sgqlc.types.Field(BoolComparators, graphql_name="hasErcc") + clearlabs_export = sgqlc.types.Field(BoolComparators, graphql_name="clearlabsExport") taxon = sgqlc.types.Field("TaxonWhereClause", graphql_name="taxon") primer_file = sgqlc.types.Field(GenomicRangeWhereClause, graphql_name="primerFile") consensus_genomes = sgqlc.types.Field(ConsensusGenomeWhereClause, graphql_name="consensusGenomes") @@ -1308,6 +1424,49 @@ class EntityInterface(sgqlc.types.Interface): _id = sgqlc.types.Field(sgqlc.types.non_null(GlobalID), graphql_name="_id") +class BulkDownloadAggregate(sgqlc.types.Type): + __schema__ = gql_schema + __field_names__ = ("aggregate",) + aggregate = sgqlc.types.Field("BulkDownloadAggregateFunctions", graphql_name="aggregate") + + +class BulkDownloadAggregateFunctions(sgqlc.types.Type): + __schema__ = gql_schema + __field_names__ = ("sum", "avg", "min", "max", "stddev", "variance", "count") + sum = sgqlc.types.Field("BulkDownloadNumericalColumns", graphql_name="sum") + avg = sgqlc.types.Field("BulkDownloadNumericalColumns", graphql_name="avg") + min = sgqlc.types.Field("BulkDownloadMinMaxColumns", graphql_name="min") + max = sgqlc.types.Field("BulkDownloadMinMaxColumns", graphql_name="max") + stddev = sgqlc.types.Field("BulkDownloadNumericalColumns", graphql_name="stddev") + variance = sgqlc.types.Field("BulkDownloadNumericalColumns", graphql_name="variance") + count = sgqlc.types.Field( + Int, + graphql_name="count", + args=sgqlc.types.ArgDict( + ( + ("distinct", sgqlc.types.Arg(Boolean, graphql_name="distinct", default=False)), + ("columns", sgqlc.types.Arg(BulkDownloadCountColumns, graphql_name="columns", default=None)), + ) + ), + ) + + +class BulkDownloadMinMaxColumns(sgqlc.types.Type): + __schema__ = gql_schema + __field_names__ = ("producing_run_id", "owner_user_id", "collection_id") + producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") + owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") + collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") + + +class BulkDownloadNumericalColumns(sgqlc.types.Type): + __schema__ = gql_schema + __field_names__ = ("producing_run_id", "owner_user_id", "collection_id") + producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") + owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") + collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") + + class ConsensusGenomeAggregate(sgqlc.types.Type): __schema__ = gql_schema __field_names__ = ("aggregate",) @@ -1538,6 +1697,51 @@ class GenomicRangeNumericalColumns(sgqlc.types.Type): collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") +class HostOrganismAggregate(sgqlc.types.Type): + __schema__ = gql_schema + __field_names__ = ("aggregate",) + aggregate = sgqlc.types.Field("HostOrganismAggregateFunctions", graphql_name="aggregate") + + +class HostOrganismAggregateFunctions(sgqlc.types.Type): + __schema__ = gql_schema + __field_names__ = ("sum", "avg", "min", "max", "stddev", "variance", "count") + sum = sgqlc.types.Field("HostOrganismNumericalColumns", graphql_name="sum") + avg = sgqlc.types.Field("HostOrganismNumericalColumns", graphql_name="avg") + min = sgqlc.types.Field("HostOrganismMinMaxColumns", graphql_name="min") + max = sgqlc.types.Field("HostOrganismMinMaxColumns", graphql_name="max") + stddev = sgqlc.types.Field("HostOrganismNumericalColumns", graphql_name="stddev") + variance = sgqlc.types.Field("HostOrganismNumericalColumns", graphql_name="variance") + count = sgqlc.types.Field( + Int, + graphql_name="count", + args=sgqlc.types.ArgDict( + ( + ("distinct", sgqlc.types.Arg(Boolean, graphql_name="distinct", default=False)), + ("columns", sgqlc.types.Arg(HostOrganismCountColumns, graphql_name="columns", default=None)), + ) + ), + ) + + +class HostOrganismMinMaxColumns(sgqlc.types.Type): + __schema__ = gql_schema + __field_names__ = ("producing_run_id", "owner_user_id", "collection_id", "name", "version") + producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") + owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") + collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") + name = sgqlc.types.Field(String, graphql_name="name") + version = sgqlc.types.Field(String, graphql_name="version") + + +class HostOrganismNumericalColumns(sgqlc.types.Type): + __schema__ = gql_schema + __field_names__ = ("producing_run_id", "owner_user_id", "collection_id") + producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") + owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") + collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") + + class MetadatumAggregate(sgqlc.types.Type): __schema__ = gql_schema __field_names__ = ("aggregate",) @@ -1626,30 +1830,12 @@ class MetricConsensusGenomeAggregateFunctions(sgqlc.types.Type): ) -class MetricConsensusGenomeConnection(sgqlc.types.relay.Connection): - __schema__ = gql_schema - __field_names__ = ("page_info", "edges") - page_info = sgqlc.types.Field(sgqlc.types.non_null("PageInfo"), graphql_name="pageInfo") - edges = sgqlc.types.Field( - sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("MetricConsensusGenomeEdge"))), - graphql_name="edges", - ) - - -class MetricConsensusGenomeEdge(sgqlc.types.Type): - __schema__ = gql_schema - __field_names__ = ("cursor", "node") - cursor = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="cursor") - node = sgqlc.types.Field(sgqlc.types.non_null("MetricConsensusGenome"), graphql_name="node") - - class MetricConsensusGenomeMinMaxColumns(sgqlc.types.Type): __schema__ = gql_schema __field_names__ = ( "producing_run_id", "owner_user_id", "collection_id", - "coverage_depth", "reference_genome_length", "percent_genome_called", "percent_identity", @@ -1660,11 +1846,14 @@ class MetricConsensusGenomeMinMaxColumns(sgqlc.types.Type): "n_actg", "n_missing", "n_ambiguous", + "coverage_depth", + "coverage_breadth", + "coverage_bin_size", + "coverage_total_length", ) producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") - coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") reference_genome_length = sgqlc.types.Field(Float, graphql_name="referenceGenomeLength") percent_genome_called = sgqlc.types.Field(Float, graphql_name="percentGenomeCalled") percent_identity = sgqlc.types.Field(Float, graphql_name="percentIdentity") @@ -1675,6 +1864,10 @@ class MetricConsensusGenomeMinMaxColumns(sgqlc.types.Type): n_actg = sgqlc.types.Field(Int, graphql_name="nActg") n_missing = sgqlc.types.Field(Int, graphql_name="nMissing") n_ambiguous = sgqlc.types.Field(Int, graphql_name="nAmbiguous") + coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") + coverage_breadth = sgqlc.types.Field(Float, graphql_name="coverageBreadth") + coverage_bin_size = sgqlc.types.Field(Float, graphql_name="coverageBinSize") + coverage_total_length = sgqlc.types.Field(Int, graphql_name="coverageTotalLength") class MetricConsensusGenomeNumericalColumns(sgqlc.types.Type): @@ -1683,7 +1876,6 @@ class MetricConsensusGenomeNumericalColumns(sgqlc.types.Type): "producing_run_id", "owner_user_id", "collection_id", - "coverage_depth", "reference_genome_length", "percent_genome_called", "percent_identity", @@ -1694,11 +1886,14 @@ class MetricConsensusGenomeNumericalColumns(sgqlc.types.Type): "n_actg", "n_missing", "n_ambiguous", + "coverage_depth", + "coverage_breadth", + "coverage_bin_size", + "coverage_total_length", ) producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") - coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") reference_genome_length = sgqlc.types.Field(Float, graphql_name="referenceGenomeLength") percent_genome_called = sgqlc.types.Field(Float, graphql_name="percentGenomeCalled") percent_identity = sgqlc.types.Field(Float, graphql_name="percentIdentity") @@ -1709,6 +1904,10 @@ class MetricConsensusGenomeNumericalColumns(sgqlc.types.Type): n_actg = sgqlc.types.Field(Int, graphql_name="nActg") n_missing = sgqlc.types.Field(Int, graphql_name="nMissing") n_ambiguous = sgqlc.types.Field(Int, graphql_name="nAmbiguous") + coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") + coverage_breadth = sgqlc.types.Field(Float, graphql_name="coverageBreadth") + coverage_bin_size = sgqlc.types.Field(Float, graphql_name="coverageBinSize") + coverage_total_length = sgqlc.types.Field(Int, graphql_name="coverageTotalLength") class MultipartUploadCredentials(sgqlc.types.Type): @@ -1757,9 +1956,9 @@ class Mutation(sgqlc.types.Type): "create_reference_genome", "update_reference_genome", "delete_reference_genome", - "create_sequence_alignment_index", - "update_sequence_alignment_index", - "delete_sequence_alignment_index", + "create_host_organism", + "update_host_organism", + "delete_host_organism", "create_metadatum", "update_metadatum", "delete_metadatum", @@ -1781,6 +1980,9 @@ class Mutation(sgqlc.types.Type): "create_phylogenetic_tree", "update_phylogenetic_tree", "delete_phylogenetic_tree", + "create_bulk_download", + "update_bulk_download", + "delete_bulk_download", ) create_file = sgqlc.types.Field( sgqlc.types.non_null(File), @@ -2010,53 +2212,45 @@ class Mutation(sgqlc.types.Type): ) ), ) - create_sequence_alignment_index = sgqlc.types.Field( - sgqlc.types.non_null("SequenceAlignmentIndex"), - graphql_name="createSequenceAlignmentIndex", + create_host_organism = sgqlc.types.Field( + sgqlc.types.non_null("HostOrganism"), + graphql_name="createHostOrganism", args=sgqlc.types.ArgDict( ( ( "input", - sgqlc.types.Arg( - sgqlc.types.non_null(SequenceAlignmentIndexCreateInput), graphql_name="input", default=None - ), + sgqlc.types.Arg(sgqlc.types.non_null(HostOrganismCreateInput), graphql_name="input", default=None), ), ) ), ) - update_sequence_alignment_index = sgqlc.types.Field( - sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("SequenceAlignmentIndex"))), - graphql_name="updateSequenceAlignmentIndex", + update_host_organism = sgqlc.types.Field( + sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("HostOrganism"))), + graphql_name="updateHostOrganism", args=sgqlc.types.ArgDict( ( ( "input", - sgqlc.types.Arg( - sgqlc.types.non_null(SequenceAlignmentIndexUpdateInput), graphql_name="input", default=None - ), + sgqlc.types.Arg(sgqlc.types.non_null(HostOrganismUpdateInput), graphql_name="input", default=None), ), ( "where", sgqlc.types.Arg( - sgqlc.types.non_null(SequenceAlignmentIndexWhereClauseMutations), - graphql_name="where", - default=None, + sgqlc.types.non_null(HostOrganismWhereClauseMutations), graphql_name="where", default=None ), ), ) ), ) - delete_sequence_alignment_index = sgqlc.types.Field( - sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("SequenceAlignmentIndex"))), - graphql_name="deleteSequenceAlignmentIndex", + delete_host_organism = sgqlc.types.Field( + sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("HostOrganism"))), + graphql_name="deleteHostOrganism", args=sgqlc.types.ArgDict( ( ( "where", sgqlc.types.Arg( - sgqlc.types.non_null(SequenceAlignmentIndexWhereClauseMutations), - graphql_name="where", - default=None, + sgqlc.types.non_null(HostOrganismWhereClauseMutations), graphql_name="where", default=None ), ), ) @@ -2374,6 +2568,50 @@ class Mutation(sgqlc.types.Type): ) ), ) + create_bulk_download = sgqlc.types.Field( + sgqlc.types.non_null("BulkDownload"), + graphql_name="createBulkDownload", + args=sgqlc.types.ArgDict( + ( + ( + "input", + sgqlc.types.Arg(sgqlc.types.non_null(BulkDownloadCreateInput), graphql_name="input", default=None), + ), + ) + ), + ) + update_bulk_download = sgqlc.types.Field( + sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("BulkDownload"))), + graphql_name="updateBulkDownload", + args=sgqlc.types.ArgDict( + ( + ( + "input", + sgqlc.types.Arg(sgqlc.types.non_null(BulkDownloadUpdateInput), graphql_name="input", default=None), + ), + ( + "where", + sgqlc.types.Arg( + sgqlc.types.non_null(BulkDownloadWhereClauseMutations), graphql_name="where", default=None + ), + ), + ) + ), + ) + delete_bulk_download = sgqlc.types.Field( + sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("BulkDownload"))), + graphql_name="deleteBulkDownload", + args=sgqlc.types.ArgDict( + ( + ( + "where", + sgqlc.types.Arg( + sgqlc.types.non_null(BulkDownloadWhereClauseMutations), graphql_name="where", default=None + ), + ), + ) + ), + ) class PageInfo(sgqlc.types.Type): @@ -2438,7 +2676,7 @@ class Query(sgqlc.types.Type): "sequencing_reads", "genomic_ranges", "reference_genomes", - "sequence_alignment_indices", + "host_organisms", "metadatas", "consensus_genomes", "metrics_consensus_genomes", @@ -2446,11 +2684,12 @@ class Query(sgqlc.types.Type): "upstream_databases", "contigs", "phylogenetic_trees", + "bulk_downloads", "samples_aggregate", "sequencing_reads_aggregate", "genomic_ranges_aggregate", "reference_genomes_aggregate", - "sequence_alignment_indices_aggregate", + "host_organisms_aggregate", "metadatas_aggregate", "consensus_genomes_aggregate", "metrics_consensus_genomes_aggregate", @@ -2458,6 +2697,7 @@ class Query(sgqlc.types.Type): "upstream_databases_aggregate", "contigs_aggregate", "phylogenetic_trees_aggregate", + "bulk_downloads_aggregate", ) node = sgqlc.types.Field( sgqlc.types.non_null(Node), @@ -2513,11 +2753,11 @@ class Query(sgqlc.types.Type): (("where", sgqlc.types.Arg(ReferenceGenomeWhereClause, graphql_name="where", default=None)),) ), ) - sequence_alignment_indices = sgqlc.types.Field( - sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("SequenceAlignmentIndex"))), - graphql_name="sequenceAlignmentIndices", + host_organisms = sgqlc.types.Field( + sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("HostOrganism"))), + graphql_name="hostOrganisms", args=sgqlc.types.ArgDict( - (("where", sgqlc.types.Arg(SequenceAlignmentIndexWhereClause, graphql_name="where", default=None)),) + (("where", sgqlc.types.Arg(HostOrganismWhereClause, graphql_name="where", default=None)),) ), ) metadatas = sgqlc.types.Field( @@ -2565,6 +2805,13 @@ class Query(sgqlc.types.Type): (("where", sgqlc.types.Arg(PhylogeneticTreeWhereClause, graphql_name="where", default=None)),) ), ) + bulk_downloads = sgqlc.types.Field( + sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("BulkDownload"))), + graphql_name="bulkDownloads", + args=sgqlc.types.ArgDict( + (("where", sgqlc.types.Arg(BulkDownloadWhereClause, graphql_name="where", default=None)),) + ), + ) samples_aggregate = sgqlc.types.Field( sgqlc.types.non_null("SampleAggregate"), graphql_name="samplesAggregate", @@ -2591,11 +2838,11 @@ class Query(sgqlc.types.Type): (("where", sgqlc.types.Arg(ReferenceGenomeWhereClause, graphql_name="where", default=None)),) ), ) - sequence_alignment_indices_aggregate = sgqlc.types.Field( - sgqlc.types.non_null("SequenceAlignmentIndexAggregate"), - graphql_name="sequenceAlignmentIndicesAggregate", + host_organisms_aggregate = sgqlc.types.Field( + sgqlc.types.non_null(HostOrganismAggregate), + graphql_name="hostOrganismsAggregate", args=sgqlc.types.ArgDict( - (("where", sgqlc.types.Arg(SequenceAlignmentIndexWhereClause, graphql_name="where", default=None)),) + (("where", sgqlc.types.Arg(HostOrganismWhereClause, graphql_name="where", default=None)),) ), ) metadatas_aggregate = sgqlc.types.Field( @@ -2643,6 +2890,13 @@ class Query(sgqlc.types.Type): (("where", sgqlc.types.Arg(PhylogeneticTreeWhereClause, graphql_name="where", default=None)),) ), ) + bulk_downloads_aggregate = sgqlc.types.Field( + sgqlc.types.non_null(BulkDownloadAggregate), + graphql_name="bulkDownloadsAggregate", + args=sgqlc.types.ArgDict( + (("where", sgqlc.types.Arg(BulkDownloadWhereClause, graphql_name="where", default=None)),) + ), + ) class ReferenceGenomeAggregate(sgqlc.types.Type): @@ -2690,13 +2944,12 @@ class ReferenceGenomeEdge(sgqlc.types.Type): class ReferenceGenomeMinMaxColumns(sgqlc.types.Type): __schema__ = gql_schema - __field_names__ = ("producing_run_id", "owner_user_id", "collection_id", "name", "description", "accession_id") + __field_names__ = ("producing_run_id", "owner_user_id", "collection_id", "accession_id", "accession_name") producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") - name = sgqlc.types.Field(String, graphql_name="name") - description = sgqlc.types.Field(String, graphql_name="description") accession_id = sgqlc.types.Field(String, graphql_name="accessionId") + accession_name = sgqlc.types.Field(String, graphql_name="accessionName") class ReferenceGenomeNumericalColumns(sgqlc.types.Type): @@ -2756,6 +3009,7 @@ class SampleMinMaxColumns(sgqlc.types.Type): "producing_run_id", "owner_user_id", "collection_id", + "rails_sample_id", "name", "sample_type", "collection_date", @@ -2765,6 +3019,7 @@ class SampleMinMaxColumns(sgqlc.types.Type): producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") + rails_sample_id = sgqlc.types.Field(Int, graphql_name="railsSampleId") name = sgqlc.types.Field(String, graphql_name="name") sample_type = sgqlc.types.Field(String, graphql_name="sampleType") collection_date = sgqlc.types.Field(DateTime, graphql_name="collectionDate") @@ -2774,71 +3029,11 @@ class SampleMinMaxColumns(sgqlc.types.Type): class SampleNumericalColumns(sgqlc.types.Type): __schema__ = gql_schema - __field_names__ = ("producing_run_id", "owner_user_id", "collection_id") - producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") - owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") - collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") - - -class SequenceAlignmentIndexAggregate(sgqlc.types.Type): - __schema__ = gql_schema - __field_names__ = ("aggregate",) - aggregate = sgqlc.types.Field("SequenceAlignmentIndexAggregateFunctions", graphql_name="aggregate") - - -class SequenceAlignmentIndexAggregateFunctions(sgqlc.types.Type): - __schema__ = gql_schema - __field_names__ = ("sum", "avg", "min", "max", "stddev", "variance", "count") - sum = sgqlc.types.Field("SequenceAlignmentIndexNumericalColumns", graphql_name="sum") - avg = sgqlc.types.Field("SequenceAlignmentIndexNumericalColumns", graphql_name="avg") - min = sgqlc.types.Field("SequenceAlignmentIndexMinMaxColumns", graphql_name="min") - max = sgqlc.types.Field("SequenceAlignmentIndexMinMaxColumns", graphql_name="max") - stddev = sgqlc.types.Field("SequenceAlignmentIndexNumericalColumns", graphql_name="stddev") - variance = sgqlc.types.Field("SequenceAlignmentIndexNumericalColumns", graphql_name="variance") - count = sgqlc.types.Field( - Int, - graphql_name="count", - args=sgqlc.types.ArgDict( - ( - ("distinct", sgqlc.types.Arg(Boolean, graphql_name="distinct", default=False)), - ("columns", sgqlc.types.Arg(SequenceAlignmentIndexCountColumns, graphql_name="columns", default=None)), - ) - ), - ) - - -class SequenceAlignmentIndexConnection(sgqlc.types.relay.Connection): - __schema__ = gql_schema - __field_names__ = ("page_info", "edges") - page_info = sgqlc.types.Field(sgqlc.types.non_null(PageInfo), graphql_name="pageInfo") - edges = sgqlc.types.Field( - sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("SequenceAlignmentIndexEdge"))), - graphql_name="edges", - ) - - -class SequenceAlignmentIndexEdge(sgqlc.types.Type): - __schema__ = gql_schema - __field_names__ = ("cursor", "node") - cursor = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="cursor") - node = sgqlc.types.Field(sgqlc.types.non_null("SequenceAlignmentIndex"), graphql_name="node") - - -class SequenceAlignmentIndexMinMaxColumns(sgqlc.types.Type): - __schema__ = gql_schema - __field_names__ = ("producing_run_id", "owner_user_id", "collection_id", "version") - producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") - owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") - collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") - version = sgqlc.types.Field(String, graphql_name="version") - - -class SequenceAlignmentIndexNumericalColumns(sgqlc.types.Type): - __schema__ = gql_schema - __field_names__ = ("producing_run_id", "owner_user_id", "collection_id") + __field_names__ = ("producing_run_id", "owner_user_id", "collection_id", "rails_sample_id") producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") owner_user_id = sgqlc.types.Field(Int, graphql_name="ownerUserId") collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") + rails_sample_id = sgqlc.types.Field(Int, graphql_name="railsSampleId") class SequencingReadAggregate(sgqlc.types.Type): @@ -3027,6 +3222,22 @@ class UpstreamDatabaseNumericalColumns(sgqlc.types.Type): collection_id = sgqlc.types.Field(Int, graphql_name="collectionId") +class BulkDownload(sgqlc.types.Type, EntityInterface, Node): + __schema__ = gql_schema + __field_names__ = ("id", "producing_run_id", "owner_user_id", "collection_id", "download_type", "file_id", "file") + id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="id") + producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") + owner_user_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="ownerUserId") + collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") + download_type = sgqlc.types.Field(sgqlc.types.non_null(BulkDownloadType), graphql_name="downloadType") + file_id = sgqlc.types.Field(ID, graphql_name="fileId") + file = sgqlc.types.Field( + File, + graphql_name="file", + args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), + ) + + class ConsensusGenome(sgqlc.types.Type, EntityInterface, Node): __schema__ = gql_schema __field_names__ = ( @@ -3039,10 +3250,9 @@ class ConsensusGenome(sgqlc.types.Type, EntityInterface, Node): "reference_genome", "sequence_id", "sequence", + "metrics", "intermediate_outputs_id", "intermediate_outputs", - "metrics", - "metrics_aggregate", ) id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="id") producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") @@ -3073,32 +3283,19 @@ class ConsensusGenome(sgqlc.types.Type, EntityInterface, Node): graphql_name="sequence", args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), ) - intermediate_outputs_id = sgqlc.types.Field(ID, graphql_name="intermediateOutputsId") - intermediate_outputs = sgqlc.types.Field( - File, - graphql_name="intermediateOutputs", - args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), - ) metrics = sgqlc.types.Field( - sgqlc.types.non_null(MetricConsensusGenomeConnection), + "MetricConsensusGenome", graphql_name="metrics", - args=sgqlc.types.ArgDict( - ( - ("where", sgqlc.types.Arg(MetricConsensusGenomeWhereClause, graphql_name="where", default=None)), - ("before", sgqlc.types.Arg(String, graphql_name="before", default=None)), - ("after", sgqlc.types.Arg(String, graphql_name="after", default=None)), - ("first", sgqlc.types.Arg(Int, graphql_name="first", default=None)), - ("last", sgqlc.types.Arg(Int, graphql_name="last", default=None)), - ) - ), - ) - metrics_aggregate = sgqlc.types.Field( - MetricConsensusGenomeAggregate, - graphql_name="metricsAggregate", args=sgqlc.types.ArgDict( (("where", sgqlc.types.Arg(MetricConsensusGenomeWhereClause, graphql_name="where", default=None)),) ), ) + intermediate_outputs_id = sgqlc.types.Field(ID, graphql_name="intermediateOutputsId") + intermediate_outputs = sgqlc.types.Field( + File, + graphql_name="intermediateOutputs", + args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), + ) class Contig(sgqlc.types.Type, EntityInterface, Node): @@ -3170,6 +3367,40 @@ class GenomicRange(sgqlc.types.Type, EntityInterface, Node): ) +class HostOrganism(sgqlc.types.Type, EntityInterface, Node): + __schema__ = gql_schema + __field_names__ = ( + "id", + "producing_run_id", + "owner_user_id", + "collection_id", + "name", + "version", + "host_filtering_id", + "host_filtering", + "sequence_id", + "sequence", + ) + id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="id") + producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") + owner_user_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="ownerUserId") + collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") + name = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="name") + version = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="version") + host_filtering_id = sgqlc.types.Field(ID, graphql_name="hostFilteringId") + host_filtering = sgqlc.types.Field( + File, + graphql_name="hostFiltering", + args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), + ) + sequence_id = sgqlc.types.Field(ID, graphql_name="sequenceId") + sequence = sgqlc.types.Field( + File, + graphql_name="sequence", + args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), + ) + + class Metadatum(sgqlc.types.Type, EntityInterface, Node): __schema__ = gql_schema __field_names__ = ("id", "producing_run_id", "owner_user_id", "collection_id", "sample", "field_name", "value") @@ -3194,7 +3425,6 @@ class MetricConsensusGenome(sgqlc.types.Type, EntityInterface, Node): "owner_user_id", "collection_id", "consensus_genome", - "coverage_depth", "reference_genome_length", "percent_genome_called", "percent_identity", @@ -3205,8 +3435,11 @@ class MetricConsensusGenome(sgqlc.types.Type, EntityInterface, Node): "n_actg", "n_missing", "n_ambiguous", - "coverage_viz_summary_file_id", - "coverage_viz_summary_file", + "coverage_depth", + "coverage_breadth", + "coverage_bin_size", + "coverage_total_length", + "coverage_viz", ) id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="id") producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") @@ -3219,7 +3452,6 @@ class MetricConsensusGenome(sgqlc.types.Type, EntityInterface, Node): (("where", sgqlc.types.Arg(ConsensusGenomeWhereClause, graphql_name="where", default=None)),) ), ) - coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") reference_genome_length = sgqlc.types.Field(Float, graphql_name="referenceGenomeLength") percent_genome_called = sgqlc.types.Field(Float, graphql_name="percentGenomeCalled") percent_identity = sgqlc.types.Field(Float, graphql_name="percentIdentity") @@ -3230,11 +3462,13 @@ class MetricConsensusGenome(sgqlc.types.Type, EntityInterface, Node): n_actg = sgqlc.types.Field(Int, graphql_name="nActg") n_missing = sgqlc.types.Field(Int, graphql_name="nMissing") n_ambiguous = sgqlc.types.Field(Int, graphql_name="nAmbiguous") - coverage_viz_summary_file_id = sgqlc.types.Field(ID, graphql_name="coverageVizSummaryFileId") - coverage_viz_summary_file = sgqlc.types.Field( - File, - graphql_name="coverageVizSummaryFile", - args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), + coverage_depth = sgqlc.types.Field(Float, graphql_name="coverageDepth") + coverage_breadth = sgqlc.types.Field(Float, graphql_name="coverageBreadth") + coverage_bin_size = sgqlc.types.Field(Float, graphql_name="coverageBinSize") + coverage_total_length = sgqlc.types.Field(Int, graphql_name="coverageTotalLength") + coverage_viz = sgqlc.types.Field( + sgqlc.types.list_of(sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null(Int)))), + graphql_name="coverageViz", ) @@ -3263,14 +3497,9 @@ class ReferenceGenome(sgqlc.types.Type, EntityInterface, Node): "collection_id", "file_id", "file", - "file_index_id", - "file_index", - "name", - "description", "taxon", "accession_id", - "sequence_alignment_indices", - "sequence_alignment_indices_aggregate", + "accession_name", "consensus_genomes", "consensus_genomes_aggregate", "genomic_ranges", @@ -3286,40 +3515,13 @@ class ReferenceGenome(sgqlc.types.Type, EntityInterface, Node): graphql_name="file", args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), ) - file_index_id = sgqlc.types.Field(ID, graphql_name="fileIndexId") - file_index = sgqlc.types.Field( - File, - graphql_name="fileIndex", - args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), - ) - name = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="name") - description = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="description") taxon = sgqlc.types.Field( "Taxon", graphql_name="taxon", args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(TaxonWhereClause, graphql_name="where", default=None)),)), ) accession_id = sgqlc.types.Field(String, graphql_name="accessionId") - sequence_alignment_indices = sgqlc.types.Field( - sgqlc.types.non_null(SequenceAlignmentIndexConnection), - graphql_name="sequenceAlignmentIndices", - args=sgqlc.types.ArgDict( - ( - ("where", sgqlc.types.Arg(SequenceAlignmentIndexWhereClause, graphql_name="where", default=None)), - ("before", sgqlc.types.Arg(String, graphql_name="before", default=None)), - ("after", sgqlc.types.Arg(String, graphql_name="after", default=None)), - ("first", sgqlc.types.Arg(Int, graphql_name="first", default=None)), - ("last", sgqlc.types.Arg(Int, graphql_name="last", default=None)), - ) - ), - ) - sequence_alignment_indices_aggregate = sgqlc.types.Field( - SequenceAlignmentIndexAggregate, - graphql_name="sequenceAlignmentIndicesAggregate", - args=sgqlc.types.ArgDict( - (("where", sgqlc.types.Arg(SequenceAlignmentIndexWhereClause, graphql_name="where", default=None)),) - ), - ) + accession_name = sgqlc.types.Field(String, graphql_name="accessionName") consensus_genomes = sgqlc.types.Field( sgqlc.types.non_null(ConsensusGenomeConnection), graphql_name="consensusGenomes", @@ -3369,6 +3571,7 @@ class Sample(sgqlc.types.Type, EntityInterface, Node): "producing_run_id", "owner_user_id", "collection_id", + "rails_sample_id", "name", "sample_type", "water_control", @@ -3385,10 +3588,11 @@ class Sample(sgqlc.types.Type, EntityInterface, Node): producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") owner_user_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="ownerUserId") collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") + rails_sample_id = sgqlc.types.Field(Int, graphql_name="railsSampleId") name = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="name") sample_type = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="sampleType") water_control = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name="waterControl") - collection_date = sgqlc.types.Field(DateTime, graphql_name="collectionDate") + collection_date = sgqlc.types.Field(sgqlc.types.non_null(DateTime), graphql_name="collectionDate") collection_location = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name="collectionLocation") description = sgqlc.types.Field(String, graphql_name="description") host_taxon = sgqlc.types.Field( @@ -3438,40 +3642,6 @@ class Sample(sgqlc.types.Type, EntityInterface, Node): ) -class SequenceAlignmentIndex(sgqlc.types.Type, EntityInterface, Node): - __schema__ = gql_schema - __field_names__ = ( - "id", - "producing_run_id", - "owner_user_id", - "collection_id", - "index_file_id", - "index_file", - "reference_genome", - "tool", - "version", - ) - id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name="id") - producing_run_id = sgqlc.types.Field(Int, graphql_name="producingRunId") - owner_user_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="ownerUserId") - collection_id = sgqlc.types.Field(sgqlc.types.non_null(Int), graphql_name="collectionId") - index_file_id = sgqlc.types.Field(ID, graphql_name="indexFileId") - index_file = sgqlc.types.Field( - File, - graphql_name="indexFile", - args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(FileWhereClause, graphql_name="where", default=None)),)), - ) - reference_genome = sgqlc.types.Field( - ReferenceGenome, - graphql_name="referenceGenome", - args=sgqlc.types.ArgDict( - (("where", sgqlc.types.Arg(ReferenceGenomeWhereClause, graphql_name="where", default=None)),) - ), - ) - tool = sgqlc.types.Field(sgqlc.types.non_null(AlignmentTool), graphql_name="tool") - version = sgqlc.types.Field(String, graphql_name="version") - - class SequencingRead(sgqlc.types.Type, EntityInterface, Node): __schema__ = gql_schema __field_names__ = ( @@ -3487,7 +3657,7 @@ class SequencingRead(sgqlc.types.Type, EntityInterface, Node): "r2_file", "technology", "nucleic_acid", - "has_ercc", + "clearlabs_export", "taxon", "primer_file", "consensus_genomes", @@ -3504,7 +3674,7 @@ class SequencingRead(sgqlc.types.Type, EntityInterface, Node): graphql_name="sample", args=sgqlc.types.ArgDict((("where", sgqlc.types.Arg(SampleWhereClause, graphql_name="where", default=None)),)), ) - protocol = sgqlc.types.Field(sgqlc.types.non_null(SequencingProtocol), graphql_name="protocol") + protocol = sgqlc.types.Field(SequencingProtocol, graphql_name="protocol") r1_file_id = sgqlc.types.Field(ID, graphql_name="r1FileId") r1_file = sgqlc.types.Field( File, @@ -3519,7 +3689,7 @@ class SequencingRead(sgqlc.types.Type, EntityInterface, Node): ) technology = sgqlc.types.Field(sgqlc.types.non_null(SequencingTechnology), graphql_name="technology") nucleic_acid = sgqlc.types.Field(sgqlc.types.non_null(NucleicAcid), graphql_name="nucleicAcid") - has_ercc = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name="hasErcc") + clearlabs_export = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name="clearlabsExport") taxon = sgqlc.types.Field( "Taxon", graphql_name="taxon", diff --git a/entities/database/migrations/versions/20240129_115001_schema_updates.py b/entities/database/migrations/versions/20240129_115001_schema_updates.py new file mode 100644 index 00000000..0517df36 --- /dev/null +++ b/entities/database/migrations/versions/20240129_115001_schema_updates.py @@ -0,0 +1,149 @@ +"""schema updates + +Create Date: 2024-01-29 19:50:02.582750 + +""" +import sqlalchemy as sa +from alembic import op +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = "20240129_115001" +down_revision = "20240129_100617" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.create_table( + "bulk_download", + sa.Column( + "download_type", sa.Enum("concatenate", "zip", name="bulkdownloadtype", native_enum=False), nullable=False + ), + sa.Column("file_id", sa.UUID(), nullable=True), + sa.Column("entity_id", sa.UUID(), nullable=False), + sa.ForeignKeyConstraint(["entity_id"], ["entity.id"], name=op.f("fk_bulk_download_entity_id_entity")), + sa.ForeignKeyConstraint(["file_id"], ["file.id"], name=op.f("fk_bulk_download_file_id_file")), + sa.PrimaryKeyConstraint("entity_id", name=op.f("pk_bulk_download")), + ) + op.create_table( + "host_organism", + sa.Column("name", sa.String(), nullable=False), + sa.Column("version", sa.String(), nullable=False), + sa.Column("host_filtering_id", sa.UUID(), nullable=True), + sa.Column("sequence_id", sa.UUID(), nullable=True), + sa.Column("entity_id", sa.UUID(), nullable=False), + sa.ForeignKeyConstraint(["entity_id"], ["entity.id"], name=op.f("fk_host_organism_entity_id_entity")), + sa.ForeignKeyConstraint( + ["host_filtering_id"], ["file.id"], name=op.f("fk_host_organism_host_filtering_id_file") + ), + sa.ForeignKeyConstraint(["sequence_id"], ["file.id"], name=op.f("fk_host_organism_sequence_id_file")), + sa.PrimaryKeyConstraint("entity_id", name=op.f("pk_host_organism")), + ) + op.drop_index("sequence_alignment_index_index_file", table_name="sequence_alignment_index") + op.drop_index("sequence_alignment_index_reference_genome", table_name="sequence_alignment_index") + op.drop_table("sequence_alignment_index") + op.add_column( + "entity", sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False) + ) + op.add_column("entity", sa.Column("updated_at", sa.DateTime(timezone=True), nullable=True)) + op.add_column("entity", sa.Column("deleted_at", sa.DateTime(timezone=True), nullable=True)) + op.alter_column("genomic_range", "reference_genome_id", existing_type=sa.UUID(), nullable=True) + op.add_column("metric_consensus_genome", sa.Column("coverage_breadth", sa.Float(), nullable=True)) + op.add_column("metric_consensus_genome", sa.Column("coverage_bin_size", sa.Float(), nullable=True)) + op.add_column("metric_consensus_genome", sa.Column("coverage_total_length", sa.Integer(), nullable=True)) + op.add_column( + "metric_consensus_genome", sa.Column("coverage_viz", postgresql.JSONB(astext_type=sa.Text()), nullable=True) + ) + op.drop_index("metric_consensus_genome_coverage_viz_summary", table_name="metric_consensus_genome") + op.drop_constraint( + "fk_metric_consensus_genome_coverage_viz_summary_file_id_file", "metric_consensus_genome", type_="foreignkey" + ) + op.drop_column("metric_consensus_genome", "coverage_viz_summary_file_id") + op.drop_index("reference_genome_file_index", table_name="reference_genome") + op.drop_constraint("fk_reference_genome_file_index_id_file", "reference_genome", type_="foreignkey") + op.drop_column("reference_genome", "description") + op.drop_column("reference_genome", "file_index_id") + op.drop_column("reference_genome", "name") + op.add_column("sample", sa.Column("rails_sample_id", sa.Integer(), nullable=True)) + op.alter_column("sample", "collection_date", existing_type=postgresql.TIMESTAMP(), nullable=False) + op.add_column("sequencing_read", sa.Column("clearlabs_export", sa.Boolean(), nullable=False)) + op.alter_column("sequencing_read", "protocol", existing_type=sa.VARCHAR(length=20), nullable=True) + op.drop_column("sequencing_read", "has_ercc") + op.add_column("reference_genome", sa.Column("accession_name", sa.String(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade() -> None: + # sequence_alignment_index_index_file + # sequence_alignment_index_reference_genome + # metric_consensus_genome_coverage_viz_summary + # reference_genome_file_index + + # ### commands auto generated by Alembic - please adjust! ### + op.add_column("sequencing_read", sa.Column("has_ercc", sa.BOOLEAN(), autoincrement=False, nullable=False)) + op.alter_column("sequencing_read", "protocol", existing_type=sa.VARCHAR(length=20), nullable=False) + op.drop_column("sequencing_read", "clearlabs_export") + op.alter_column("sample", "collection_date", existing_type=postgresql.TIMESTAMP(), nullable=True) + op.drop_column("sample", "rails_sample_id") + op.add_column("reference_genome", sa.Column("name", sa.VARCHAR(), autoincrement=False, nullable=False)) + op.add_column("reference_genome", sa.Column("file_index_id", sa.UUID(), autoincrement=False, nullable=True)) + op.add_column("reference_genome", sa.Column("description", sa.VARCHAR(), autoincrement=False, nullable=False)) + op.create_foreign_key( + "fk_reference_genome_file_index_id_file", "reference_genome", "file", ["file_index_id"], ["id"] + ) + op.create_index("reference_genome_file_index", "reference_genome", ["file_index_id"], unique=False) + op.add_column( + "metric_consensus_genome", + sa.Column("coverage_viz_summary_file_id", sa.UUID(), autoincrement=False, nullable=True), + ) + op.create_foreign_key( + "fk_metric_consensus_genome_coverage_viz_summary_file_id_file", + "metric_consensus_genome", + "file", + ["coverage_viz_summary_file_id"], + ["id"], + ) + op.create_index( + "metric_consensus_genome_coverage_viz_summary", + "metric_consensus_genome", + ["coverage_viz_summary_file_id"], + unique=False, + ) + op.drop_column("metric_consensus_genome", "coverage_viz") + op.drop_column("metric_consensus_genome", "coverage_total_length") + op.drop_column("metric_consensus_genome", "coverage_bin_size") + op.drop_column("metric_consensus_genome", "coverage_breadth") + op.alter_column("genomic_range", "reference_genome_id", existing_type=sa.UUID(), nullable=False) + op.drop_column("entity", "deleted_at") + op.drop_column("entity", "updated_at") + op.drop_column("entity", "created_at") + op.drop_constraint( + op.f("fk_consensus_genome_metrics_id_metric_consensus_genome"), "consensus_genome", type_="foreignkey" + ) + op.drop_column("consensus_genome", "metrics_id") + op.create_table( + "sequence_alignment_index", + sa.Column("index_file_id", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("reference_genome_id", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("tool", sa.VARCHAR(length=21), autoincrement=False, nullable=False), + sa.Column("entity_id", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("version", sa.VARCHAR(), autoincrement=False, nullable=True), + sa.ForeignKeyConstraint(["entity_id"], ["entity.id"], name="fk_sequence_alignment_index_entity_id_entity"), + sa.ForeignKeyConstraint(["index_file_id"], ["file.id"], name="fk_sequence_alignment_index_index_file_id_file"), + sa.ForeignKeyConstraint( + ["reference_genome_id"], + ["reference_genome.entity_id"], + name="fk_sequence_alignment_index_reference_genome_id_referen_f08b", + ), + sa.PrimaryKeyConstraint("entity_id", name="pk_sequence_alignment_index"), + ) + op.create_index( + "sequence_alignment_index_reference_genome", "sequence_alignment_index", ["reference_genome_id"], unique=False + ) + op.create_index("sequence_alignment_index_index_file", "sequence_alignment_index", ["index_file_id"], unique=False) + op.drop_table("host_organism") + op.drop_table("bulk_download") + op.drop_column("reference_genome", "accession_name") + # ### end Alembic commands ### diff --git a/entities/database/models/__init__.py b/entities/database/models/__init__.py index de2725a1..9d64d2ab 100644 --- a/entities/database/models/__init__.py +++ b/entities/database/models/__init__.py @@ -14,7 +14,7 @@ from database.models.sequencing_read import SequencingRead # noqa: F401 from database.models.genomic_range import GenomicRange # noqa: F401 from database.models.reference_genome import ReferenceGenome # noqa: F401 -from database.models.sequence_alignment_index import SequenceAlignmentIndex # noqa: F401 +from database.models.host_organism import HostOrganism # noqa: F401 from database.models.metadatum import Metadatum # noqa: F401 from database.models.consensus_genome import ConsensusGenome # noqa: F401 from database.models.metric_consensus_genome import MetricConsensusGenome # noqa: F401 @@ -22,6 +22,7 @@ from database.models.upstream_database import UpstreamDatabase # noqa: F401 from database.models.contig import Contig # noqa: F401 from database.models.phylogenetic_tree import PhylogeneticTree # noqa: F401 +from database.models.bulk_download import BulkDownload # noqa: F401 from database.models.file import File, FileStatus # noqa: F401 diff --git a/entities/database/models/bulk_download.py b/entities/database/models/bulk_download.py new file mode 100644 index 00000000..87a36c28 --- /dev/null +++ b/entities/database/models/bulk_download.py @@ -0,0 +1,30 @@ +""" +SQLAlchemy database model for BulkDownload + +Auto-generated by running 'make codegen'. Do not edit. +Make changes to the template codegen/templates/database/models/class_name.py.j2 instead. +""" + + +import uuid +from typing import TYPE_CHECKING + +from platformics.database.models.base import Entity +from sqlalchemy import ForeignKey, Enum +from sqlalchemy.dialects.postgresql import UUID +from sqlalchemy.orm import Mapped, mapped_column, relationship +from support.enums import BulkDownloadType + +if TYPE_CHECKING: + from database.models.file import File +else: + File = "File" + + +class BulkDownload(Entity): + __tablename__ = "bulk_download" + __mapper_args__ = {"polymorphic_identity": __tablename__, "polymorphic_load": "inline"} + download_type: Mapped[BulkDownloadType] = mapped_column(Enum(BulkDownloadType, native_enum=False), nullable=False) + file_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) + file: Mapped["File"] = relationship("File", foreign_keys=file_id) + entity_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("entity.id"), nullable=False, primary_key=True) diff --git a/entities/database/models/consensus_genome.py b/entities/database/models/consensus_genome.py index 613593cf..1cabd9ca 100644 --- a/entities/database/models/consensus_genome.py +++ b/entities/database/models/consensus_genome.py @@ -45,12 +45,12 @@ class ConsensusGenome(Entity): ) sequence_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) sequence: Mapped["File"] = relationship("File", foreign_keys=sequence_id) - intermediate_outputs_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) - intermediate_outputs: Mapped["File"] = relationship("File", foreign_keys=intermediate_outputs_id) - metrics: Mapped[list[MetricConsensusGenome]] = relationship( + metrics: Mapped[MetricConsensusGenome] = relationship( "MetricConsensusGenome", back_populates="consensus_genome", uselist=True, foreign_keys="MetricConsensusGenome.consensus_genome_id", ) + intermediate_outputs_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) + intermediate_outputs: Mapped["File"] = relationship("File", foreign_keys=intermediate_outputs_id) entity_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("entity.id"), nullable=False, primary_key=True) diff --git a/entities/database/models/genomic_range.py b/entities/database/models/genomic_range.py index b5a09233..e258360c 100644 --- a/entities/database/models/genomic_range.py +++ b/entities/database/models/genomic_range.py @@ -28,7 +28,7 @@ class GenomicRange(Entity): __tablename__ = "genomic_range" __mapper_args__ = {"polymorphic_identity": __tablename__, "polymorphic_load": "inline"} reference_genome_id: Mapped[uuid.UUID] = mapped_column( - UUID, ForeignKey("reference_genome.entity_id"), nullable=False + UUID, ForeignKey("reference_genome.entity_id"), nullable=True ) reference_genome: Mapped["ReferenceGenome"] = relationship( "ReferenceGenome", back_populates="genomic_ranges", foreign_keys=reference_genome_id diff --git a/entities/database/models/host_organism.py b/entities/database/models/host_organism.py new file mode 100644 index 00000000..82b26487 --- /dev/null +++ b/entities/database/models/host_organism.py @@ -0,0 +1,32 @@ +""" +SQLAlchemy database model for HostOrganism + +Auto-generated by running 'make codegen'. Do not edit. +Make changes to the template codegen/templates/database/models/class_name.py.j2 instead. +""" + + +import uuid +from typing import TYPE_CHECKING + +from platformics.database.models.base import Entity +from sqlalchemy import ForeignKey, String +from sqlalchemy.dialects.postgresql import UUID +from sqlalchemy.orm import Mapped, mapped_column, relationship + +if TYPE_CHECKING: + from database.models.file import File +else: + File = "File" + + +class HostOrganism(Entity): + __tablename__ = "host_organism" + __mapper_args__ = {"polymorphic_identity": __tablename__, "polymorphic_load": "inline"} + name: Mapped[str] = mapped_column(String, nullable=False) + version: Mapped[str] = mapped_column(String, nullable=False) + host_filtering_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) + host_filtering: Mapped["File"] = relationship("File", foreign_keys=host_filtering_id) + sequence_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) + sequence: Mapped["File"] = relationship("File", foreign_keys=sequence_id) + entity_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("entity.id"), nullable=False, primary_key=True) diff --git a/entities/database/models/metric_consensus_genome.py b/entities/database/models/metric_consensus_genome.py index d803106e..e8cf95bb 100644 --- a/entities/database/models/metric_consensus_genome.py +++ b/entities/database/models/metric_consensus_genome.py @@ -11,7 +11,7 @@ from platformics.database.models.base import Entity from sqlalchemy import ForeignKey, Float, Integer -from sqlalchemy.dialects.postgresql import UUID +from sqlalchemy.dialects.postgresql import UUID, JSONB from sqlalchemy.orm import Mapped, mapped_column, relationship if TYPE_CHECKING: @@ -31,7 +31,6 @@ class MetricConsensusGenome(Entity): consensus_genome: Mapped["ConsensusGenome"] = relationship( "ConsensusGenome", back_populates="metrics", foreign_keys=consensus_genome_id ) - coverage_depth: Mapped[int] = mapped_column(Float, nullable=True) reference_genome_length: Mapped[int] = mapped_column(Float, nullable=True) percent_genome_called: Mapped[int] = mapped_column(Float, nullable=True) percent_identity: Mapped[int] = mapped_column(Float, nullable=True) @@ -42,6 +41,9 @@ class MetricConsensusGenome(Entity): n_actg: Mapped[int] = mapped_column(Integer, nullable=True) n_missing: Mapped[int] = mapped_column(Integer, nullable=True) n_ambiguous: Mapped[int] = mapped_column(Integer, nullable=True) - coverage_viz_summary_file_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) - coverage_viz_summary_file: Mapped["File"] = relationship("File", foreign_keys=coverage_viz_summary_file_id) + coverage_depth: Mapped[int] = mapped_column(Float, nullable=True) + coverage_breadth: Mapped[int] = mapped_column(Float, nullable=True) + coverage_bin_size: Mapped[int] = mapped_column(Float, nullable=True) + coverage_total_length: Mapped[int] = mapped_column(Integer, nullable=True) + coverage_viz: Mapped[JSONB] = mapped_column(JSONB, nullable=True) entity_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("entity.id"), nullable=False, primary_key=True) diff --git a/entities/database/models/reference_genome.py b/entities/database/models/reference_genome.py index 544097d3..f42c2342 100644 --- a/entities/database/models/reference_genome.py +++ b/entities/database/models/reference_genome.py @@ -17,13 +17,11 @@ if TYPE_CHECKING: from database.models.file import File from database.models.taxon import Taxon - from database.models.sequence_alignment_index import SequenceAlignmentIndex from database.models.consensus_genome import ConsensusGenome from database.models.genomic_range import GenomicRange else: File = "File" Taxon = "Taxon" - SequenceAlignmentIndex = "SequenceAlignmentIndex" ConsensusGenome = "ConsensusGenome" GenomicRange = "GenomicRange" @@ -33,19 +31,10 @@ class ReferenceGenome(Entity): __mapper_args__ = {"polymorphic_identity": __tablename__, "polymorphic_load": "inline"} file_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) file: Mapped["File"] = relationship("File", foreign_keys=file_id) - file_index_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) - file_index: Mapped["File"] = relationship("File", foreign_keys=file_index_id) - name: Mapped[str] = mapped_column(String, nullable=False) - description: Mapped[str] = mapped_column(String, nullable=False) taxon_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("taxon.entity_id"), nullable=False) taxon: Mapped["Taxon"] = relationship("Taxon", back_populates="reference_genomes", foreign_keys=taxon_id) accession_id: Mapped[str] = mapped_column(String, nullable=True) - sequence_alignment_indices: Mapped[list[SequenceAlignmentIndex]] = relationship( - "SequenceAlignmentIndex", - back_populates="reference_genome", - uselist=True, - foreign_keys="SequenceAlignmentIndex.reference_genome_id", - ) + accession_name: Mapped[str] = mapped_column(String, nullable=True) consensus_genomes: Mapped[list[ConsensusGenome]] = relationship( "ConsensusGenome", back_populates="reference_genome", diff --git a/entities/database/models/sample.py b/entities/database/models/sample.py index 72f481e5..38bfe0b3 100644 --- a/entities/database/models/sample.py +++ b/entities/database/models/sample.py @@ -11,7 +11,7 @@ from typing import TYPE_CHECKING from platformics.database.models.base import Entity -from sqlalchemy import ForeignKey, String, Boolean, DateTime +from sqlalchemy import ForeignKey, String, Integer, Boolean, DateTime from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.orm import Mapped, mapped_column, relationship @@ -30,10 +30,11 @@ class Sample(Entity): __tablename__ = "sample" __mapper_args__ = {"polymorphic_identity": __tablename__, "polymorphic_load": "inline"} + rails_sample_id: Mapped[int] = mapped_column(Integer, nullable=True) name: Mapped[str] = mapped_column(String, nullable=False) sample_type: Mapped[str] = mapped_column(String, nullable=False) water_control: Mapped[bool] = mapped_column(Boolean, nullable=False) - collection_date: Mapped[datetime.datetime] = mapped_column(DateTime, nullable=True) + collection_date: Mapped[datetime.datetime] = mapped_column(DateTime, nullable=False) collection_location: Mapped[str] = mapped_column(String, nullable=False) description: Mapped[str] = mapped_column(String, nullable=True) host_taxon_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("taxon.entity_id"), nullable=True) diff --git a/entities/database/models/sequence_alignment_index.py b/entities/database/models/sequence_alignment_index.py deleted file mode 100644 index e150e6a0..00000000 --- a/entities/database/models/sequence_alignment_index.py +++ /dev/null @@ -1,39 +0,0 @@ -""" -SQLAlchemy database model for SequenceAlignmentIndex - -Auto-generated by running 'make codegen'. Do not edit. -Make changes to the template codegen/templates/database/models/class_name.py.j2 instead. -""" - - -import uuid -from typing import TYPE_CHECKING - -from platformics.database.models.base import Entity -from sqlalchemy import ForeignKey, String, Enum -from sqlalchemy.dialects.postgresql import UUID -from sqlalchemy.orm import Mapped, mapped_column, relationship -from support.enums import AlignmentTool - -if TYPE_CHECKING: - from database.models.file import File - from database.models.reference_genome import ReferenceGenome -else: - File = "File" - ReferenceGenome = "ReferenceGenome" - - -class SequenceAlignmentIndex(Entity): - __tablename__ = "sequence_alignment_index" - __mapper_args__ = {"polymorphic_identity": __tablename__, "polymorphic_load": "inline"} - index_file_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) - index_file: Mapped["File"] = relationship("File", foreign_keys=index_file_id) - reference_genome_id: Mapped[uuid.UUID] = mapped_column( - UUID, ForeignKey("reference_genome.entity_id"), nullable=True - ) - reference_genome: Mapped["ReferenceGenome"] = relationship( - "ReferenceGenome", back_populates="sequence_alignment_indices", foreign_keys=reference_genome_id - ) - tool: Mapped[AlignmentTool] = mapped_column(Enum(AlignmentTool, native_enum=False), nullable=False) - version: Mapped[str] = mapped_column(String, nullable=True) - entity_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("entity.id"), nullable=False, primary_key=True) diff --git a/entities/database/models/sequencing_read.py b/entities/database/models/sequencing_read.py index 1581f595..6239b983 100644 --- a/entities/database/models/sequencing_read.py +++ b/entities/database/models/sequencing_read.py @@ -36,7 +36,7 @@ class SequencingRead(Entity): __mapper_args__ = {"polymorphic_identity": __tablename__, "polymorphic_load": "inline"} sample_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("sample.entity_id"), nullable=True) sample: Mapped["Sample"] = relationship("Sample", back_populates="sequencing_reads", foreign_keys=sample_id) - protocol: Mapped[SequencingProtocol] = mapped_column(Enum(SequencingProtocol, native_enum=False), nullable=False) + protocol: Mapped[SequencingProtocol] = mapped_column(Enum(SequencingProtocol, native_enum=False), nullable=True) r1_file_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) r1_file: Mapped["File"] = relationship("File", foreign_keys=r1_file_id) r2_file_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("file.id"), nullable=True) @@ -45,7 +45,7 @@ class SequencingRead(Entity): Enum(SequencingTechnology, native_enum=False), nullable=False ) nucleic_acid: Mapped[NucleicAcid] = mapped_column(Enum(NucleicAcid, native_enum=False), nullable=False) - has_ercc: Mapped[bool] = mapped_column(Boolean, nullable=False) + clearlabs_export: Mapped[bool] = mapped_column(Boolean, nullable=False) taxon_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("taxon.entity_id"), nullable=True) taxon: Mapped["Taxon"] = relationship("Taxon", back_populates="sequencing_reads", foreign_keys=taxon_id) primer_file_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("genomic_range.entity_id"), nullable=True) diff --git a/entities/schema/README.md b/entities/schema/README.md index 9e94dd6b..2be2d2c4 100644 --- a/entities/schema/README.md +++ b/entities/schema/README.md @@ -5,6 +5,9 @@ Entity { int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } File { uuid id @@ -20,6 +23,7 @@ File { string upload_error } Sample { + int rails_sample_id string name string sample_type boolean water_control @@ -31,17 +35,23 @@ Sample { int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } SequencingRead { SequencingProtocol protocol SequencingTechnology technology NucleicAcid nucleic_acid - boolean has_ercc + boolean clearlabs_export uuid entity_id uuid id int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } GenomicRange { uuid entity_id @@ -49,25 +59,33 @@ GenomicRange { int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } ReferenceGenome { - string name - string description string accession_id + string accession_name uuid entity_id uuid id int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } -SequenceAlignmentIndex { - AlignmentTool tool +HostOrganism { + string name string version uuid entity_id uuid id int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } Metadatum { string field_name @@ -77,6 +95,9 @@ Metadatum { int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } ConsensusGenome { uuid entity_id @@ -84,9 +105,11 @@ ConsensusGenome { int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } MetricConsensusGenome { - float coverage_depth float reference_genome_length float percent_genome_called float percent_identity @@ -97,11 +120,19 @@ MetricConsensusGenome { int n_actg int n_missing int n_ambiguous + float coverage_depth + float coverage_breadth + float coverage_bin_size + int coverage_total_length + 2dArrayInt coverage_viz uuid entity_id uuid id int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } Taxon { string wikipedia_id @@ -116,6 +147,9 @@ Taxon { int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } UpstreamDatabase { string name @@ -124,6 +158,9 @@ UpstreamDatabase { int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } Contig { string sequence @@ -132,6 +169,9 @@ Contig { int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at } PhylogeneticTree { PhylogeneticTreeFormat format @@ -140,6 +180,20 @@ PhylogeneticTree { int producing_run_id int owner_user_id int collection_id + date created_at + date updated_at + date deleted_at +} +BulkDownload { + BulkDownloadType download_type + uuid entity_id + uuid id + int producing_run_id + int owner_user_id + int collection_id + date created_at + date updated_at + date deleted_at } EntityMixin { uuid entity_id @@ -156,26 +210,23 @@ SequencingRead ||--|o Taxon : "taxon" SequencingRead ||--|o GenomicRange : "primer_file" SequencingRead ||--}o ConsensusGenome : "consensus_genomes" SequencingRead ||--}o Contig : "contigs" -GenomicRange ||--|| ReferenceGenome : "reference_genome" +GenomicRange ||--|o ReferenceGenome : "reference_genome" GenomicRange ||--|o File : "file" GenomicRange ||--}o SequencingRead : "sequencing_reads" ReferenceGenome ||--|o File : "file" -ReferenceGenome ||--|o File : "file_index" ReferenceGenome ||--|| Taxon : "taxon" -ReferenceGenome ||--}o SequenceAlignmentIndex : "sequence_alignment_indices" ReferenceGenome ||--}o ConsensusGenome : "consensus_genomes" ReferenceGenome ||--}o GenomicRange : "genomic_ranges" -SequenceAlignmentIndex ||--|o File : "index_file" -SequenceAlignmentIndex ||--|o ReferenceGenome : "reference_genome" +HostOrganism ||--|o File : "host_filtering" +HostOrganism ||--|o File : "sequence" Metadatum ||--|| Sample : "sample" ConsensusGenome ||--|| Taxon : "taxon" ConsensusGenome ||--|| SequencingRead : "sequence_read" ConsensusGenome ||--|| ReferenceGenome : "reference_genome" ConsensusGenome ||--|o File : "sequence" +ConsensusGenome ||--|o MetricConsensusGenome : "metrics" ConsensusGenome ||--|o File : "intermediate_outputs" -ConsensusGenome ||--}o MetricConsensusGenome : "metrics" MetricConsensusGenome ||--|| ConsensusGenome : "consensus_genome" -MetricConsensusGenome ||--|o File : "coverage_viz_summary_file" Taxon ||--|| UpstreamDatabase : "upstream_database" Taxon ||--|o Taxon : "tax_parent" Taxon ||--|o Taxon : "tax_subspecies" @@ -194,6 +245,7 @@ Taxon ||--}o Sample : "samples" UpstreamDatabase ||--}o Taxon : "taxa" Contig ||--|o SequencingRead : "sequencing_read" PhylogeneticTree ||--|o File : "tree" +BulkDownload ||--|o File : "file" ``` diff --git a/entities/schema/platformics.yaml b/entities/schema/platformics.yaml index e47904e3..44a59fc1 100644 --- a/entities/schema/platformics.yaml +++ b/entities/schema/platformics.yaml @@ -20,6 +20,11 @@ types: base: str description: A UUID + 2dArrayInt: + uri: xsd:array + base: int + description: A 2D array of integers, e.g. [[1, 2, 3], [4, 5, 6]] + enums: FileStatus: permissible_values: @@ -77,11 +82,6 @@ enums: permissible_values: Illumina: Nanopore: - AlignmentTool: - permissible_values: - bowtie2: - minimap2: - czid_index_generation: TaxonLevel: permissible_values: # Prepending "level_" because "class" is a reserved word, so can't create an Enum with it. @@ -99,6 +99,10 @@ enums: newick: auspice_v1: auspice_v2: + BulkDownloadType: + permissible_values: + concatenate: + zip: classes: Entity: @@ -115,6 +119,13 @@ classes: collection_id: range: int minimum_value: 0 + created_at: + range: date + required: true + updated_at: + range: date + deleted_at: + range: date # NOTE - the LinkML schema doesn't support a native "plural name" field as far as I can tell, so # we're using an annotation here to tack on the extra functionality that we need. We do this because # English pluralization is hard, and we don't want to have to write a custom pluralization function. @@ -176,6 +187,9 @@ classes: mixins: - EntityMixin attributes: + # If this Sample is a copy of what's in the Rails DB, store its ID here + rails_sample_id: + range: int name: range: string required: true @@ -190,6 +204,7 @@ classes: required: true collection_date: range: date + required: true collection_location: range: string required: true @@ -226,7 +241,6 @@ classes: # Wet lab protocol protocol: range: SequencingProtocol - required: true # Files containing sequencing reads (R1 and R2 refer to read pairs 1/2 in Illumina paired-end sequencing) r1_file: range: File @@ -240,10 +254,6 @@ classes: nucleic_acid: range: NucleicAcid required: true - # Does the sample include ERCCs, synthetic sequences of known quantity used for QC checks - has_ercc: - range: boolean - required: true # Is this sequencing read exported from clearlabs? Clearlabs exports have undergone filtering clearlabs_export: range: boolean @@ -277,11 +287,10 @@ classes: mixins: - EntityMixin attributes: - # Genomic coordinates based this reference genome + # Genomic coordinates based on this reference sequence reference_genome: range: ReferenceGenome inverse: ReferenceGenome.genomic_ranges - required: true file: range: File sequencing_reads: @@ -292,7 +301,7 @@ classes: plural: GenomicRanges # ---------------------------------------------------------------------------- - # Reference genomes / host genomes + # Reference genomes # ---------------------------------------------------------------------------- ReferenceGenome: is_a: Entity @@ -302,17 +311,6 @@ classes: # FASTA reference genome file: range: File - # Indexed FASTA file (.FAI file if any) - file_index: - range: File - # e.g. GRCh38.p14 - name: - range: string - required: true - # e.g. Human (GRCh38) - description: - range: string - required: true taxon: range: Taxon required: true @@ -320,10 +318,8 @@ classes: # Optional metadata: when do viral consensus genome, we try to parse accession ID from the FASTA header. accession_id: range: string - sequence_alignment_indices: - range: SequenceAlignmentIndex - inverse: SequenceAlignmentIndex.reference_genome - multivalued: true + accession_name: + range: string consensus_genomes: range: ConsensusGenome inverse: ConsensusGenome.reference_genome @@ -332,35 +328,36 @@ classes: range: GenomicRange inverse: GenomicRange.reference_genome multivalued: true - # TODO: Uncomment this when we have support for backgrounds - # Stores host genome's background that we prepared. We currently have 2 backgrounds (26, 98) assigned to all host genomes. - # background: - # range: Background annotations: plural: ReferenceGenomes # ---------------------------------------------------------------------------- - # Index used by sequence aligners (bowtie, minimap, etc) to represent the - # reference genome more efficiently for querying. + # Host organisms / host filtering information # ---------------------------------------------------------------------------- - SequenceAlignmentIndex: + HostOrganism: is_a: Entity mixins: - EntityMixin attributes: - index_file: - range: File - reference_genome: - range: ReferenceGenome - required: false - inverse: ReferenceGenome.sequence_alignment_indices - tool: - range: AlignmentTool + # e.g. Human + name: + range: string required: true + # e.g. v1-hg38, v2-t2t, etc version: range: string + required: true + # Host filtering information; output by index generation + host_filtering: + range: File + # Original FASTA file used in index generation; used for our record keeping + sequence: + range: File + # TODO: Stores host genome's background that we prepared. We currently have 2 backgrounds (26, 98) assigned to all host genomes. + # background: + # range: Background annotations: - plural: SequenceAlignmentIndices + plural: HostOrganisms # ---------------------------------------------------------------------------- # Metadata @@ -406,13 +403,16 @@ classes: # Consensus Genome sequence sequence: range: File - # Zip file containing intermediate outputs - intermediate_outputs: - range: File metrics: range: MetricConsensusGenome inverse: MetricConsensusGenome.consensus_genome - multivalued: true + # TODO FIXME this is a hack to support 1:1 relationships. It currently specifies that the related + # class actually defines the relationship and this is just a virtual field. We're misusing the LinkML + # "inlined" field property until we learn how to use LinkML better and find a better way to express this + inlined: true + # Zip file containing intermediate outputs + intermediate_outputs: + range: File annotations: plural: ConsensusGenomes @@ -423,10 +423,8 @@ classes: attributes: consensus_genome: range: ConsensusGenome - required: true inverse: ConsensusGenome.metrics - coverage_depth: - range: float + required: true reference_genome_length: range: float percent_genome_called: @@ -447,8 +445,16 @@ classes: range: int n_ambiguous: range: int - coverage_viz_summary_file: - range: File + coverage_depth: + range: float + coverage_breadth: + range: float + coverage_bin_size: + range: float + coverage_total_length: + range: int + coverage_viz: + range: 2dArrayInt annotations: plural: MetricsConsensusGenomes @@ -569,6 +575,23 @@ classes: plural: PhylogeneticTrees + # ---------------------------------------------------------------------------- + # Bulk download results + # ---------------------------------------------------------------------------- + BulkDownload: + is_a: Entity + mixins: + - EntityMixin + attributes: + download_type: + range: BulkDownloadType + required: true + file: + range: File + annotations: + plural: BulkDownloads + + # ============================================================================ # Mixins # ============================================================================ diff --git a/entities/support/enums.py b/entities/support/enums.py index 22826875..3ad0a5bc 100644 --- a/entities/support/enums.py +++ b/entities/support/enums.py @@ -57,13 +57,6 @@ class SequencingTechnology(enum.Enum): Nanopore = "Nanopore" -@strawberry.enum -class AlignmentTool(enum.Enum): - bowtie2 = "bowtie2" - minimap2 = "minimap2" - czid_index_generation = "czid_index_generation" - - @strawberry.enum class TaxonLevel(enum.Enum): level_subspecies = "level_subspecies" @@ -82,3 +75,9 @@ class PhylogeneticTreeFormat(enum.Enum): newick = "newick" auspice_v1 = "auspice_v1" auspice_v2 = "auspice_v2" + + +@strawberry.enum +class BulkDownloadType(enum.Enum): + concatenate = "concatenate" + zip = "zip" diff --git a/entities/test_infra/factories/bulk_download.py b/entities/test_infra/factories/bulk_download.py new file mode 100644 index 00000000..e92d62c4 --- /dev/null +++ b/entities/test_infra/factories/bulk_download.py @@ -0,0 +1,37 @@ +""" +Factory for generating BulkDownload objects. + +Auto-generated by running 'make codegen'. Do not edit. +Make changes to the template codegen/templates/test_infra/factories/class_name.py.j2 instead. +""" + +# ruff: noqa: E501 Line too long + +import factory +from database.models import BulkDownload +from test_infra.factories.main import CommonFactory, FileFactory +from factory import Faker, fuzzy +from faker_biology.bioseq import Bioseq +from faker_biology.physiology import Organ +from faker_enum import EnumProvider + +Faker.add_provider(Bioseq) +Faker.add_provider(Organ) +Faker.add_provider(EnumProvider) + + +class BulkDownloadFactory(CommonFactory): + class Meta: + sqlalchemy_session = None # workaround for a bug in factoryboy + model = BulkDownload + # Match entity_id with existing db rows to determine whether we should + # create a new row or not. + sqlalchemy_get_or_create = ("entity_id",) + + download_type = fuzzy.FuzzyChoice(["concatenate", "zip"]) + file = factory.RelatedFactory( + FileFactory, + factory_related_name="entity", + entity_field_name="file", + file_format="fastq", + ) diff --git a/entities/test_infra/factories/sequence_alignment_index.py b/entities/test_infra/factories/host_organism.py similarity index 58% rename from entities/test_infra/factories/sequence_alignment_index.py rename to entities/test_infra/factories/host_organism.py index 082e5b12..65a03b10 100644 --- a/entities/test_infra/factories/sequence_alignment_index.py +++ b/entities/test_infra/factories/host_organism.py @@ -1,5 +1,5 @@ """ -Factory for generating SequenceAlignmentIndex objects. +Factory for generating HostOrganism objects. Auto-generated by running 'make codegen'. Do not edit. Make changes to the template codegen/templates/test_infra/factories/class_name.py.j2 instead. @@ -8,9 +8,8 @@ # ruff: noqa: E501 Line too long import factory -from database.models import SequenceAlignmentIndex +from database.models import HostOrganism from test_infra.factories.main import CommonFactory, FileFactory -from test_infra.factories.reference_genome import ReferenceGenomeFactory from factory import Faker, fuzzy from faker_biology.bioseq import Bioseq from faker_biology.physiology import Organ @@ -21,24 +20,25 @@ Faker.add_provider(EnumProvider) -class SequenceAlignmentIndexFactory(CommonFactory): +class HostOrganismFactory(CommonFactory): class Meta: sqlalchemy_session = None # workaround for a bug in factoryboy - model = SequenceAlignmentIndex + model = HostOrganism # Match entity_id with existing db rows to determine whether we should # create a new row or not. sqlalchemy_get_or_create = ("entity_id",) - index_file = factory.RelatedFactory( + name = fuzzy.FuzzyText() + version = fuzzy.FuzzyText() + host_filtering = factory.RelatedFactory( FileFactory, factory_related_name="entity", - entity_field_name="index_file", + entity_field_name="host_filtering", file_format="fastq", ) - reference_genome = factory.SubFactory( - ReferenceGenomeFactory, - owner_user_id=factory.SelfAttribute("..owner_user_id"), - collection_id=factory.SelfAttribute("..collection_id"), + sequence = factory.RelatedFactory( + FileFactory, + factory_related_name="entity", + entity_field_name="sequence", + file_format="fastq", ) - tool = fuzzy.FuzzyChoice(["bowtie2", "minimap2", "czid_index_generation"]) - version = fuzzy.FuzzyText() diff --git a/entities/test_infra/factories/metric_consensus_genome.py b/entities/test_infra/factories/metric_consensus_genome.py index 5fdbcfa6..de78fbd6 100644 --- a/entities/test_infra/factories/metric_consensus_genome.py +++ b/entities/test_infra/factories/metric_consensus_genome.py @@ -7,9 +7,10 @@ # ruff: noqa: E501 Line too long +import random import factory from database.models import MetricConsensusGenome -from test_infra.factories.main import CommonFactory, FileFactory +from test_infra.factories.main import CommonFactory from test_infra.factories.consensus_genome import ConsensusGenomeFactory from factory import Faker, fuzzy from faker_biology.bioseq import Bioseq @@ -34,7 +35,6 @@ class Meta: owner_user_id=factory.SelfAttribute("..owner_user_id"), collection_id=factory.SelfAttribute("..collection_id"), ) - coverage_depth = fuzzy.FuzzyFloat(1, 100) reference_genome_length = fuzzy.FuzzyFloat(1, 100) percent_genome_called = fuzzy.FuzzyFloat(1, 100) percent_identity = fuzzy.FuzzyFloat(1, 100) @@ -45,9 +45,8 @@ class Meta: n_actg = fuzzy.FuzzyInteger(1, 1000) n_missing = fuzzy.FuzzyInteger(1, 1000) n_ambiguous = fuzzy.FuzzyInteger(1, 1000) - coverage_viz_summary_file = factory.RelatedFactory( - FileFactory, - factory_related_name="entity", - entity_field_name="coverage_viz_summary_file", - file_format="fastq", - ) + coverage_depth = fuzzy.FuzzyFloat(1, 100) + coverage_breadth = fuzzy.FuzzyFloat(1, 100) + coverage_bin_size = fuzzy.FuzzyFloat(1, 100) + coverage_total_length = fuzzy.FuzzyInteger(1, 1000) + coverage_viz = factory.LazyAttribute(lambda o: [[random.randint(0, 10) for _ in range(5)]] * random.randint(2, 5)) diff --git a/entities/test_infra/factories/reference_genome.py b/entities/test_infra/factories/reference_genome.py index 2bc5a5b0..46591bea 100644 --- a/entities/test_infra/factories/reference_genome.py +++ b/entities/test_infra/factories/reference_genome.py @@ -35,17 +35,10 @@ class Meta: entity_field_name="file", file_format="fastq", ) - file_index = factory.RelatedFactory( - FileFactory, - factory_related_name="entity", - entity_field_name="file_index", - file_format="fastq", - ) - name = fuzzy.FuzzyText() - description = fuzzy.FuzzyText() taxon = factory.SubFactory( TaxonFactory, owner_user_id=factory.SelfAttribute("..owner_user_id"), collection_id=factory.SelfAttribute("..collection_id"), ) accession_id = fuzzy.FuzzyText() + accession_name = fuzzy.FuzzyText() diff --git a/entities/test_infra/factories/sample.py b/entities/test_infra/factories/sample.py index b9d31096..1a745ae4 100644 --- a/entities/test_infra/factories/sample.py +++ b/entities/test_infra/factories/sample.py @@ -29,6 +29,7 @@ class Meta: # create a new row or not. sqlalchemy_get_or_create = ("entity_id",) + rails_sample_id = fuzzy.FuzzyInteger(1, 1000) name = fuzzy.FuzzyText() sample_type = factory.Faker("organ") water_control = factory.Faker("boolean") diff --git a/entities/test_infra/factories/sequencing_read.py b/entities/test_infra/factories/sequencing_read.py index ab69c8a8..c1e568c3 100644 --- a/entities/test_infra/factories/sequencing_read.py +++ b/entities/test_infra/factories/sequencing_read.py @@ -66,7 +66,7 @@ class Meta: ) technology = fuzzy.FuzzyChoice(["Illumina", "Nanopore"]) nucleic_acid = fuzzy.FuzzyChoice(["RNA", "DNA"]) - has_ercc = factory.Faker("boolean") + clearlabs_export = factory.Faker("boolean") taxon = factory.SubFactory( TaxonFactory, owner_user_id=factory.SelfAttribute("..owner_user_id"), diff --git a/platformics/codegen/lib/linkml_wrappers.py b/platformics/codegen/lib/linkml_wrappers.py index 22bcf713..b78f4477 100644 --- a/platformics/codegen/lib/linkml_wrappers.py +++ b/platformics/codegen/lib/linkml_wrappers.py @@ -8,7 +8,8 @@ from functools import cached_property import strcase -from linkml_runtime.linkml_model.meta import ClassDefinition, EnumDefinition, SlotDefinition +from linkml_runtime.linkml_model.meta import (ClassDefinition, EnumDefinition, + SlotDefinition) from linkml_runtime.utils.schemaview import SchemaView @@ -93,6 +94,10 @@ def factory_type(self) -> str: else None ) + @cached_property + def is_virtual_relationship(self) -> bool | None: + return self.wrapped_field.inlined or self.multivalued # type: ignore + class EnumWrapper: """ diff --git a/platformics/codegen/templates/api/types/class_name.py.j2 b/platformics/codegen/templates/api/types/class_name.py.j2 index 9bb12562..26497585 100644 --- a/platformics/codegen/templates/api/types/class_name.py.j2 +++ b/platformics/codegen/templates/api/types/class_name.py.j2 @@ -11,7 +11,7 @@ Make changes to the template codegen/templates/api/types/class_name.py.j2 instea {% set ignored_fields = ["File", "Entity", cls.name] %} import typing -from typing import TYPE_CHECKING, Annotated, Any, Optional, Sequence, Callable +from typing import TYPE_CHECKING, Annotated, Any, Optional, Sequence, Callable, List import database.models as db import strawberry @@ -104,8 +104,13 @@ async def load_{{ related_field.related_class.snake_name }}_rows( relationship = mapper.relationships["{{ related_field.name }}"] return await dataloader.loader_for(relationship, where).load(root.id) # type:ignore {%- else %} + {%- if related_field.is_virtual_relationship %} + relationship = mapper.relationships["{{ related_field.name }}"] + return await dataloader.loader_for(relationship, where).load(root.id) # type:ignore + {%- else %} relationship = mapper.relationships["{{ related_field.name }}"] return await dataloader.loader_for(relationship, where).load(root.{{ related_field.name }}_id) # type:ignore + {%- endif %} {%- endif %} @@ -225,6 +230,8 @@ class {{ cls.name }}(EntityInterface): {%- endif %} {%- elif attr.type == "string" %} {{ attr.name }}: {{ getType("str", attr.required) }} + {%- elif attr.type == "2dArrayInt" %} + {{ attr.name }}: {{ getType("List[List[int]]", attr.required) }} {%- elif attr.is_enum %} {{ attr.name }}: {{ getType(attr.type, attr.required) }} {%- elif attr.type == "int" %} @@ -350,6 +357,8 @@ class {{ cls.name }}{{ action }}Input: {%- if attr.type == "uuid" %} {# Don't allow setting UUID fields #} {%- elif attr.type == "string" %} {{ attr.name }}: {{ getTypeMutation(action, "str", attr.required) }} + {%- elif attr.type == "2dArrayInt" %} + {{ attr.name }}: {{ getTypeMutation(action, "List[List[int]]", attr.required) }} {%- elif attr.is_enum %} {{ attr.name }}: {{ getTypeMutation(action, attr.type, attr.required) }} {%- elif attr.type == "int" %} diff --git a/platformics/codegen/templates/database/models/class_name.py.j2 b/platformics/codegen/templates/database/models/class_name.py.j2 index 6807ac44..2272889b 100644 --- a/platformics/codegen/templates/database/models/class_name.py.j2 +++ b/platformics/codegen/templates/database/models/class_name.py.j2 @@ -14,7 +14,7 @@ from typing import TYPE_CHECKING from platformics.database.models.base import Entity from sqlalchemy import ForeignKey, String, Float, Integer, Enum, Boolean, DateTime -from sqlalchemy.dialects.postgresql import UUID +from sqlalchemy.dialects.postgresql import UUID, JSONB from sqlalchemy.orm import Mapped, mapped_column, relationship {%- for field in cls.enum_fields %} {%- if loop.first %} @@ -50,6 +50,8 @@ class {{cls.name}}(Entity): {{attr.name}}: Mapped[uuid.UUID] = mapped_column({%- if attr.inverse %}ForeignKey("{{attr.inverse}}"){%- else %}UUID{%- endif %}, nullable={{ "False" if attr.required else "True"}}, primary_key={{ "True" if attr.identifier else "False"}}) {%- elif attr.type == "string" %} {{attr.name}}: Mapped[str] = mapped_column(String, nullable={{ "False" if attr.required else "True"}}) + {%- elif attr.type == "2dArrayInt" %} + {{attr.name}}: Mapped[JSONB] = mapped_column(JSONB, nullable={{ "False" if attr.required else "True"}}) {%- elif attr.type == "int" %} {{attr.name}}: Mapped[int] = mapped_column(Integer, nullable={{ "False" if attr.required else "True"}}) {%- elif attr.type == "float" %} @@ -61,8 +63,12 @@ class {{cls.name}}(Entity): {%- elif attr.type == "date" %} {{attr.name}}: Mapped[datetime.datetime] = mapped_column(DateTime, nullable={{ "False" if attr.required else "True"}}) {%- else %} - {%- if attr.multivalued %} + {%- if attr.is_virtual_relationship %} + {%- if attr.multivalued %} {{attr.name}}: Mapped[list[{{attr.type}}]] = relationship("{{attr.type}}", back_populates="{{attr.inverse_field}}", uselist=True, foreign_keys="{{attr.type}}.{{attr.inverse_field}}_id") + {%- else %} + {{attr.name}}: Mapped[{{attr.type}}] = relationship("{{attr.type}}", back_populates="{{attr.inverse_field}}", uselist=True, foreign_keys="{{attr.type}}.{{attr.inverse_field}}_id") + {%- endif %} {%- else %} {{attr.name}}_id: Mapped[uuid.UUID] = mapped_column(UUID, ForeignKey("{{attr.related_class.snake_name}}.{{attr.related_class.identifier}}"), nullable={{"False" if attr.required else "True"}}{%- if attr.identifier %}, primary_key=True{%- endif %}) {%- if attr.type != "Entity" %} diff --git a/platformics/codegen/templates/test_infra/factories/class_name.py.j2 b/platformics/codegen/templates/test_infra/factories/class_name.py.j2 index 47b454f5..87ef54d7 100644 --- a/platformics/codegen/templates/test_infra/factories/class_name.py.j2 +++ b/platformics/codegen/templates/test_infra/factories/class_name.py.j2 @@ -7,6 +7,7 @@ Make changes to the template codegen/templates/test_infra/factories/class_name.p # ruff: noqa: E501 Line too long +import random import factory from database.models import {{ cls.name }} from test_infra.factories.main import CommonFactory, FileFactory @@ -36,7 +37,8 @@ class {{ cls.name }}Factory(CommonFactory): {% for field in cls.owned_fields %} {%- if field.type != "uuid" %} {%- if field.inverse and field.related_class.name != "Entity" %} - {%- if not field.multivalued %} + {#- If the field is a one-to-one relationship, avoid circular imports by only defining the SubFactory on the child #} + {%- if not field.multivalued and not field.is_virtual_relationship %} {{ field.name }} = factory.SubFactory( {{ field.related_class.name }}Factory, owner_user_id=factory.SelfAttribute("..owner_user_id"), @@ -75,6 +77,8 @@ class {{ cls.name }}Factory(CommonFactory): {{ field.name }} = factory.Faker("{{ field.factory_type }}") {%- elif field.type == "string" %} {{ field.name }} = fuzzy.FuzzyText() + {%- elif field.type == "2dArrayInt" %} + {{ field.name }} = factory.LazyAttribute(lambda o: [ [random.randint(0, 10) for _ in range(5)] ] * random.randint(2, 5) ) {%- elif field.type == "int" %} {{ field.name }} = fuzzy.FuzzyInteger(1, 1000) {%- elif field.type == "float" %} diff --git a/platformics/codegen/tests/test_basic_queries.py b/platformics/codegen/tests/test_basic_queries.py index b4a80600..2bc1a044 100644 --- a/platformics/codegen/tests/test_basic_queries.py +++ b/platformics/codegen/tests/test_basic_queries.py @@ -2,11 +2,13 @@ Test basic queries and mutations """ +import datetime import pytest from platformics.database.connect import SyncDB from platformics.codegen.conftest import GQLTestClient, SessionStorage from platformics.codegen.tests.output.test_infra.factories.sample import SampleFactory +date_now = datetime.datetime.now() @pytest.mark.asyncio async def test_graphql_query( @@ -24,13 +26,13 @@ async def test_graphql_query( with sync_db.session() as session: SessionStorage.set_session(session) SampleFactory.create_batch( - 2, collection_location="San Francisco, CA", owner_user_id=user_id, collection_id=project_id + 2, collection_location="San Francisco, CA", collection_date=date_now, owner_user_id=user_id, collection_id=project_id ) SampleFactory.create_batch( - 6, collection_location="Mountain View, CA", owner_user_id=user_id, collection_id=project_id + 6, collection_location="Mountain View, CA", collection_date=date_now, owner_user_id=user_id, collection_id=project_id ) SampleFactory.create_batch( - 4, collection_location="Phoenix, AZ", owner_user_id=secondary_user_id, collection_id=9999 + 4, collection_location="Phoenix, AZ", collection_date=date_now, owner_user_id=secondary_user_id, collection_id=9999 ) # Fetch all samples @@ -69,6 +71,7 @@ async def test_graphql_mutations( sampleType: "Type 1" waterControl: false collectionLocation: "San Francisco, CA" + collectionDate: "2024-01-01" collectionId: 123 }) { id, diff --git a/platformics/codegen/tests/test_error_handling.py b/platformics/codegen/tests/test_error_handling.py index db0feb02..38f3d514 100644 --- a/platformics/codegen/tests/test_error_handling.py +++ b/platformics/codegen/tests/test_error_handling.py @@ -23,6 +23,7 @@ async def test_unauthorized_error( sampleType: "Type 1" waterControl: false collectionLocation: "San Francisco, CA" + collectionDate: "2024-01-01" collectionId: 123 }) { id, diff --git a/platformics/codegen/tests/test_file_queries.py b/platformics/codegen/tests/test_file_queries.py index f585f22c..a6ae9940 100644 --- a/platformics/codegen/tests/test_file_queries.py +++ b/platformics/codegen/tests/test_file_queries.py @@ -49,9 +49,9 @@ async def test_file_query( # Each SequencingRead results in 5 files: # r1_file, r2_file # primer_file -> GenomicRange file - # GenomicRange produces ReferenceGenome -> file and file_index - # so we expect 8 * 5 = 40 files. - assert len(output["data"]["files"]) == 40 + # GenomicRange produces ReferenceGenome -> file + # so we expect 8 * 4 = 32 files. + assert len(output["data"]["files"]) == 32 for file in output["data"]["files"]: assert file["path"] is not None assert file["entity"]["collectionId"] == project1_id diff --git a/platformics/codegen/tests/test_schemas/platformics.yaml b/platformics/codegen/tests/test_schemas/platformics.yaml index f48cd28a..a5b8207b 100644 --- a/platformics/codegen/tests/test_schemas/platformics.yaml +++ b/platformics/codegen/tests/test_schemas/platformics.yaml @@ -67,6 +67,13 @@ classes: collection_id: range: int minimum_value: 0 + created_at: + range: date + required: true + updated_at: + range: date + deleted_at: + range: date annotations: plural: Entities @@ -151,9 +158,6 @@ classes: nucleic_acid: range: NucleicAcid required: true - has_ercc: - range: boolean - required: true primer_file: range: GenomicRange inverse: GenomicRange.sequencing_reads @@ -161,6 +165,9 @@ classes: range: Contig inverse: Contig.sequencing_read multivalued: true + clearlabs_export: + range: boolean + required: true annotations: plural: SequencingReads diff --git a/platformics/database/models/base.py b/platformics/database/models/base.py index d94c2d2e..08c89d35 100644 --- a/platformics/database/models/base.py +++ b/platformics/database/models/base.py @@ -1,10 +1,11 @@ -from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column -from sqlalchemy import MetaData, Column, Integer, String -import uuid6 - +import datetime import uuid -from sqlalchemy.dialects.postgresql import UUID +import uuid6 from typing import TYPE_CHECKING +from sqlalchemy import MetaData, Column, Integer, String, DateTime +from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column +from sqlalchemy.sql import func +from sqlalchemy.dialects.postgresql import UUID if TYPE_CHECKING: from database.models.file import File @@ -40,3 +41,6 @@ class Entity(Base): producing_run_id: Mapped[uuid.UUID] = mapped_column(Integer, nullable=True) owner_user_id: Mapped[int] = mapped_column(Integer, nullable=False) collection_id: Mapped[int] = mapped_column(Integer, nullable=False) + created_at: Mapped[datetime.datetime] = mapped_column(DateTime(timezone=True), nullable=False, server_default=func.now()) + updated_at: Mapped[datetime.datetime] = mapped_column(DateTime(timezone=True), nullable=True) + deleted_at: Mapped[datetime.datetime] = mapped_column(DateTime(timezone=True), nullable=True)