-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add methods to export results in tabular format (#280)
* add print links method to LinkGraph, improve LinkGraph string representation * feat: add a method to print tabular results files * improve method names and docstrings, remove unused method to export gcf file * improve doctring and typing * fix a failing test * refactor a little bit the spectrum method to covert to dict * change the output format for gnps_annotations in metabolomics results file, improve docstrings * fix: convert int to str before using join * change representation of empty values in output files for improved integration to excel * refactoring the export methods * small refactor: specify staticmethod * add more tests * correct typing in doctrings * typing: changed typings to pass mypy static typing checks * refactor: change the order of methods/functions * restore the order of already existing functions and methods * make dicts json compatible * rename functions and variables * refactor: changed the place when the index is added to the link dict * use csv package to write the tabular output files * make sure all elements of the input list have the same type of data. * shorten to long doc string lines, correct some doc strings * tests: adapted the test to the changes * remove a file that was committed by accident * Improve docstrings Apply suggestions from code review Co-authored-by: Cunliang Geng <[email protected]> * Improve docstrings Apply suggestions from code review Co-authored-by: Cunliang Geng <[email protected]> * refactor: add method to convert a value to string for tabular output * improve doctring, add a comment about key order of bgc dict representation * move to_string method to the BGC/Spectrum class, add a to_tabular method * add tests for the to_string method * change to_tabular to it returns a list and not a string * refactor: to_tabular returns dict, to_string turned into private func, tabs are replaced in to_tabular * fix typing in to_tabular methods * update docstrings and comments * ensure 0 and 0.0 are correctly converted to strings, and not to empty strings * change the order of methods * remove whitespace in blank lines * update and add tests * change variable name to fix mypy error * test: trying to fix unit test issue where the spectrum rt is a dict instead of numerical * tests: add precursor charge to the test spectra * Update src/nplinker/metabolomics/spectrum.py --------- Co-authored-by: Cunliang Geng <[email protected]>
- Loading branch information
1 parent
4d57ccd
commit 481a068
Showing
10 changed files
with
528 additions
and
30 deletions.
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
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.