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

pysradb search error with specific search term #11

Closed
jarrodscott opened this issue Jul 18, 2019 · 3 comments
Closed

pysradb search error with specific search term #11

jarrodscott opened this issue Jul 18, 2019 · 3 comments

Comments

@jarrodscott
Copy link

  • pysradb version: 0.9.0
  • Python version: Python 3.7.3
  • Operating System: Centos

Description

Searching for the term hypoxia worked fine but searching the term hypoxic produced the following error message:

This is most likely a bug, please report it upstream.
sample_attribute: investigation type: metagenome || project name: Landsort Depth 20090415 transect || sequencing method: 454 || collection date: 2009-04-15 || ammonium: 8.7: µM || chlorophyll: 0: µg/L || dissolved oxygen: -1.33: µmol/kg || nitrate: 0.02: µM || nitrogen: 0: µM || environmental package: water || geographic location (latitude): 58.6: DD || geographic location (longitude): 18.2: DD || geographic location (country and/or sea,region): Baltic Sea || environment (biome): 00002150 || environment (feature): 00002150 || environment (material): 00002150 || depth: 400: m || Phosphate:  || Total phosphorous:  || Silicon:
Traceback (most recent call last):
  File "/envs/pysradb/bin/pysradb", line 11, in <module>
    sys.exit(parse_args())
  File "/envs/pysradb/lib/python3.7/site-packages/pysradb/cli.py", line 944, in parse_args
    args.saveto,
  File "/envs/pysradb/lib/python3.7/site-packages/pysradb/cli.py", line 148, in search
    expand_sample_attributes=expand,
  File "/envs/pysradb/lib/python3.7/site-packages/pysradb/sradb.py", line 1044, in search_sra
    acc_is_searchstr=True,
  File "/envs/pysradb/lib/python3.7/site-packages/pysradb/sradb.py", line 316, in sra_metadata
    metadata_df = expand_sample_attribute_columns(metadata_df)
  File "/envs/pysradb/lib/python3.7/site-packages/pysradb/filter_attrs.py", line 75, in expand_sample_attribute_columns
    sample_attribute_keys, _ = _get_sample_attr_keys(sample_attribute)
  File "/envs/pysradb/lib/python3.7/site-packages/pysradb/filter_attrs.py", line 27, in _get_sample_attr_keys
    sample_attribute_dict = dict(split_by_colon)
ValueError: dictionary update sequence element #19 has length 1; 2 is required

What I Did

pysradb  search "hypoxic" --db SRAmetadb.sqlite   --assay --desc   --detailed --expand  --saveto hypoxic_search.txt
@jarrodscott
Copy link
Author

FYI the above command works fine if I remove the --expand flag...

@saketkc
Copy link
Owner

saketkc commented Jul 18, 2019

Thanks @jarrodscott for reporting this! I am currently working on a partial rewrite of the core functionality. In the mean time, I have fixed this in 8b9cfa0 . You can install the latest version with pip install git+https://github.com/saketkc/pysradb

For search I would advise saving them to a tsv by passing the additional flag --saveto and then doing a head on the saved file. Using --expand mode can result in too many columns and the default printing on stdout is not optimized:

pysradb search hypoxic --desc --detailed --expand --saveto hypoxic_search.tsv

Let me know if you run into any issues.

@jarrodscott
Copy link
Author

No problem @saketkc. Thank you for providing this awesome program. I will install latest version and follow your recommendation. Aside from this small hiccup everything else has worked beautifully

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

No branches or pull requests

2 participants