make_post_attempts: Create POST queries to try out.

View source: R/post_eupath_annotations.R

make_post_attemptsR Documentation

Create POST queries to try out.

Description

This function was written in an attempt to address some of the peculiarities when POSTING for non-standard eupathdb species. Here are my notes while I was trying to figure out what is going on:

Usage

make_post_attempts(attempts, search)

Details

Ohhhhh I see the problem, in a fashion similar to the bug with Schizosaccharomyces pombe, the TriTrypDB is not including the '/' symbols in the strain ID when it returns the metadata.

Here is the string returned when examining the API help: 'https://fungidb.org/fungidb/app/web-services-help?searchName=GenesByTaxon&weight=10&organism= So, if I use URLencode, I should get a compatible string? species_coded <- URLencode(species) help_url <- glue("https://fungidb.org/fungidb/app/web-services-help?searchName=GenesByTaxon&weight=10&organism=species_coded") Note that the json printed here is not really... valid. But unless something very close to it is provided the API will fail. The most problematic part is of course the json escaped quotes. As far as I can tell, my json is exactly identical to their json, but still it does not always work.

"searchConfig": "parameters": "organism": "[\"Allomyces macrogynus ATCC 38327\",\"Blastocladiomycota\"]" , "wdkWeight": 10 , "reportConfig": "attributes": [ "primary_key" ], "tables": [] Looking more into why some species fail, it looks like there is sometimes a mismatch between the species reported by the metadata provided by eupathdb and the 'official' species at the genomeInfoDB/TaxonomyDB In the case of 'Porospora cf. gigantea A', for example, the eupathdb metadata calls it 'Porospora gigantea A' without the 'cf.' – sadly, if one attempts to use that as the organism ID, everything will fail.

FIXME: This should be changed to only test the 'searchConfig' portion of the body. Then the successful searchConfig may be passed to the other post_eupath_table() calls.

The help documentation at cryptodb does not put [] around the species; but it still doesn't work. even copy/pasting their stupid example. Interestingly, when I tested using another species (Gregarina niphandrodes Unknown), the GET/POST strings returned _do_ have the [] along with escaped quotation marks as per post_json_v1. __AND__ it appended to that list the genus: \"Gregarinidae\" post_json_scalar <- glue(' "searchConfig": "parameters": "organism": "species" , "wdkWeight": 10 , "reportConfig": "attributes": [ group_string ], "tables": [] ')


khughitt/EuPathDB documentation built on Nov. 4, 2023, 4:19 a.m.