Skip to content

NameError: name 'cmd_biomart' is not defined; NameError: name 'time' is not defined #11

@ossmith

Description

@ossmith

From an email sent to me: a couple of bugs I didn't catch in testing since I run <400 annotations through BioMart. It's safe to correct these as suggested, but I should add a test which would catch this in the future.

Bug 1:

/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-env/lib/python3.11/site-packages/intersect.py:164: DtypeWarning: Columns (0) have mixed types. Specify dtype option on import or set low_memory=False.
  raw_df = pd.read_csv(argumentClass.gwas, sep="\t", header=0, index_col=False) # sep="\t"
Traceback (most recent call last):
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-env/bin/hare", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-env/lib/python3.11/site-packages/hare.py", line 122, in main
    run_intersect(intargs)
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-env/lib/python3.11/site-packages/hare.py", line 36, in run_intersect
    intersect.main(**intersect_args)
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-env/lib/python3.11/site-packages/intersect.py", line 705, in main
    locations_filepath = biomart_locate(annotation_filepath, hareParameters, hareSettings)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-env/lib/python3.11/site-packages/intersect.py", line 481, in biomart_locate
    os.system(cmd_biomart)
              ^^^^^^^^^^^
NameError: name 'cmd_biomart' is not defined. Did you mean: 'run_biomart'?

Bug 2:

/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-revised-env/lib/python3.11/site-packages/intersect.py:164: DtypeWarning: Columns (0) have mixed types. Specify dtype option on import or set low_memory=False.
  raw_df = pd.read_csv(argumentClass.gwas, sep="\t", header=0, index_col=False) # sep="\t"
Traceback (most recent call last):
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-revised-env/bin/hare", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-revised-env/lib/python3.11/site-packages/hare.py", line 122, in main
    run_intersect(intargs)
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-revised-env/lib/python3.11/site-packages/hare.py", line 36, in run_intersect
    intersect.main(**intersect_args)
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-revised-env/lib/python3.11/site-packages/intersect.py", line 705, in main
    locations_filepath = biomart_locate(annotation_filepath, hareParameters, hareSettings)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/home/ac1q5qmtwi/softwares/miniconda3/envs/hare-revised-env/lib/python3.11/site-packages/intersect.py", line 484, in biomart_locate
    time.sleep(0.5) # Prevent lockout of BioMart from rate limit
    ^^^^
NameError: name 'time' is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions