<commit_before># embl-ebi-rest

Client for EMBL-EBI REST Web Services.

(Prototype) early alpha api for:

* Dbfetch : get an entry or a set of entries by the entry identifier from a database,
			specifying the required data format and result style.
* (more to be added here)

## Getting Started
Install the module with: `npm install embl-ebi-rest`

```javascript
/* 
 * Start requiring the Dbfetch constructor
 */
var Dbfetch = require('embl-ebi-rest').Dbfetch;

/*
 * Create a Dbfetch instance with a parameters object to query
 */
var wap_rat = new Dbfetch({ db: 'uniprotkb',
							id:'WAP_RAT',
							format: 'fasta',
							style: 'raw' });

/* 
  The request in handled asynchronously.
  When the requested entry is fully received
  Dbfetch instances emit a 'stored' event and  
  store the fetched entry in a <instance>.entity property
  Add a listener for 'stored' event to instance 
  with a function to access and handle the entry at <instance>.entity 
 */
wap_rat.on('stored', function() { console.log(wap_rat.entity) });

/*
 * Execute the query
 */
wap_rat.get(); 


/* 
 * Dbfetch also handles multiple id/accession queries
 */
var multiple_entries = new Dbfetch({ db: 'embl',
									 id: 'M10051, K00650, D87894, AJ242600',
									 format: 'fasta',
									 style: 'raw' });
									 
multiple_entries.on('stored', function() { console.log(multiple_entries.entity) });
multiple_entries.get();

```

#### WSDbfetch
http://www.ebi.ac.uk/Tools/webservices/services/dbfetch_rest

#### Databases<commit_msg>add info in readme<commit_after># embl-ebi-rest

Client for EMBL-EBI REST Web Services.

(Prototype) early alpha api for:

* Dbfetch : get an entry or a set of entries by the entry identifier from a database,
			specifying the required data format and result style.
* (more to be added here)

## Getting Started
Install the module with: `npm install embl-ebi-rest`

```javascript
/* 
 * Start requiring the Dbfetch constructor
 */
var Dbfetch = require('embl-ebi-rest').Dbfetch;

/*
 * Create a Dbfetch instance with a parameters object to query
 */
var wap_rat = new Dbfetch({ db: 'uniprotkb',
							id:'WAP_RAT',
							format: 'fasta',
							style: 'raw' });

/* 
  Dfetch is asynchronous.
  When the entry is fully fetched it is assigned to the instance's .entity property,
  and Dbfetch instances emit the 'stored' event. Listen for it and pass in the callback 
  function to access and handle the entry data.
 */
wap_rat.on('stored', function() { console.log(wap_rat.entity) });

/*
 * Execute the query
 */
wap_rat.get(); 


/* 
 * Dbfetch also handles multiple id/accession queries
 */
var multiple_entries = new Dbfetch({ db: 'embl',
									 id: 'M10051, K00650, D87894, AJ242600',
									 format: 'fasta',
									 style: 'raw' });
									 
multiple_entries.on('stored', function() { console.log(multiple_entries.entity) });
multiple_entries.get();

```

#### WSDbfetch
http://www.ebi.ac.uk/Tools/webservices/services/dbfetch_rest

#### Databases
{'fraction_non_alphanumeric': 0.11743057878889261, 'fraction_numerical': 0.01405152224824356, 'mean_word_length': 3.462686567164179, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '272604', 'n_tokens_mistral': 1107, 'n_tokens_neox': 943, 'n_words': 320}