Skip to content

Commit

Permalink
feat: add read orient single json output
Browse files Browse the repository at this point in the history
  • Loading branch information
balajtimate committed Oct 2, 2024
1 parent 1da7d19 commit fbb90f4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions htsinfer/get_read_orientation.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,13 @@ def process_single(
f"Required number of mapped reads pairs: {self.min_mapped_reads}"
)
LOGGER.debug(f"Number of reads mapped: {reads}")
LOGGER.debug(f"Fraction of states: {fractions_all_states}")
LOGGER.debug(f"Orientation: {orientation}")
LOGGER.debug(
f"Fraction of SF: {fractions_all_states.get(StatesOrientation.stranded_forward)}"
)
LOGGER.debug(
f"Fraction of SR: {fractions_all_states.get(StatesOrientation.stranded_reverse)}"
)
LOGGER.debug(f"Orientation: {orientation.value}")

# write data frame (in JSON) to file
filename = (
Expand All @@ -193,8 +198,9 @@ def process_single(
LOGGER.debug(f"Writing results to file: {filename}")
orientation_df = pd.DataFrame([{
'Number of mapped reads': reads,
'Fraction of states': fractions_all_states.get(StatesOrientation.stranded_forward, 0),
'Orientation': orientation
'Fraction SF': fractions_all_states.get(StatesOrientation.stranded_forward),
'Fraction SR': fractions_all_states.get(StatesOrientation.stranded_reverse),
'Orientation': orientation.value
}])
orientation_df.to_json(
filename,
Expand Down

0 comments on commit fbb90f4

Please sign in to comment.