From 34945e40f7f66cce4641cf6974a05c7d2fcab20b Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Tue, 31 Jan 2023 14:49:36 -0500 Subject: [PATCH 1/8] fixed finder bug --- geofetch/finder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/geofetch/finder.py b/geofetch/finder.py index 1882e11..c54b9be 100644 --- a/geofetch/finder.py +++ b/geofetch/finder.py @@ -133,8 +133,10 @@ def _run_search_query(url: str) -> list: x_result = xmltodict.parse(x.text)["eSearchResult"] _LOGGER.info(f"Found elements: {x_result['Count']}") _LOGGER.info(f"Additional information: {x_result['TranslationSet']}") - - return x_result["IdList"]["Id"] + if isinstance(x_result["IdList"]["Id"], list): + return x_result["IdList"]["Id"] + else: + return [x_result["IdList"]["Id"]] except Exception: return [] From e15683b543bc21b202b0d57f3cdae7142a9edb21 Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Sat, 25 Mar 2023 17:49:15 -0400 Subject: [PATCH 2/8] Added description saver in peppy init --- geofetch/geofetch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/geofetch/geofetch.py b/geofetch/geofetch.py index d36a491..defe879 100755 --- a/geofetch/geofetch.py +++ b/geofetch/geofetch.py @@ -1046,6 +1046,7 @@ def _write_processed_annotation( conf = yaml.load(template, Loader=yaml.Loader) proj = peppy.Project().from_pandas(pd_value, config=conf) + proj.description = conf.get("experiment_metadata").get("series_title") return proj @staticmethod @@ -1165,6 +1166,7 @@ def _write_raw_annotation_new( conf = yaml.load(template, Loader=yaml.Loader) proj = peppy.Project().from_pandas(meta_df, sub_meta_df, conf) + proj.description = conf.get("experiment_metadata").get("series_title") return proj def _create_config_processed( From 4dc2e8dd1afaf5de19872d2b6ad85d16e2ffb13c Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Sat, 25 Mar 2023 17:51:12 -0400 Subject: [PATCH 3/8] lint --- geofetch/geofetch.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/geofetch/geofetch.py b/geofetch/geofetch.py index defe879..a9378ce 100755 --- a/geofetch/geofetch.py +++ b/geofetch/geofetch.py @@ -376,7 +376,6 @@ def fetch_all(self, input: str, name: str = None) -> Union[NoReturn, peppy.Proje description="Processing... ", disable=self.disable_progressbar, ): - ncount += 1 if ncount <= self.skip: continue @@ -563,7 +562,6 @@ def _process_sra_meta( gsm_multi_table = {} runs = [] for line in srp_list_result: - # Only download if it's in the include list: experiment = line["Experiment"] run_name = line["Run"] @@ -889,7 +887,6 @@ def _expand_metadata_list_item(self, metadata_list: list, dict_key: str): for elem in metadata_list[n_elem][dict_key]: separated_elements = elem.split(": ") if len(separated_elements) >= 2: - # if first element is larger than 40 then treat it like simple string if len(separated_elements[0]) > 40: just_string = True @@ -1537,7 +1534,6 @@ def _get_list_of_processed_files( meta_processed_samples = [] meta_processed_series = {"GSE": "", "files": []} for line in file_gse_content: - if re.compile(r"!Series_geo_accession").search(line): gse_numb = _get_value(line) meta_processed_series["GSE"] = gse_numb @@ -1585,7 +1581,6 @@ def _get_list_of_processed_files( nb = len(meta_processed_samples) - 1 sample_table = False for line_gsm in file_gsm_content: - # handles #103 if line_gsm == "!sample_table_begin": sample_table = True @@ -1933,7 +1928,6 @@ def _read_gsm_metadata( sample_table = False for line in file_gsm_content: - # handles #103 if line == "!sample_table_begin": sample_table = True From 54ad5d14d35bf7c15f781b66a115506d884c30a0 Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Sat, 25 Mar 2023 18:51:27 -0400 Subject: [PATCH 4/8] init description fix --- geofetch/geofetch.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/geofetch/geofetch.py b/geofetch/geofetch.py index a9378ce..e6f38d0 100755 --- a/geofetch/geofetch.py +++ b/geofetch/geofetch.py @@ -1043,7 +1043,9 @@ def _write_processed_annotation( conf = yaml.load(template, Loader=yaml.Loader) proj = peppy.Project().from_pandas(pd_value, config=conf) - proj.description = conf.get("experiment_metadata").get("series_title") + proj_exp_data = conf.get("experiment_metadata") + if proj_exp_data: + proj.description = proj_exp_data.get("series_title") return proj @staticmethod @@ -1163,7 +1165,9 @@ def _write_raw_annotation_new( conf = yaml.load(template, Loader=yaml.Loader) proj = peppy.Project().from_pandas(meta_df, sub_meta_df, conf) - proj.description = conf.get("experiment_metadata").get("series_title") + proj_exp_data = conf.get("experiment_metadata") + if proj_exp_data: + proj.description = proj_exp_data.get("series_title") return proj def _create_config_processed( From 87558a7242660c365aa57f8f24bc8e2b4b5b33eb Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Sun, 26 Mar 2023 20:36:39 -0400 Subject: [PATCH 5/8] added publication link to the docs --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index dfc6c83..e3a6c2f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,6 +3,7 @@ site_url: http://code.databio.org/geofetch/ repo_url: http://github.com/pepkit/geofetch site_logo: img/geofetch_logo_dark.svg pypi_name: geofetch +paper_link: https://doi.org/10.1093/bioinformatics/btad069 nav: - Getting started: From 516535fdfe505077e61da9c6a5983a9f66d1ee6e Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Sun, 26 Mar 2023 20:38:41 -0400 Subject: [PATCH 6/8] added changelog --- docs/changelog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 1e4ba1a..0441e16 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,7 +1,8 @@ # Changelog -## [0.12.0] -- 2023-01-23 +## [0.12.0] -- 2023-03-27 - Added functionality that saves gse metadata to config file +- Fixed description in initialization of pepy object ## [0.11.2] -- 2022-12-25 - Changed sample_name of PEP of processed files to file oriented From ea2a72f0f31c1591e219a26bff19fa0cebe9fa30 Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Mon, 27 Mar 2023 13:34:47 -0400 Subject: [PATCH 7/8] fixed assigning description using by removing attmap dependency --- geofetch/geofetch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geofetch/geofetch.py b/geofetch/geofetch.py index e6f38d0..f54ce07 100755 --- a/geofetch/geofetch.py +++ b/geofetch/geofetch.py @@ -1045,7 +1045,7 @@ def _write_processed_annotation( proj = peppy.Project().from_pandas(pd_value, config=conf) proj_exp_data = conf.get("experiment_metadata") if proj_exp_data: - proj.description = proj_exp_data.get("series_title") + proj["description"] = proj_exp_data.get("series_title") return proj @staticmethod @@ -1167,7 +1167,7 @@ def _write_raw_annotation_new( proj = peppy.Project().from_pandas(meta_df, sub_meta_df, conf) proj_exp_data = conf.get("experiment_metadata") if proj_exp_data: - proj.description = proj_exp_data.get("series_title") + proj["description"] = proj_exp_data.get("series_title") return proj def _create_config_processed( From 2eee30e150cbfa1903154e3859498ae04a9d1784 Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Mon, 27 Mar 2023 13:35:27 -0400 Subject: [PATCH 8/8] added version --- geofetch/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geofetch/_version.py b/geofetch/_version.py index ea370a8..def467e 100644 --- a/geofetch/_version.py +++ b/geofetch/_version.py @@ -1 +1 @@ -__version__ = "0.12.0" +__version__ = "0.12.1"