Skip to content

Added debugging code

Choose a tag to compare

@Fish-In-A-Suit Fish-In-A-Suit released this 02 Oct 22:19
· 37 commits to main since this release

A MacOS user experienced the following bug:

(goreverselookup) simon@Simons-Laptop ~ % goreverselookup "statistically_relevant_genes.json" --report True --full_directory_op "/Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne"                                                                        
2024-10-02 21:33:30,457 [INFO] setup_logging_config: Setup log config using: config/logging_config.json
2024-10-02 21:33:30,457 [INFO] <module>: Starting GOReverseLookup analysis!
2024-10-02 21:33:30,457 [INFO] <module>: os.getcwd() =  /Users/simon
No model data filepath was specified, auto-inferring model data.
2024-10-02 21:33:30,458 [WARNING] backtrace: Backtrace 1 is greater than final element index 0 for filepath statistically_relevant_genes.json! Returning ''.
Model data not found. Attempted file search at None
Found the following input files:
  - [0]: /Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne/8IEA-noindann8/results/statistically_relevant_genes.json
  - [1]: /Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne/7IEA-noindann5/results/statistically_relevant_genes.json
  - [2]: /Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne/5IEA-indann5/results/statistically_relevant_genes.json
  - [3]: /Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne/6IEA-indann8/results/statistically_relevant_genes.json
2024-10-02 21:33:30,459 [INFO] main: Starting GOReverseLookup analysis with input params:
2024-10-02 21:33:30,459 [INFO] main:   - input_file: /Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne/8IEA-noindann8/results/statistically_relevant_genes.json
2024-10-02 21:33:30,459 [INFO] main:   - destination_dir: None
2024-10-02 21:33:30,459 [INFO] main:   - report: True
2024-10-02 21:33:30,459 [INFO] main:   - model_data_filepath: None
Model data was not found by auto-infer.
2024-10-02 21:33:30,459 [INFO] load_json: Load JSON received input filepath: cache/connection_cache.json
2024-10-02 21:33:33,420 [INFO] load_json: Load JSON received input filepath: cache/uniprot_cache.json
2024-10-02 21:33:33,421 [INFO] load_json: Load JSON received input filepath: cache/ensembl_cache.json
2024-10-02 21:33:33,423 [INFO] load_json: Load JSON received input filepath: cache/geneontology_cache.json
2024-10-02 21:33:33,426 [INFO] load_json: Load JSON received input filepath: cache/gprofiler_cache.json
2024-10-02 21:33:33,430 [INFO] init: Cacher load dictionary response counts:
2024-10-02 21:33:33,430 [INFO] init:   - urls: 775
2024-10-02 21:33:33,430 [INFO] init:   - uniprot: 15
2024-10-02 21:33:33,430 [INFO] init:   - ensembl: 465
2024-10-02 21:33:33,430 [INFO] init:   - geneontology: 234
2024-10-02 21:33:33,430 [INFO] init: Register at exit save data for Cacher.
2024-10-02 21:33:33,462 [DEBUG] _new_conn: Starting new HTTPS connection (1): www.ensembl.org:443
2024-10-02 21:33:33,698 [DEBUG] _make_request: https://www.ensembl.org:443 "GET /info/genome/stable_ids/prefixes.html HTTP/11" 200 14150
2024-10-02 21:33:33,748 [DEBUG] from_bytes: Encoding detection: ascii is most likely the one.
2024-10-02 21:33:33,773 [DEBUG] _new_conn: Starting new HTTPS connection (1): www.ensembl.org:443
2024-10-02 21:33:34,049 [DEBUG] _make_request: https://www.ensembl.org:443 "GET /info/genome/stable_ids/prefixes.html HTTP/11" 200 14102
2024-10-02 21:33:34,059 [DEBUG] from_bytes: Encoding detection: ascii is most likely the one.
2024-10-02 21:33:34,087 [INFO] load_json: Load JSON received input filepath: data_files/ens_spec_ids_taxa.json
2024-10-02 21:33:34,089 [INFO] from_input_file: Computing defined SOIs:
2024-10-02 21:33:34,089 [INFO] from_input_file: Creating model from input file with:
2024-10-02 21:33:34,089 [INFO] from_input_file:   - input file filepath: /Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne/8IEA-noindann8/results/statistically_relevant_genes.json
2024-10-02 21:33:34,089 [INFO] from_input_file:   - destination dir: /Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne/8IEA-noindann8/results
2024-10-02 21:33:34,089 [INFO] from_input_file:   - input file line count: 3
2024-10-02 21:33:34,089 [INFO] from_input_file:   - count GO Terms: 0 
2024-10-02 21:33:34,089 [INFO] from_input_file:   - target_SOIs: []
2024-10-02 21:33:34,089 [INFO] from_input_file:   - GO categories: []
2024-10-02 21:33:34,089 [INFO] from_input_file:   - model settings: {'fisher_test_use_online_query': False, 'include_indirect_annotations': False, 'uniprotkb_genename_online_query': False, 'multiple_correction_method': 'fdr_bh', 'two_tailed': False, 'pvalue': 0.05, 'goterms_set': [], 'datafile_paths': {}, 'ortholog_organisms_ncbi_full_ids': [], 'gorth_ortholog_refetch': False, 'gorth_ortholog_fetch_for_indefinitive_orthologs': True, 'all_evidence_codes': {}, 'evidence_codes_to_ecoids': {}, 'valid_evidence_codes': [], 'goterm_gene_query_timeout': 20, 'goterm_gene_query_max_retries': 3, 'exclude_opposite_regulation_direction_check': False, 'destination_dir': '/Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne/8IEA-noindann8/results', '_valid_multiple_correction_methods': ['bonferroni', 'sidak', 'holm-sidak', 'holm', 'simes-hochberg', 'hommel', 'fdr_bh', 'fdr_by', 'fdr_tsbh', 'fdr_tsbky']}
2024-10-02 21:33:34,089 [INFO] from_input_file:   - obo_parser: None
2024-10-02 21:33:34,089 [WARNING] get_datafile_path: datafile_name goa_human not found in (ModelSettings).datafile_paths
2024-10-02 21:33:34,089 [INFO] _init_: Attempting to create GOAF using: data_files/goa_human.gaf
2024-10-02 21:33:34,089 [INFO] _init_:   - GOAF filepath exists.
2024-10-02 21:33:35,262 [INFO] _init_:   - GOAF created with 0 annotations.
2024-10-02 21:33:35,340 [DEBUG] _new_conn: Starting new HTTPS connection (1): www.ebi.ac.uk:443
2024-10-02 21:33:35,514 [DEBUG] _make_request: https://www.ebi.ac.uk:443 "GET /QuickGO/services/ontology/go/about HTTP/11" 200 None
2024-10-02 21:33:35,515 [INFO] download_file: File data_files/go.obo exists and isn't empty.
2024-10-02 21:33:36,699 [INFO] _init_: Obo parser init completed.
2024-10-02 21:33:36,701 [DEBUG] _new_conn: Starting new HTTPS connection (1): www.ensembl.org:443
2024-10-02 21:33:36,936 [DEBUG] _make_request: https://www.ensembl.org:443 "GET /info/genome/stable_ids/prefixes.html HTTP/11" 200 14118
2024-10-02 21:33:36,982 [DEBUG] from_bytes: Encoding detection: ascii is most likely the one.
2024-10-02 21:33:37,007 [INFO] load_json: Load JSON received input filepath: data_files/ens_spec_ids_taxa.json
Model was created from input file: /Users/simon/goreverselookup/research_models/2oct_natural_amigo_ortho/IEAne/8IEA-noindann8/results/statistically_relevant_genes.json
2024-10-02 21:33:37,008 [DEBUG] _init_: Using selector: KqueueSelector
2024-10-02 21:33:37,008 [INFO] print_elapsed_time: Elapsed: 0:00:00
2024-10-02 21:33:37,008 [INFO] fetch_all_go_term_products: Started fetching all GO Term products.
2024-10-02 21:33:37,009 [DEBUG] _init_: Using selector: KqueueSelector
2024-10-02 21:33:37,009 [INFO] print_elapsed_time: Elapsed: 0:00:00
2024-10-02 21:33:37,009 [INFO] save_data: Cacher is saving data. Please, be patient.
2024-10-02 21:33:37,009 [INFO] save_data: Successfully saved url, uniprot, ensembl, geneontology and gprofiler cache.
2024-10-02 21:33:37,009 [INFO] create_products_from_goterms: Creating products from GO Terms. Num goterms = 0
Traceback (most recent call last):
  File "/Users/simon/goreverselookup/bin/goreverselookup", line 5, in <module>
    from goreverselookup.main_cli import main
  File "/Users/simon/goreverselookup/lib/python3.11/site-packages/goreverselookup/main_cli.py", line 271, in <module>
    model = main(input_file=f, destination_dir=destination_dir, report=report, model_data_filepath=model_data_filepath, rescore_model=static_rescore_model)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/simon/goreverselookup/lib/python3.11/site-packages/goreverselookup/main_cli.py", line 165, in main
    model.create_products_from_goterms()
  File "/Users/simon/goreverselookup/lib/python3.11/site-packages/goreverselookup/Model.py", line 512, in create_products_from_goterms
    target_taxon = self.model_settings.target_organism.ncbi_id_full
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'ncbi_id_full'
2024-10-02 21:33:37,011 [INFO] save_data: Cacher is saving data. Please, be patient.
2024-10-02 21:33:37,011 [INFO] save_data: Successfully saved url, uniprot, ensembl, geneontology and gprofiler cache.

Added more debugging lines with an aim to capture the bug better.