Skip to content
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

Fix and extend input functionality #48

Merged
merged 10 commits into from
Oct 14, 2024
Merged

Fix and extend input functionality #48

merged 10 commits into from
Oct 14, 2024

Conversation

ammarcsj
Copy link
Member

@ammarcsj ammarcsj commented Oct 1, 2024

Bug fix: Resolved issue with additional columns

Extended input functionality:

  • Added Alphadia configuration

lfq_results_df = lfq_results_df[[x is not None for x in lfq_results_df[config.PROTEIN_ID]]]
if len(all_columns) == 1: #if there are no columns to add, return the original dataframe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some discrepancy between the comment and the logic above:
columns_to_add + [protein_column_input_table] + standard_columns_for_input_type

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so both the columns to add (columns specified by the user) and the standard columns (columns added by default) can be empty lists. I now made the if statement more explicit.

if (len(columns_to_add) == 0) and (len(standard_columns_for_input_type)==0) : #if there are no columns to add and no additional standard columns defined return the original dataframe return lfq_results_df

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, I think you could even drop the comment then as the code reads almost as good as plain text ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yess ☺️

@@ -327,6 +327,8 @@ def run_pipeline(self, *args):
file_of_proteins_for_normalization = None if self.protein_subset_for_normalization_file.value == '' else self.protein_subset_for_normalization_file.value
num_cores = None if self.num_cores_vals.value == -1 else self.num_cores_vals.value
yaml_filt_dict_path = None if self.yaml_filt_dict_path.value == '' else self.yaml_filt_dict_path.value
if type(additional_headers) == str: #the user will enter a string with semicolon separated values
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be any other type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any user input will be converted to a string. If there is no user input, there will be None

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this could be if additional_headers is not None:?

@ammarcsj ammarcsj merged commit f2200ed into master Oct 14, 2024
1 check passed
@ammarcsj ammarcsj deleted the fix_column_addition branch October 14, 2024 15:53
@ammarcsj
Copy link
Member Author

thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants