Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify setting of Project::unavailable_samples_count attribute #879

Open
avrohomgottlieb opened this issue Sep 6, 2024 · 0 comments
Open

Comments

@avrohomgottlieb
Copy link
Contributor

Context

The unavailable_samples_count attribute represents all samples that do not have data files associated with them, but are included a project's sample_metadata.csv file. We update the Project::unavailable_samples_count in Project::update_downloadable_sample_count, which is called in loader::generate_computed_files after the completion of computed file generation.

Problem or idea

The way that we currently couple the setting of unavailable_samples_count alongside downloadable_sample_count is not necessarily the optimal approach, as we already know whether or not a sample is unavailable when its loaded into the database and don't need to wait until after computed file generation. Instead, we should set it in Project::update_project_aggregate_properties with other aggregate attributes.

Solution or next step

class Project(...):
    ...

    def update_project_aggregate_properites(self):
        ...
        self.unavailable_samples_count = self.samples.filter(
            has_single_cell_data=False, has_spatial_data=False
        ).count()
        self.save()
@avrohomgottlieb avrohomgottlieb changed the title Clarify setting of Project unavailable_samples_count attribute Clarify setting of Project::unavailable_samples_count attribute Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant