Skip to content

Commit

Permalink
Merge pull request #111 from pepkit/dev
Browse files Browse the repository at this point in the history
v0.12.1
  • Loading branch information
khoroshevskyi authored Mar 27, 2023
2 parents e38a70d + 2eee30e commit cb1c4e4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion geofetch/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.12.0"
__version__ = "0.12.1"
6 changes: 4 additions & 2 deletions geofetch/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

Expand Down
12 changes: 6 additions & 6 deletions geofetch/geofetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1046,6 +1043,9 @@ def _write_processed_annotation(

conf = yaml.load(template, Loader=yaml.Loader)
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")
return proj

@staticmethod
Expand Down Expand Up @@ -1165,6 +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_exp_data = conf.get("experiment_metadata")
if proj_exp_data:
proj["description"] = proj_exp_data.get("series_title")
return proj

def _create_config_processed(
Expand Down Expand Up @@ -1535,7 +1538,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
Expand Down Expand Up @@ -1583,7 +1585,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
Expand Down Expand Up @@ -1931,7 +1932,6 @@ def _read_gsm_metadata(
sample_table = False

for line in file_gsm_content:

# handles #103
if line == "!sample_table_begin":
sample_table = True
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ site_url: http://code.databio.org/geofetch/
repo_url: https://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:
Expand Down

0 comments on commit cb1c4e4

Please sign in to comment.