Skip to content

Commit

Permalink
Update barcode_collection-related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomoscasgr committed Jun 13, 2024
1 parent 83911d7 commit b290a48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/npg_irods/ont.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def barcode_collections(coll: Collection, *tag_identifier) -> list[Collection]:
# so possibly this was not deplexed on-instrument for some reason e.g.
# a non-standard tag set was used
log.warn(
"No barcode sub-collections",
"No barcode sub-collection",
parent=parent,
subfolder=barcode_name_from_id(tag_id),
tag_identifier=tag_id,
Expand Down
23 changes: 16 additions & 7 deletions tests/ont/test_metadata_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from partisan.irods import AC, AVU, Collection, DataObject, Permission, format_timestamp
from pytest import mark as m, raises

from helpers import LATEST, history_in_meta, tests_have_admin
from helpers import LATEST, add_rods_path, history_in_meta, tests_have_admin
from ont.conftest import ont_tag_identifier
from npg_irods import ont
from npg_irods.metadata.common import SeqConcept
Expand Down Expand Up @@ -699,10 +699,13 @@ class TestBarcodeRelatedFunctions(object):
@m.context("When rebasecalled ONT runs are plexed")
@m.context("When barcode folders lie one level down in the output folder")
@m.it("Barcode collections number is correct")
def test_barcode_collections_under_subfolder(self, ont_synthetic_irods):
def test_barcode_collections_under_subfolder(self):
expected_bcolls = 5
root_path = PurePath(
"/testZone/home/irods/test/ont_synthetic_irods/synthetic/barcode_collection_test"
)
expt = "multiplexed_folder_experiment_001"
path = ont_synthetic_irods / expt / "20190904_1514_GA10000_flowcell401_ba641ab1"
path = root_path / expt / "20190904_1514_GA10000_flowcell401_ba641ab1"
tag_identifiers = [ont_tag_identifier(tag_index) for tag_index in range(1, 6)]
for tag_identifier in tag_identifiers:
bpath = path / "pass" / ont.barcode_name_from_id(tag_identifier)
Expand All @@ -714,10 +717,13 @@ def test_barcode_collections_under_subfolder(self, ont_synthetic_irods):
@m.context("When rebasecalled ONT runs are plexed")
@m.context("When barcodes are right under the output folder")
@m.it("Barcode collections number is correct")
def test_barcode_collections_under_output_folder(self, ont_synthetic_irods):
def test_barcode_collections_under_output_folder(self):
expected_bcolls = 5
root_path = PurePath(
"/testZone/home/irods/test/ont_synthetic_irods/synthetic/barcode_collection_test"
)
expt = "multiplexed_folder_experiment_002"
path = ont_synthetic_irods / expt / "20190904_1514_GA10000_flowcell402_ca641bc1"
path = root_path / expt / "20190904_1514_GA10000_flowcell402_ca641bc1"
tag_identifiers = [ont_tag_identifier(tag_index) for tag_index in range(1, 6)]
for tag_identifier in tag_identifiers:
bpath = path / ont.barcode_name_from_id(tag_identifier)
Expand All @@ -729,9 +735,12 @@ def test_barcode_collections_under_output_folder(self, ont_synthetic_irods):
@m.context("When rebasecalled ONT runs are plexed")
@m.context("When the barcode folder is duplicated under a barcode collection")
@m.it("Raises exception for duplicated barcode folders")
def test_barcode_collections_duplicates(self, ont_synthetic_irods):
def test_barcode_collections_duplicates(self):
root_path = PurePath(
"/testZone/home/irods/test/ont_synthetic_irods/synthetic/barcode_collection_test"
)
expt = "multiplexed_folder_experiment_003"
path = ont_synthetic_irods / expt / "20190904_1514_GA10000_flowcell403_de531cf1"
path = root_path / expt / "20190904_1514_GA10000_flowcell403_de531cf1"
tag_identifiers = [ont_tag_identifier(tag_index) for tag_index in range(1, 6)]
for tag_identifier in tag_identifiers:
barcode_name = ont.barcode_name_from_id(tag_identifier)
Expand Down

0 comments on commit b290a48

Please sign in to comment.