-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rt length to output ii #373
Open
mschwoer
wants to merge
13
commits into
add_rt_length_to_output
Choose a base branch
from
add_rt_length_to_output_II
base: add_rt_length_to_output
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+227
−103
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3e64886
refactor pickling
mschwoer b626e19
add stats to output df
mschwoer 525e5ee
renaming
mschwoer 88c92b9
add a comment
mschwoer 576730b
revert changes to logging.ipynb
mschwoer 268d48f
rename output fields
mschwoer 16ef232
add output docu
mschwoer 447c316
refactor stat output writing
mschwoer 7ec9f92
refactor stat output writing
mschwoer 54d48e4
refactor stat output writing
mschwoer 8c78a78
adapt test
mschwoer a557151
adapt test
mschwoer 14277ab
fix gradient_length_m
mschwoer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,14 @@ def __init__( | |
self.stats = {} # needs to be before super().__init__ to avoid overwriting loaded values | ||
|
||
super().__init__(path=path, load_from_file=load_from_file, **kwargs) | ||
self.reporter.log_string(f"Initializing {self.__class__.__name__}") | ||
self.reporter.log_event("initializing", {"name": f"{self.__class__.__name__}"}) | ||
|
||
self._config: Config = config | ||
|
||
# deliberately not saving the actual raw data here to avoid the saved manager file being too large | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just a comment why the dia_data goes back into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes it is |
||
|
||
self.reporter.log_string(f"Initializing {self.__class__.__name__}") | ||
self.reporter.log_event("initializing", {"name": f"{self.__class__.__name__}"}) | ||
|
||
def get_dia_data_object( | ||
self, dia_data_path: str | ||
) -> bruker.TimsTOFTranspose | alpharaw_wrapper.AlphaRaw: | ||
|
@@ -121,8 +124,6 @@ def _calc_stats( | |
stats["rt_limit_min"] = rt_values.min() | ||
stats["rt_limit_max"] = rt_values.max() | ||
|
||
stats["rt_duration_sec"] = rt_values.max() - rt_values.min() | ||
|
||
cycle_length = cycle.shape[1] | ||
stats["cycle_length"] = cycle_length | ||
stats["cycle_duration"] = np.diff(rt_values[::cycle_length]).mean() | ||
|
@@ -138,13 +139,13 @@ def _calc_stats( | |
|
||
def _log_stats(self): | ||
"""Log the statistics calculated from the DIA data.""" | ||
rt_duration_min = self.stats["rt_duration_sec"] / 60 | ||
rt_duration = self.stats["rt_limit_max"] - self.stats["rt_limit_min"] | ||
|
||
logger.info( | ||
f"{'RT (min)':<20}: {self.stats['rt_limit_min']/60:.1f} - {self.stats['rt_limit_max']/60:.1f}" | ||
) | ||
logger.info(f"{'RT duration (sec)':<20}: {self.stats['rt_duration_sec']:.1f}") | ||
logger.info(f"{'RT duration (min)':<20}: {rt_duration_min:.1f}") | ||
logger.info(f"{'RT duration (sec)':<20}: {rt_duration:.1f}") | ||
logger.info(f"{'RT duration (min)':<20}: {rt_duration/60:.1f}") | ||
|
||
logger.info(f"{'Cycle len (scans)':<20}: {self.stats['cycle_length']:.0f}") | ||
logger.info(f"{'Cycle len (sec)':<20}: {self.stats['cycle_duration']:.2f}") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the refactor 😄