├── .gitignore
├── package.json
├── README.md
├── go.js
├── lib
└── go_gene_annotation.js
└── CODE_OF_CONDUCT.md
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | coverage
4 | *.log
5 | .coveralls.yml
6 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bionode-go",
3 | "version": "1.0.0",
4 | "description": "Bionode module for Gene Ontology",
5 | "main": "go.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/bionode/bionode-go.git"
12 | },
13 | "keywords": [
14 | "bio",
15 | "bioinformatics",
16 | "biology",
17 | "bionode",
18 | "gene",
19 | "ontology"
20 | ],
21 | "author": "Boris Adryan",
22 | "license": "MIT",
23 | "bugs": {
24 | "url": "https://github.com/bionode/bionode-go/issues"
25 | },
26 | "homepage": "https://github.com/bionode/bionode-go",
27 | "dependencies": {
28 | "mysql": "^2.5.4",
29 | "through2": "^0.6.3"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | bionode-go
2 | ==========
3 |
4 | Gene Ontology in Bionode
5 |
6 | Will provide access to the public MySQL services of the Gene Ontology.
7 |
8 | Have a look at go.js how to use go\_gene\_annotation.js to retrieve GO annotations for a particular gene. It's not much, but it's a start for your own explorations. All of GO can be queried via internet access to their MySQL server. Details and sample queries available here: http://amigo.geneontology.org/goose
9 |
10 |
11 | Note: Another quick and dirty way to associate GO terms to target genes is the use of InterMine via their npm module. Alex from FlyMine wrote on 11/12/2014: "Sorry about the lack of good doc links on the NPM page - our API docs
12 | are here: http://intermine.github.io/imjs/, and http://alexkalderimis.github.io/imjs/ (mine are sometimes
13 | a little ahead of intermine's). I will make sure that they are more
14 | discoverable in the future.
15 |
16 | We also have some documentation here:
17 | http://intermine.readthedocs.org/en/latest/web-services/#api-and-client-libraries
18 |
19 | With some examples here:
20 | http://intermine.readthedocs.org/en/latest/web-services/how-do-i/#howtows
21 |
22 | If there are some examples you want to see, just let us know, and we
23 | will add them to the how-do-I section."
24 |
25 | All best,
26 |
27 | Alex Kalderimis
28 |
--------------------------------------------------------------------------------
/go.js:
--------------------------------------------------------------------------------
1 | // demoes how GO annotation can be retrieved
2 |
3 | // load the relevant module
4 | var GOquery = require('./lib/go_gene_annotation.js')
5 |
6 | // initiate contact to GO MySQL server at EBI
7 | GOquery.start_session();
8 |
9 | // ask for a fly ("FB") gene
10 | GOquery.direct_annotation.write({
11 | geneID: 'FBgn0262139',
12 | dbName: 'FB'
13 | })
14 |
15 | // retrieve annotation
16 | GOquery.direct_annotation
17 | .on('data', console.log)
18 | .on('error', function (err) {
19 | return console.error('Something went wrong here: ', err)
20 | })
21 |
22 | // how to efficiently query for many genes
23 | // NOTE: this still needs implementing: collate a few genes before firing up a query with all
24 | // with parameters determined in maxBatchTimeout and maxBatchSize (go_gene_annotation.js)
25 | var seriesOfGenesfromFB = ['FBgn0262139','FBgn0003720','FBgn0001077','FBgn0000166','FBgn0003866','FBgn0011655','FBgn0024250','FBgn0001150','FBgn0004915','FBgn0040765','FBgn0003900','FBgn0000028','FBgn0000099']; // 14 genes
26 | var seriesofGenesDB = 'FB';
27 |
28 | for (i = 0; i < seriesOfGenesfromFB.length; i++) {
29 | GOquery.direct_annotation.write({
30 | geneID: seriesOfGenesfromFB[i],
31 | dbName: seriesofGenesDB
32 | })
33 | }
34 |
35 | GOquery.direct_annotation
36 | .on('data', console.log)
37 | .on('error', function (err) {
38 | return console.error('Something went wrong here: ', err)
39 | })
40 |
41 | // disconnect from the EBI database
42 | GOquery.end_session();
--------------------------------------------------------------------------------
/lib/go_gene_annotation.js:
--------------------------------------------------------------------------------
1 | var through = require('through2');
2 | var mysql = require('mysql');
3 | var connection = undefined;
4 | var maxBatchTimeout = 1000;
5 | var maxBatchSize = 20;
6 |
7 | var GO = exports
8 |
9 | // call this function to initiate a database connection with the public server at EBI
10 | // set different batch query options where needed.
11 | GO.start_session = function(fastOptions) {
12 | connection = mysql.createConnection({
13 | host : 'mysql.ebi.ac.uk',
14 | user : 'go_select',
15 | database : 'go_latest',
16 | password : 'amigo',
17 | port : 4085
18 | });
19 | connection.connect();
20 | }
21 |
22 | // call this function for good practice to formally end the database connection
23 | GO.end_session = function () {
24 | connection.end();
25 | }
26 |
27 | // call this function with a geneID and source DB for getting all direct gene annotations
28 | // http://amigo.geneontology.org/goose provides some more help until I get around to full doc
29 | GO.direct_annotation = through.obj(function transform(obj, enc, next) {
30 | var self = this;
31 | connection.query("SELECT gene_product.symbol, gene_product.full_name, dbxref.xref_dbname, dbxref.xref_key, species.genus, species.species, association.is_not, evidence.code, term.acc, term.name FROM gene_product INNER JOIN dbxref ON (gene_product.dbxref_id=dbxref.id) INNER JOIN species ON (gene_product.species_id=species.id) INNER JOIN association ON (gene_product.id=association.gene_product_id) INNER JOIN evidence ON (association.id=evidence.association_id) INNER JOIN term ON (association.term_id=term.id) WHERE dbxref.xref_key = '"+obj.geneID+"' AND dbxref.xref_dbname = '"+obj.dbName+"';", function(err, rows, fields) {
32 | if (err) return self.emit('error', err);
33 | rows.forEach(function(row) {
34 | self.push(row);
35 | //console.log('The solution is: ', rows[0]);
36 | });
37 | });
38 | next();
39 | })
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, gender identity and expression, level of experience,
9 | nationality, personal appearance, race, religion, or sexual identity and
10 | orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at mail@bionode.io. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at [http://contributor-covenant.org/version/1/4][version]
72 |
73 | [homepage]: http://contributor-covenant.org
74 | [version]: http://contributor-covenant.org/version/1/4/
75 |
--------------------------------------------------------------------------------