Exemple #1
0
def test_pools_to_status(rml_order):
    # GIVEN a rml order with three samples in one pool
    # WHEN parsing for status
    data = StatusHandler.pools_to_status(rml_order)
    # THEN it should pick out the general information
    assert data['customer'] == 'cust001'
    assert data['order'] == 'ctDNA sequencing - order 9'
    # ... and information about the pool(s)
    assert len(data['pools']) == 1
    assert data['pools'][0]['name'] == '1'
    assert data['pools'][0]['application'] == 'RMLS05R150'
def test_pools_to_status(rml_order_to_submit):
    # GIVEN a rml order with three samples in one pool
    # WHEN parsing for status
    data = StatusHandler.pools_to_status(rml_order_to_submit)
    # THEN it should pick out the general information
    assert data["customer"] == "cust001"
    assert data["order"] == "ctDNA sequencing - order 9"
    # ... and information about the pool(s)
    assert len(data["pools"]) == 1
    assert data["pools"][0]["name"] == "pool-1"
    assert data["pools"][0]["application"] == "RMLS05R150"
    assert data["pools"][0]["data_analysis"] == "fastq"
    assert data["pools"][0]["capture_kit"] == "Agilent Sureselect CRE"
Exemple #3
0
def test_samples_to_status(fastq_order):
    # GIVEN fastq order with two samples
    # WHEN parsing for status
    data = StatusHandler.samples_to_status(fastq_order)
    # THEN it should pick out samples and relevant information
    assert len(data['samples']) == 2
    first_sample = data['samples'][0]
    assert first_sample['name'] == 'sample-normal'
    assert first_sample['application'] == 'WGSPCFC060'
    assert first_sample['priority'] == 'priority'
    assert first_sample['tumour'] is False

    # ... and the other sample is a tumour
    assert data['samples'][1]['tumour'] is True
def test_samples_to_status(fastq_order_to_submit):
    # GIVEN fastq order with two samples
    # WHEN parsing for status
    data = StatusHandler.samples_to_status(fastq_order_to_submit)
    # THEN it should pick out samples and relevant information
    assert len(data["samples"]) == 2
    first_sample = data["samples"][0]
    assert first_sample["name"] == "prov1"
    assert first_sample["application"] == "WGSPCFC060"
    assert first_sample["data_analysis"] == "fastq"
    assert first_sample["priority"] == "priority"
    assert first_sample["tumour"] is False

    # ... and the other sample is a tumour
    assert data["samples"][1]["tumour"] is True
def test_microbial_samples_to_status(microbial_order_to_submit):
    # GIVEN microbial order with three samples

    # WHEN parsing for status
    data = StatusHandler.microbial_samples_to_status(microbial_order_to_submit)

    # THEN it should pick out samples and relevant information
    assert len(data["samples"]) == 5
    assert data["customer"] == "cust002"
    assert data["order"] == "Microbial samples"
    assert data["comment"] == "Order comment"

    # THEN first sample should contain all the relevant data from the microbial order
    sample_data = data["samples"][0]
    assert sample_data.get("priority") in "research"
    assert sample_data["name"] == "all-fields"
    assert sample_data.get("internal_id") is None
    assert sample_data["organism_id"] == "M.upium"
    assert sample_data["reference_genome"] == "NC_111"
    assert sample_data["application"] == "MWRNXTR003"
    assert sample_data["data_analysis"] == "fastq"
    assert sample_data["comment"] == "plate comment"
Exemple #6
0
def test_families_to_status(scout_order):
    # GIVEN a scout order with a trio family
    # WHEN parsing for status
    data = StatusHandler.families_to_status(scout_order)
    # THEN it should pick out the family
    assert len(data['families']) == 1
    family = data['families'][0]
    assert family['name'] == '17093'
    assert family['priority'] == 'standard'
    assert set(family['panels']) == set(['IEM', 'EP'])
    assert len(family['samples']) == 3

    first_sample = family['samples'][0]
    assert first_sample['name'] == '17093-I-2A'
    assert first_sample['application'] == 'WGTPCFC030'
    assert first_sample['sex'] == 'female'
    assert first_sample['status'] == 'affected'
    assert first_sample['mother'] == '17093-II-2U'
    assert first_sample['father'] == '17093-II-1U'

    # ... second sample has a comment
    assert isinstance(family['samples'][1]['comment'], str)
def test_families_to_status(mip_order_to_submit):
    # GIVEN a scout order with a trio family
    # WHEN parsing for status
    data = StatusHandler.cases_to_status(mip_order_to_submit)
    # THEN it should pick out the family
    assert len(data["families"]) == 2
    family = data["families"][0]
    assert family["name"] == "family1"
    assert family["priority"] == "standard"
    assert set(family["panels"]) == {"IEM"}
    assert len(family["samples"]) == 3

    first_sample = family["samples"][0]
    assert first_sample["name"] == "sample1"
    assert first_sample["application"] == "WGTPCFC030"
    assert first_sample["data_analysis"] == "MIP"
    assert first_sample["sex"] == "female"
    assert first_sample["status"] == "affected"
    assert first_sample["mother"] == "sample2"
    assert first_sample["father"] == "sample3"

    # ... second sample has a comment
    assert isinstance(family["samples"][1]["comment"], str)
Exemple #8
0
def metagenome_status_data(metagenome_order_to_submit):
    """Parse metagenome order example."""
    data = StatusHandler.samples_to_status(metagenome_order_to_submit)
    return data
Exemple #9
0
def balsamic_status_data(balsamic_order_to_submit):
    """Parse cancer order example."""
    data = StatusHandler.cases_to_status(balsamic_order_to_submit)
    return data
Exemple #10
0
def microbial_status_data(microbial_order_to_submit):
    """Parse microbial order example."""
    data = StatusHandler.microbial_samples_to_status(microbial_order_to_submit)
    return data
Exemple #11
0
def external_status_data(external_order_to_submit):
    """Parse external order example."""
    data = StatusHandler.cases_to_status(external_order_to_submit)
    return data
Exemple #12
0
def mip_rna_status_data(mip_rna_order_to_submit):
    """Parse rna order example."""
    data = StatusHandler.cases_to_status(mip_rna_order_to_submit)
    return data
Exemple #13
0
def fastq_status_data(fastq_order_to_submit):
    """Parse fastq order example."""
    data = StatusHandler.samples_to_status(fastq_order_to_submit)
    return data
Exemple #14
0
def rml_status_data(rml_order_to_submit):
    """Parse rml order example."""
    data = StatusHandler.pools_to_status(rml_order_to_submit)
    return data