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

Commit 0c16c5f

Browse files
committed
fix to POST method and update readme
1 parent 9b68e80 commit 0c16c5f

File tree

4 files changed

+54
-54
lines changed

4 files changed

+54
-54
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Description: The 'Microsoft Academic Knowledge' API provides programmatic access
66
(<https://academic.microsoft.com/>). Includes methods matching all 'Microsoft
77
Academic' API routes, including search, graph search, text similarity, and
88
interpret natural language query string.
9-
Version: 0.1.9.9110
9+
Version: 0.1.9.9119
1010
Authors@R: person("Scott", "Chamberlain", email = "myrmecocystus+r@gmail.com",
1111
role = c("aut", "cre"))
1212
License: MIT + file LICENSE

R/zzz.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ma_HTTP <- function(path, args, key, method = "GET", body = list(),
1111
`Ocp-Apim-Subscription-Key` = key
1212
)
1313
)
14-
if (method == "POST") cli$headers$`Content-Type` <- "application/x-www-form-urlencoded"
14+
#if (method == "POST") cli$headers$`Content-Type` <- "application/x-www-form-urlencoded"
1515
if (!is.null(ctype)) cli$headers <- c(cli$headers, `Content-Type` = ctype)
1616
res <- switch(
1717
method,

README.Rmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ma_evaluate(expr)
5555
or go to evalulate directly
5656

5757
```{r}
58-
ma_evaluate(query = "Ti='biology'...")
58+
ma_evaluate(query = "Y='19'...")
5959
```
6060

6161
## Calchistogram
@@ -81,7 +81,8 @@ ma_similarity(s1, s2)
8181
## Abstract
8282

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

8788
## Graph search

README.md

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
microdemic
22
==========
33

4+
5+
46
[![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)
57
[![Build Status](https://travis-ci.org/ropenscilabs/microdemic.svg?branch=master)](https://travis-ci.org/ropenscilabs/microdemic)
68
[![codecov](https://codecov.io/gh/ropenscilabs/microdemic/branch/master/graph/badge.svg)](https://codecov.io/gh/ropenscilabs/microdemic)
@@ -39,7 +41,7 @@ library("microdemic")
3941
```r
4042
res <- ma_interpret(query = "papers by jaime'...")
4143
(expr <- res$interpretations$rules[[1]]$output.value)
42-
#> [1] "Composite(AA.AuN=='j p gomez')"
44+
#> [1] "Composite(AA.AuN=='j simpson')"
4345
```
4446

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

6767
or go to evalulate directly
6868

6969

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

8987
## Calchistogram
@@ -95,24 +93,24 @@ res <- ma_calchist(query = "And(Composite(AA.AuN=='jaime teevan'),Y>2012)",
9593
res$histograms$histogram
9694
#> [[1]]
9795
#> value logprob count
98-
#> 1 2013 -17.058 18
99-
#> 2 2014 -17.287 13
100-
#> 3 2016 -17.861 16
101-
#> 4 2015 -17.924 13
102-
#> 5 2017 -18.591 9
96+
#> 1 2013 -17.060 19
97+
#> 2 2014 -17.273 13
98+
#> 3 2016 -17.918 16
99+
#> 4 2015 -17.998 13
100+
#> 5 2017 -18.562 11
103101
#>
104102
#> [[2]]
105-
#> value logprob count
106-
#> 1 computer science -16.468 43
107-
#> 2 world wide web -16.517 33
108-
#> 3 data mining -16.668 28
109-
#> 4 simulation -17.232 20
110-
#> 5 multimedia -17.303 22
111-
#> 6 crowdsourcing -17.404 16
112-
#> 7 information retrieval -17.443 11
113-
#> 8 internet privacy -17.729 7
114-
#> 9 search engine -17.937 7
115-
#> 10 machine learning -18.014 6
103+
#> value logprob count
104+
#> 1 computer science -16.172 56
105+
#> 2 data mining -16.833 25
106+
#> 3 search engine -17.220 13
107+
#> 4 crowdsourcing -17.299 19
108+
#> 5 information retrieval -17.326 14
109+
#> 6 crowd -17.416 16
110+
#> 7 human computer interaction -17.639 18
111+
#> 8 multimedia -17.783 13
112+
#> 9 world wide web -18.070 5
113+
#> 10 search analytics -18.072 5
116114
```
117115

118116
## Similarity
@@ -133,10 +131,11 @@ ma_similarity(s1, s2)
133131

134132

135133
```r
136-
ma_abstract(query = "Ti='biology'...", count = 3)
137-
#> [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."
138-
#> [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..."
139-
#> [3] "As they grapple with increasingly large data sets, biologists and computer scientists uncork new bottlenecks."
134+
res <- ma_abstract(query = "Y='19'...", count = 5)
135+
Filter(nzchar, res)
136+
#> [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"
137+
#> [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?."
138+
#> [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."
140139
```
141140

142141
## Graph search

0 commit comments

Comments
 (0)