Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
fix to POST method and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Jan 15, 2018
1 parent 9b68e80 commit 0c16c5f
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description: The 'Microsoft Academic Knowledge' API provides programmatic access
(<https://academic.microsoft.com/>). Includes methods matching all 'Microsoft
Academic' API routes, including search, graph search, text similarity, and
interpret natural language query string.
Version: 0.1.9.9110
Version: 0.1.9.9119
Authors@R: person("Scott", "Chamberlain", email = "myrmecocystus+r@gmail.com",
role = c("aut", "cre"))
License: MIT + file LICENSE
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ma_HTTP <- function(path, args, key, method = "GET", body = list(),
`Ocp-Apim-Subscription-Key` = key
)
)
if (method == "POST") cli$headers$`Content-Type` <- "application/x-www-form-urlencoded"
#if (method == "POST") cli$headers$`Content-Type` <- "application/x-www-form-urlencoded"
if (!is.null(ctype)) cli$headers <- c(cli$headers, `Content-Type` = ctype)
res <- switch(
method,
Expand Down
5 changes: 3 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ma_evaluate(expr)
or go to evalulate directly

```{r}
ma_evaluate(query = "Ti='biology'...")
ma_evaluate(query = "Y='19'...")
```

## Calchistogram
Expand All @@ -81,7 +81,8 @@ ma_similarity(s1, s2)
## Abstract

```{r}
ma_abstract(query = "Ti='biology'...", count = 3)
res <- ma_abstract(query = "Y='19'...", count = 5)
Filter(nzchar, res)
```

## Graph search
Expand Down
99 changes: 49 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
microdemic
==========



[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](http://www.repostatus.org/badges/latest/wip.svg)](http://www.repostatus.org/#wip)
[![Build Status](https://travis-ci.org/ropenscilabs/microdemic.svg?branch=master)](https://travis-ci.org/ropenscilabs/microdemic)
[![codecov](https://codecov.io/gh/ropenscilabs/microdemic/branch/master/graph/badge.svg)](https://codecov.io/gh/ropenscilabs/microdemic)
Expand Down Expand Up @@ -39,7 +41,7 @@ library("microdemic")
```r
res <- ma_interpret(query = "papers by jaime'...")
(expr <- res$interpretations$rules[[1]]$output.value)
#> [1] "Composite(AA.AuN=='j p gomez')"
#> [1] "Composite(AA.AuN=='j simpson')"
```

## Evaluate
Expand All @@ -48,42 +50,38 @@ res <- ma_interpret(query = "papers by jaime'...")
```r
ma_evaluate(expr)
#> # A tibble: 10 x 8
#> logprob Id
#> * <dbl> <dbl>
#> 1 -15.040 2167727518
#> 2 -17.552 2079479731
#> 3 -17.726 2145474863
#> 4 -17.877 1957266799
#> 5 -17.904 2274423721
#> 6 -17.933 2152231764
#> 7 -17.983 2135463293
#> 8 -18.025 1529468456
#> 9 -18.247 2110555172
#> 10 -18.261 2139967537
#> # ... with 6 more variables: E <chr>, Ti <chr>, Y <int>, CC <int>,
#> # AA <list>, J.JN <chr>
#> logprob Id Ti Y CC AA E J.JN
#> * <dbl> <dbl> <chr> <int> <int> <lis> <chr> <chr>
#> 1 -14.9 2337454357 inten… 1998 13261 <dat… "{\"DN\":\"Intensive… lanc…
#> 2 -17.8 2122159856 agata… 2012 139 <dat… "{\"DN\":\"AGATA - A… nucl…
#> 3 -18.0 2567424265 regre… 2016 79 <dat… "{\"DN\":\"Regressio… n en…
#> 4 -18.2 2018655931 effec… 1995 812 <dat… "{\"DN\":\"Effect of… j bi…
#> 5 -18.3 1507854122 the u… 2002 413 <dat… "{\"DN\":\"The use o… clin…
#> 6 -18.6 2066093376 inter… 2008 205 <dat… "{\"DN\":\"Interpret… brit…
#> 7 -18.7 2035651919 diffe… 2005 243 <dat… "{\"DN\":\"Different… biom…
#> 8 -18.8 2049816406 surfa… 1996 457 <dat… "{\"DN\":\"Surface r… j bi…
#> 9 -18.9 2038399305 from … 2008 65 <dat… "{\"DN\":\"From Ge(L… prog…
#> 10 -19.0 2165320653 a pha… 2006 248 <dat… "{\"DN\":\"A Phase I… clin…
```

or go to evalulate directly


```r
ma_evaluate(query = "Ti='biology'...")
ma_evaluate(query = "Y='19'...")
#> # A tibble: 10 x 8
#> logprob Id
#> * <dbl> <int>
#> 1 -16.734 2084948079
#> 2 -17.236 2101214437
#> 3 -17.297 2081930221
#> 4 -17.428 2081365151
#> 5 -17.455 2099299146
#> 6 -17.481 279337373
#> 7 -17.571 1857453373
#> 8 -17.588 2141869972
#> 9 -17.627 2046020682
#> 10 -17.637 2133469996
#> # ... with 6 more variables: E <chr>, Ti <chr>, Y <int>, CC <int>,
#> # AA <list>, J.JN <chr>
#> logprob Id Ti Y CC AA E J.JN
#> * <dbl> <dbl> <chr> <int> <int> <lis> <chr> <chr>
#> 1 -13.1 2144634347 molec… 1989 125571 <dat… "{\"DN\":\"Molecula… <NA>
#> 2 -13.6 2596886333 diagn… 1994 88682 <dat… "{\"DN\":\"Diagnost… <NA>
#> 3 -13.8 2339804494 fuzzy… 1996 36075 <dat… "{\"DN\":\"Fuzzy se… <NA>
#> 4 -13.8 2156909104 the n… 1995 27342 <dat… "{\"DN\":\"The natu… tech…
#> 5 -13.9 2158714788 gappe… 1997 52865 <dat… "{\"DN\":\"Gapped B… nar
#> 6 -13.9 1856219842 stand… 1992 56992 <dat… "{\"DN\":\"Standard… <NA>
#> 7 -14.1 2132905138 crc h… 1990 37155 <dat… "{\"DN\":\"CRC Hand… <NA>
#> 8 -14.2 2623205651 quant… 1993 15172 <dat… "{\"DN\":\"Quantum … <NA>
#> 9 -14.2 2152195021 parti… 1995 26464 <dat… "{\"DN\":\"Particle… <NA>
#> 10 -14.2 2148603752 stati… 1998 18218 <dat… "{\"DN\":\"Statisti… <NA>
```

## Calchistogram
Expand All @@ -95,24 +93,24 @@ res <- ma_calchist(query = "And(Composite(AA.AuN=='jaime teevan'),Y>2012)",
res$histograms$histogram
#> [[1]]
#> value logprob count
#> 1 2013 -17.058 18
#> 2 2014 -17.287 13
#> 3 2016 -17.861 16
#> 4 2015 -17.924 13
#> 5 2017 -18.591 9
#> 1 2013 -17.060 19
#> 2 2014 -17.273 13
#> 3 2016 -17.918 16
#> 4 2015 -17.998 13
#> 5 2017 -18.562 11
#>
#> [[2]]
#> value logprob count
#> 1 computer science -16.468 43
#> 2 world wide web -16.517 33
#> 3 data mining -16.668 28
#> 4 simulation -17.232 20
#> 5 multimedia -17.303 22
#> 6 crowdsourcing -17.404 16
#> 7 information retrieval -17.443 11
#> 8 internet privacy -17.729 7
#> 9 search engine -17.937 7
#> 10 machine learning -18.014 6
#> value logprob count
#> 1 computer science -16.172 56
#> 2 data mining -16.833 25
#> 3 search engine -17.220 13
#> 4 crowdsourcing -17.299 19
#> 5 information retrieval -17.326 14
#> 6 crowd -17.416 16
#> 7 human computer interaction -17.639 18
#> 8 multimedia -17.783 13
#> 9 world wide web -18.070 5
#> 10 search analytics -18.072 5
```

## Similarity
Expand All @@ -133,10 +131,11 @@ ma_similarity(s1, s2)


```r
ma_abstract(query = "Ti='biology'...", count = 3)
#> [1] "This review focuses on the mechanisms regulating the synthesis, secretion, biological actions, and therapeutic relevance of the incretin peptides glucose-dependent insulinotropic polypeptide (GIP) and glucagon-like peptide-1 (GLP-1). The published literature was reviewed, with emphasis on recent advances in our understanding of the biology of GIP and GLP-1. GIP and GLP-1 are both secreted within minutes of nutrient ingestion and facilitate the rapid disposal of ingested nutrients. Both peptides share common actions on islet β-cells acting through structurally distinct yet related receptors. Incretin-receptor activation leads to glucose-dependent insulin secretion, induction of β-cell proliferation, and enhanced resistance to apoptosis. GIP also promotes energy storage via direct actions on adipose tissue, and enhances bone formation via stimulation of osteoblast proliferation and inhibition of apoptosis. In contrast, GLP-1 exerts glucoregulatory actions via slowing of gastric emptying and glucose-dependent inhibition of glucagon secretion. GLP-1 also promotes satiety and sustained GLP-1–receptor activation is associated with weight loss in both preclinical and clinical studies. The rapid degradation of both GIP and GLP-1 by the enzyme dipeptidyl peptidase-4 has led to the development of degradation-resistant GLP-1–receptor agonists and dipeptidyl peptidase-4 inhibitors for the treatment of type 2 diabetes. These agents decrease hemoglobin A1c (HbA1c) safely without weight gain in subjects with type 2 diabetes. GLP-1 and GIP integrate nutrient-derived signals to control food intake, energy absorption, and assimilation. Recently approved therapeutic agents based on potentiation of incretin action provide new physiologically based approaches for the treatment of type 2 diabetes."
#> [2] "Once a poorly defined pathologic oddity, in recent years, gastrointestinal stromal tumor (GIST) has emerged as a distinct oncogenetic entity that is now center stage in clinical trials of kinase-targeted therapies. This review charts the rapid progress that has established GIST as a model for understanding the role of oncogenic kinase mutations in human tumorigenesis. Approximately 80% to 85% of GISTs harbor activating mutations of the KIT tyrosine kinase. In a series of 322 GISTs (including 140 previously published cases) studied by the authors in detail, mutations in the KIT gene occurred with decreasing frequency in exons 11 (66.1%), 9 (13%), 13 (1.2%), and 17 (0.6%). In the same series, a subset of tumors had mutations in the KIT-related kinase gene PDGF receptor alpha (PDGFRA), which occurred in either exon 18 (5.6%) or 12 (1.5%). The remainder of GISTs (12%) were wild type for both KIT and PDGFRA. Comparative studies of KIT-mutant, PDGFRA-mutant, and wild-type GISTs indicate that there are many simi..."
#> [3] "As they grapple with increasingly large data sets, biologists and computer scientists uncork new bottlenecks."
res <- ma_abstract(query = "Y='19'...", count = 5)
Filter(nzchar, res)
#> [1] "Molecular Cloning has served as the foundation of technical expertise in labs worldwide for 30 years. No other manual has been so popular, or so influential. Molecular Cloning, Fourth Edition, by the celebrated founding author Joe Sambrook and new co-author, the distinguished HHMI investigator Michael Green, preserves the highly praised detail and clarity of previous editions and includes specific chapters and protocols commissioned for the book from expert practitioners at Yale, U Mass, Rockefeller University, Texas Tech, Cold Spring Harbor Laboratory, Washington University, and other leading institutions. The theoretical and historical underpinnings of techniques are prominent features of the presentation throughout, information that does much to help trouble-shoot experimental problems. For the fourth edition of this classic work, the content has been entirely recast to include nucleic-acid based methods selected as the most widely used and valuable in molecular and cellular biology laboratories. Core chapters from the third edition have been revised to feature current strategies and approaches to the preparation and cloning of nucleic acids, gene transfer, and expression analysis. They are augmented by 12 new chapters which show how DNA, RNA, and proteins should be prepared, evaluated, and manipulated, and how data generation and analysis can be handled. The new content includes methods for studying interactions between cellular components, such as microarrays, next-generation sequencing technologies, RNA interference, and epigenetic analysis using DNA methylation techniques and chromatin immunoprecipitation. To make sense of the wealth of data produced by these techniques, a bioinformatics chapter describes the use of analytical tools for comparing sequences of genes and proteins and identifying common expression patterns among sets of genes. Building on thirty years of trust, reliability, and authority, the fourth edition of Mol"
#> [2] "Setting of the learning problem consistency of learning processes bounds on the rate of convergence of learning processes controlling the generalization ability of learning processes constructing learning algorithms what is important in learning theory?."
#> [3] "The BLAST programs are widely used tools for searching protein and DNA databases for sequence similarities. For protein comparisons, a variety of definitional, algorithmic and statistical refinements described here permits the execution time of the BLAST programs to be decreased substantially while enhancing their sensitivity to weak similarities. A new criterion for triggering the extension of word hits, combined with a new heuristic for generating gapped alignments, yields a gapped BLAST program that runs at approximately three times the speed of the original. In addition, a method is introduced for automatically combining statistically significant alignments produced by BLAST into a position-specific score matrix, and searching the database using this matrix. The resulting Position-Specific Iterated BLAST (PSIBLAST) program runs at approximately the same speed per iteration as gapped BLAST, but in many cases is much more sensitive to weak but biologically relevant sequence similarities. PSI-BLAST is used to uncover several new and interesting members of the BRCT superfamily."
```

## Graph search
Expand Down

0 comments on commit 0c16c5f

Please sign in to comment.