Skip to content

Commit

Permalink
refactor: get_library_source.py #108
Browse files Browse the repository at this point in the history
  • Loading branch information
balajtimate committed Nov 9, 2023
1 parent 00c0d6b commit 5c02280
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions htsinfer/get_library_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def evaluate(self) -> ResultsSource:
self.org_id,
self.transcripts_file
)
if self.paths[1] is not None:
source.file_2.taxon_id = self.org_id
source.file_2.short_name = source.file_1.short_name
else:
# Infer library source here and set it to source.library_source
index = self.create_kallisto_index()
Expand All @@ -92,13 +95,7 @@ def evaluate(self) -> ResultsSource:
source.file_1.short_name = library_source.short_name
source.file_1.taxon_id = library_source.taxon_id

if self.paths[1] is not None:
# Check if library_source is provided for file_2,
# otherwise infer it
if self.org_id is not None:
source.file_2.taxon_id = self.org_id
source.file_2.short_name = source.file_1.short_name
else:
if self.paths[1] is not None:
library_source = self.get_source(
fastq=self.paths[1],
index=index,
Expand Down

0 comments on commit 5c02280

Please sign in to comment.