Skip to content

Commit

Permalink
update get lib type tests
Browse files Browse the repository at this point in the history
  • Loading branch information
balajtimate committed Jan 23, 2024
1 parent 9220b6d commit 2f00114
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions tests/test_get_library_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,34 @@ def test_evaluate_mate_relationship_split_mates(self):
StatesTypeRelationship.split_mates
)

def test_evaluate_mate_relationship_assumed_single(self, tmpdir):
"""Test mate relationship evaluation logic with input files being
mates of a paired-end library but assumed single based on seq_ids.
"""
CONFIG.args.path_1_processed = FILE_MATE_1
CONFIG.args.path_2_processed = FILE_MATE_2
CONFIG.args.t_file_processed = FILE_TRANSCRIPTS
CONFIG.args.tmp_dir = tmpdir
CONFIG.results.library_source = ResultsSource(
file_1=Source(short_name="hsapiens", taxon_id=9606),
file_2=Source(short_name="hsapiens", taxon_id=9606),
)
MAPPING.paths = (FILE_MATE_1, FILE_MATE_2)
MAPPING.transcripts_file = FILE_TRANSCRIPTS
MAPPING.tmp_dir = tmpdir
test_instance = GetLibType(config=CONFIG,
mapping=MAPPING)
test_instance.results.file_1 = StatesType.single
test_instance.results.file_2 = StatesType.single
test_instance._evaluate_mate_relationship(
ids_1=["A", "B", "C"],
ids_2=["A", "B", "C"],
)
assert (
test_instance.results.relationship ==
StatesTypeRelationship.not_available
)

def test_evaluate_mate_relationship_not_mates(self, tmpdir):
"""Test mate relationship evaluation logic with input files that are
mates, but the relationship is not enough to trigger split_mates.
Expand Down Expand Up @@ -167,7 +195,7 @@ def test_evaluate_mate_relationship_not_available(self, tmpdir):
StatesTypeRelationship.not_available
)

def test_update_relationship_not_mates(self, tmpdir):
def test_update_relationship_type_not_mates(self, tmpdir):
"""Test update_relationship logic."""
CONFIG.args.path_1_processed = FILE_IDS_NOT_MATCH_1
CONFIG.args.path_2_processed = FILE_MATE_2
Expand All @@ -185,8 +213,8 @@ def test_update_relationship_not_mates(self, tmpdir):
concordant = 0
read_counter = 20

# Call the _update_relationship method
test_instance._update_relationship(concordant, read_counter)
# Call the _update_relationship_type method
test_instance._update_relationship_type(concordant, read_counter)

assert (
test_instance.results.relationship ==
Expand Down

0 comments on commit 2f00114

Please sign in to comment.