Skip to content

Commit

Permalink
add get lib type test
Browse files Browse the repository at this point in the history
  • Loading branch information
balajtimate committed Jan 19, 2024
1 parent 93a0d33 commit 8c3eeb7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 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

0 comments on commit 8c3eeb7

Please sign in to comment.