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

Create MutantSampleFileFormatter #3907

Open
ChrOertlin opened this issue Oct 31, 2024 · 3 comments
Open

Create MutantSampleFileFormatter #3907

ChrOertlin opened this issue Oct 31, 2024 · 3 comments
Assignees

Comments

@ChrOertlin
Copy link
Contributor

ChrOertlin commented Oct 31, 2024

Description

Create class MutantSampleNameGenerator

  1. Create sample file names for mutant sample files

Reason: since we require to rename files in the upload as well as delivery this module should be atomic as possible for re-use.

Create class MutantSampleFileFormatter

responsibilities

  1. create sample folders
  2. create sample file names
  3. rename sample files with appropriate names
  4. Needs to concatenate fastq files
  5. Make use of MutantSampleNameGenerator

Implementation

Create class MutantFileFormatter that inherit SampleFileConcatenationFormatter

init super (requires concatenation service)
inject lims api

def format_files()
    formatted_files = super().format_files
    meta_data_files= _add_lims_meta_data(formatted_files)
    return self._format_sample_files(meta_data_files)

Add function s

def _add_lims_metadata():
# for sample file in formatted_files.sample_file
# call get lims meta data(sample_id)

    def get_lims_naming_metadata(self, sample_id -> str | None:
        region_code = self.lims_api.get_sample_attribute(
            lims_id=sample.internal_id, key="region_code"
        ).split(" ")[0]
        lab_code = self.lims_api.get_sample_attribute(
            lims_id=sample.internal_id, key="lab_code"
        ).split(" ")[0]

        return f"{region_code}_{lab_code}"
@Vince-janv
Copy link
Contributor

Current naming is done by this function: cg.meta.workflow.fastq.FastqHandler.get_concatenated_name

@Vince-janv
Copy link
Contributor

We should compare the new directory structure with the current one and notify the customer (via KN or MAR) if this will change. Just to not crash any automation they might have

@Vince-janv
Copy link
Contributor

Can you add that the FASTQ files should be concatenated?

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

3 participants