Skip to content

Commit cb1c4e4

Browse files
Merge pull request #111 from pepkit/dev
v0.12.1
2 parents e38a70d + 2eee30e commit cb1c4e4

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

docs/changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Changelog
22

3-
## [0.12.0] -- 2023-01-23
3+
## [0.12.0] -- 2023-03-27
44
- Added functionality that saves gse metadata to config file
5+
- Fixed description in initialization of pepy object
56

67
## [0.11.2] -- 2022-12-25
78
- Changed sample_name of PEP of processed files to file oriented

geofetch/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.12.0"
1+
__version__ = "0.12.1"

geofetch/finder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ def _run_search_query(url: str) -> list:
133133
x_result = xmltodict.parse(x.text)["eSearchResult"]
134134
_LOGGER.info(f"Found elements: {x_result['Count']}")
135135
_LOGGER.info(f"Additional information: {x_result['TranslationSet']}")
136-
137-
return x_result["IdList"]["Id"]
136+
if isinstance(x_result["IdList"]["Id"], list):
137+
return x_result["IdList"]["Id"]
138+
else:
139+
return [x_result["IdList"]["Id"]]
138140
except Exception:
139141
return []
140142

geofetch/geofetch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ def fetch_all(self, input: str, name: str = None) -> Union[NoReturn, peppy.Proje
376376
description="Processing... ",
377377
disable=self.disable_progressbar,
378378
):
379-
380379
ncount += 1
381380
if ncount <= self.skip:
382381
continue
@@ -563,7 +562,6 @@ def _process_sra_meta(
563562
gsm_multi_table = {}
564563
runs = []
565564
for line in srp_list_result:
566-
567565
# Only download if it's in the include list:
568566
experiment = line["Experiment"]
569567
run_name = line["Run"]
@@ -889,7 +887,6 @@ def _expand_metadata_list_item(self, metadata_list: list, dict_key: str):
889887
for elem in metadata_list[n_elem][dict_key]:
890888
separated_elements = elem.split(": ")
891889
if len(separated_elements) >= 2:
892-
893890
# if first element is larger than 40 then treat it like simple string
894891
if len(separated_elements[0]) > 40:
895892
just_string = True
@@ -1046,6 +1043,9 @@ def _write_processed_annotation(
10461043

10471044
conf = yaml.load(template, Loader=yaml.Loader)
10481045
proj = peppy.Project().from_pandas(pd_value, config=conf)
1046+
proj_exp_data = conf.get("experiment_metadata")
1047+
if proj_exp_data:
1048+
proj["description"] = proj_exp_data.get("series_title")
10491049
return proj
10501050

10511051
@staticmethod
@@ -1165,6 +1165,9 @@ def _write_raw_annotation_new(
11651165
conf = yaml.load(template, Loader=yaml.Loader)
11661166

11671167
proj = peppy.Project().from_pandas(meta_df, sub_meta_df, conf)
1168+
proj_exp_data = conf.get("experiment_metadata")
1169+
if proj_exp_data:
1170+
proj["description"] = proj_exp_data.get("series_title")
11681171
return proj
11691172

11701173
def _create_config_processed(
@@ -1535,7 +1538,6 @@ def _get_list_of_processed_files(
15351538
meta_processed_samples = []
15361539
meta_processed_series = {"GSE": "", "files": []}
15371540
for line in file_gse_content:
1538-
15391541
if re.compile(r"!Series_geo_accession").search(line):
15401542
gse_numb = _get_value(line)
15411543
meta_processed_series["GSE"] = gse_numb
@@ -1583,7 +1585,6 @@ def _get_list_of_processed_files(
15831585
nb = len(meta_processed_samples) - 1
15841586
sample_table = False
15851587
for line_gsm in file_gsm_content:
1586-
15871588
# handles #103
15881589
if line_gsm == "!sample_table_begin":
15891590
sample_table = True
@@ -1931,7 +1932,6 @@ def _read_gsm_metadata(
19311932
sample_table = False
19321933

19331934
for line in file_gsm_content:
1934-
19351935
# handles #103
19361936
if line == "!sample_table_begin":
19371937
sample_table = True

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ site_url: http://code.databio.org/geofetch/
33
repo_url: http://github.com/pepkit/geofetch
44
site_logo: img/geofetch_logo_dark.svg
55
pypi_name: geofetch
6+
paper_link: https://doi.org/10.1093/bioinformatics/btad069
67

78
nav:
89
- Getting started:

0 commit comments

Comments
 (0)