# Path: virtool/config/cls.py
# class Config:
#     db_connection_string: str
#     db_name: str
#     dev: bool
#     postgres_connection_string: str
#     redis_connection_string: str
#     b2c_client_id: str = None
#     b2c_client_secret: str = None
#     b2c_tenant: str = None
#     b2c_user_flow: str = None
#     base_url: str = ""
#     data_path: Path = None
#     fake: bool = False
#     fake_path: Path = None
#     force_version: str = None
#     host: str = None
#     no_check_files: bool = False
#     no_check_db: bool = False
#     no_fetching: bool = False
#     no_sentry: bool = False
#     port: int = 9950
#     proxy: str = None
#     use_b2c: bool = False
#     verbose: bool = False
#     sentry_dsn: str = "https://9a2f8d1a3f7a431e873207a70ef3d44d:ca6db07b82934005beceae93560a6794@sentry.io/220532"
# 
# Path: virtool/types.py



import asyncio
import logging
import os
import virtool.db.utils
import virtool.errors
import virtool.samples.utils
import virtool.utils
from collections import defaultdict
from pathlib import Path
from typing import Any, Dict, List, Optional
from multidict import MultiDictProxy
from pymongo.results import DeleteResult
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession
from virtool.config.cls import Config
from virtool.db.transforms import AbstractTransform, apply_transforms
from virtool.labels.db import AttachLabelsTransform
from virtool.samples.models import SampleArtifact, SampleReads
from virtool.samples.utils import join_legacy_read_paths
from virtool.settings.db import Settings
from virtool.subtractions.db import AttachSubtractionTransform
from virtool.types import App, Document
from virtool.uploads.models import Upload
from virtool.users.db import AttachUserTransform
from virtool.utils import base_processor, compress_file, file_stats
    "name",
    "pathoscope",
    "nuvs",
    "group",
    "group_read",
    "group_write",
    "all_read",
    "all_write",
    "ready",
    "user",
]

RIGHTS_PROJECTION = {
    "_id": False,
    "group": True,
    "group_read": True,
    "group_write": True,
    "all_read": True,
    "all_write": True,
    "user": True,
}


class ArtifactsAndReadsTransform(AbstractTransform):
    def __init__(self, pg):
        self._pg = pg

    async def attach_one(self, document: Document, prepared: Any) -> Document:
        return {**document, **prepared}


# Path: virtool/config/cls.py
# class Config:
#     db_connection_string: str
#     db_name: str
#     dev: bool
#     postgres_connection_string: str
#     redis_connection_string: str
#     b2c_client_id: str = None
#     b2c_client_secret: str = None
#     b2c_tenant: str = None
#     b2c_user_flow: str = None
#     base_url: str = ""
#     data_path: Path = None
#     fake: bool = False
#     fake_path: Path = None
#     force_version: str = None
#     host: str = None
#     no_check_files: bool = False
#     no_check_db: bool = False
#     no_fetching: bool = False
#     no_sentry: bool = False
#     port: int = 9950
#     proxy: str = None
#     use_b2c: bool = False
#     verbose: bool = False
#     sentry_dsn: str = "https://9a2f8d1a3f7a431e873207a70ef3d44d:ca6db07b82934005beceae93560a6794@sentry.io/220532"
# 
# Path: virtool/types.py



# Path: virtool/samples/db.py
import asyncio
import logging
import os
import virtool.db.utils
import virtool.errors
import virtool.samples.utils
import virtool.utils
from collections import defaultdict
from pathlib import Path
from typing import Any, Dict, List, Optional
from multidict import MultiDictProxy
from pymongo.results import DeleteResult
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession
from virtool.config.cls import Config
from virtool.db.transforms import AbstractTransform, apply_transforms
from virtool.labels.db import AttachLabelsTransform
from virtool.samples.models import SampleArtifact, SampleReads
from virtool.samples.utils import join_legacy_read_paths
from virtool.settings.db import Settings
from virtool.subtractions.db import AttachSubtractionTransform
from virtool.types import App, Document
from virtool.uploads.models import Upload
from virtool.users.db import AttachUserTransform
from virtool.utils import base_processor, compress_file, file_stats

    "name",
    "pathoscope",
    "nuvs",
    "group",
    "group_read",
    "group_write",
    "all_read",
    "all_write",
    "ready",
    "user",
]

RIGHTS_PROJECTION = {
    "_id": False,
    "group": True,
    "group_read": True,
    "group_write": True,
    "all_read": True,
    "all_write": True,
    "user": True,
}


class ArtifactsAndReadsTransform(AbstractTransform):
    def __init__(self, pg):
        self._pg = pg

    async def attach_one(self, document: Document, prepared: Any) -> Document:
        return {**document, **prepared}


    async def prepare_one(self, document: Document) -> Any: