ropensci / rotl

Interface to Open Tree of Life API
https://docs.ropensci.org/rotl
Other
39 stars 18 forks source link

Feedback request: new interface for studies_find_studies and studies_find_trees #49

Closed fmichonneau closed 8 years ago

fmichonneau commented 8 years ago

I changed the output of the functions studies_find_studies and studies_find_trees. Previously, these functions would only return the OTL identifiers for the studies and or trees that matched the search criteria. It seemed to me that it would be good to have a little more context to these results, so users could know from which studies they are coming from instead of only getting identifiers back. Therefore I added the argument detailed to both functions (set to TRUE by default) that retrieve the metadata for the studies that match the search to get more context:

> studies_find_studies(property="ot:focalCladeOTTTaxonName", value="Drosophilia")

  study_ids n_trees candidate study_year
1   pg_2461       4                 1997
2   pg_1940       3  tree3943       2010
                                                                                 title
1 Multiple sources of character information and the phylogeny of Hawaiian Drosophilids
2                  A supermatrix-based molecular phylogeny of the family Drosophilidae
                                    study_doi
1   http://dx.doi.org/10.1093/sysbio/46.4.654
2 http://dx.doi.org/10.1017/S001667231000008X

> studies_find_trees(property="ot:ottTaxonName", value="Drosophilia")
  study_ids n_trees candidate study_year
1     ot_97       9                 2011
2   pg_1257       2                 2010
3   pg_1940       3  tree3943       2010
4   pg_2461       4                 1997
5   pg_2769       7                 2011
6   pg_2780       1                 2006
7   pg_2885       4  tree6690       2014
8    pg_309       4                 2007
9    pg_313       1  tree6681       2009
                                                                                                                                                              title
1 'Multigene phylogenetic analyses including diverse radiolarian species support the “Retaria” hypothesis — The sister relationship of Radiolaria and Foraminifera'
2                                                                                                     A phylogenomic approach to resolve the arthropod tree of life
3                                                                                               A supermatrix-based molecular phylogeny of the family Drosophilidae
4                                                                              Multiple sources of character information and the phylogeny of Hawaiian Drosophilids
5                                                                                        Wolbachia-mediated persistence of mtDNA from a potentially extinct species
6                                                                                           Phylogenetic Relationships of the Wolbachia of Nematodes and Arthropods
7                                                                        'The impact of RNA structure on coding sequence evolution in both bacteria and eukaryotes'
8                                                                                                          Testing Phylogenetic Congruence in Phylogenomic Analysis
9                                                                         Multigene evidence for the placement of a heterotrophic amoeboid lineage Leukarachnion sp
                                         study_doi n_matched_trees
1 http://dx.doi.org/10.1016/j.marmicro.2011.06.007               1
2          http://dx.doi.org/10.1093/molbev/msq130               2
3      http://dx.doi.org/10.1017/S001667231000008X               1
4        http://dx.doi.org/10.1093/sysbio/46.4.654               4
5                                                                7
6                                                                1
7        http://dx.doi.org/10.1186/1471-2148-14-87               1
8      http://dx.doi.org/10.1080/10635150801910436               1
9   http://dx.doi.org/10.1016/j.protis.2009.01.001               1
                                               tree_ids
1                                                 tree8
2                                    tree6548, tree6547
3                                              tree3943
4                tree6655, tree5289, tree5288, tree5287
5 tree6415, tree6414, tree6413, tree6412, tree6411, ...
6                                              tree6446
7                                              tree6691
8                                               tree256
9                                              tree6681

It's a little slow because we need to fetch the metadata for each study before returning the result, but it seems worth it.

@dwinter, @josephwb do you have any feedback on this?

dwinter commented 8 years ago

Hey @fmichonneau -- I think this is really good, especially as an option. That way the extra time and bigger returned object is not a problem for people wanting "just the IDs please".

josephwb commented 8 years ago

Looks awesome. :eyes:

fmichonneau commented 8 years ago

thanks for the feedback!