Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage multiple annotation versions #46

Merged
merged 41 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9846c4f
Test add annotation name
mboudet Oct 5, 2023
112f75a
Merge branch 'dev_version' of github.com:mboudet/genenotebook into de…
mboudet Oct 5, 2023
977863e
Fix index maybe
mboudet Oct 5, 2023
5f50090
Test
mboudet Oct 5, 2023
f48daff
fix test
mboudet Oct 9, 2023
8beb9c6
Test UI
mboudet Oct 10, 2023
0becbda
Fix ui
mboudet Oct 10, 2023
efa2da0
Some more stuff
mboudet Oct 11, 2023
454a4a0
fixing ui
mboudet Oct 11, 2023
fcaeca9
Test check gene in pairwise parser
mboudet Oct 11, 2023
943565f
fix tests
mboudet Oct 11, 2023
16d10ad
add proper redirect to gene with annotation
mboudet Oct 11, 2023
b562bea
Fix interpro import + add warnings
mboudet Oct 11, 2023
65ad83e
Actually add annot in methods
mboudet Oct 12, 2023
322dc94
fix protein display
mboudet Oct 13, 2023
393eebe
Add some tests & change default attributes
mboudet Oct 13, 2023
d4c2a30
actually fix tests
mboudet Oct 13, 2023
947d12b
Index more stuff
mboudet Oct 13, 2023
6efabdb
Add annot name to UI
mboudet Oct 13, 2023
0c0b564
fixes
mboudet Oct 13, 2023
a461e52
Test gene selection
mboudet Oct 16, 2023
c82c2e8
fix ui
mboudet Oct 16, 2023
f32d427
Test annotation selector in UI
mboudet Oct 16, 2023
e3932ed
Merge branch 'dev_version' of github.com:mboudet/genenotebook into de…
mboudet Oct 16, 2023
3e3407e
ui
mboudet Oct 16, 2023
468afd2
Add annot to transcriptome
mboudet Oct 17, 2023
0e3b060
Fix tests
mboudet Oct 17, 2023
311557c
Fix
mboudet Oct 18, 2023
afb87dc
Merge branch 'dev_version' of github.com:mboudet/genenotebook into de…
mboudet Oct 18, 2023
7c18735
fix expression ui
mboudet Oct 18, 2023
16545e6
Add annotationName to experiment document to pre-filter in geneList
mboudet Oct 18, 2023
359a803
Merge branch 'dev_version' of github.com:mboudet/genenotebook into de…
mboudet Oct 18, 2023
47003c8
fix test & ui
mboudet Oct 18, 2023
395dc19
Add character to decode and decoding before annot funct
mboudet Oct 19, 2023
54cc6e2
Fix tests
mboudet Oct 19, 2023
36f0590
Orthogroups and changelog
mboudet Oct 19, 2023
e4a29e1
Merge branch 'dev_version' of github.com:mboudet/genenotebook into de…
mboudet Oct 19, 2023
a9c4235
fix test
mboudet Oct 20, 2023
cb8bf07
Fix UI
mboudet Oct 20, 2023
5dea2a5
Prepare release
mboudet Oct 20, 2023
cb046a2
update package-lock.json
mboudet Oct 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)

## [0.4.8] Unreleased
## [0.4.8] 2023-10-20

### Added

Expand All @@ -18,6 +18,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- 'query_param' : optional get parameter to use for the query
- 'field_param': optional get parameter to use to restrict the results to the gene_field value
- 'count_param': optional get parameter to restrict the number of results
- Multiple annotations for the same genome
- When adding an annotation, you must now set the '--annot' to set the annotation name.
- When integrating data afterward, you can use the --annot tag to specify the annotation you are aiming for.
- If you have multiple genes with the same ID, and do not specify '--annot', the results may be variables
- You can specify --annotations multiple time when integrating orthogroups
- Will now decode proteins and genes IDs when integrating data. (It was already done when integrating gffs, so there was some mismatch with IDs)

## Changed

- Various UI fixes to better fit multiple annotation versions
- Including an 'annotation' selector in the gene list

## [0.4.7] 2023-09-26

Expand Down
67 changes: 58 additions & 9 deletions cli/genoboo.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,14 @@ addAnnotation
.arguments('<file>')
.option('-u, --username <username>', 'GeneNoteBook admin username')
.option('-p, --password <password>', 'GeneNoteBook admin password')
.option(
.requiredOption(
'-n, --name <genome-name>',
'Reference genome name to which the annotation should be added.',
)
.requiredOption(
'--annot <annotation-name>',
'Annotation name',
)
.option(
'-r, --re_protein <pattern>',
'Replacement string for the protein name using capturing groups defined by --re_protein_capture. Make sure to use JS-style groups ($1 for group 1)',
Expand Down Expand Up @@ -352,6 +356,7 @@ addAnnotation
password,
port = 3000,
name,
annot,
re_protein,
re_protein_capture,
attr_protein,
Expand Down Expand Up @@ -389,6 +394,7 @@ addAnnotation
{
fileName,
genomeName: name,
annotationName: annot,
re_protein,
re_protein_capture: correctProteinCapture,
attr_protein,
Expand Down Expand Up @@ -433,6 +439,10 @@ running GeneNoteBook server.`
'--port [port]',
'Port on which GeneNoteBook is running. Default: 3000'
)
.option(
'--annot <annotation-ame>',
'Annotation name',
)
.option(
'-fmt, --format [parser]',
`Choose a parser for the diamond output format. Parses .xml, .txt
Expand All @@ -455,7 +465,7 @@ running GeneNoteBook server.`
.action(
(
file,
{ username, password, port = 3000, format, algorithm, matrix, database }
{ username, password, port = 3000, annot, format, algorithm, matrix, database }
) => {
if (typeof file !== 'string') addDiamond.help();

Expand Down Expand Up @@ -490,6 +500,7 @@ file extension is not "xml", "txt"`);
fileName,
parser: parserType,
program: 'diamond',
annot: annot,
algorithm: algorithm,
matrix: matrix,
database: database,
Expand All @@ -502,7 +513,7 @@ file extension is not "xml", "txt"`);
Example:
genenotebook add diamond mmucedo.xml -u admin -p admin
or
genenotebook add diamond mmucedo.txt --format txt --program blastp --matrix BLOSUM90 -db "Non-reundant protein sequences (nr)" -u admin -p admin
genenotebook add diamond mmucedo.txt --format txt --matrix BLOSUM90 -db "Non-reundant protein sequences (nr)" -u admin -p admin
`);
})
.exitOverride(customExitOverride(addDiamond));
Expand All @@ -525,6 +536,10 @@ running GeneNoteBook server.`
'-p, --password <adminPassword>',
'GeneNoteBook admin password'
)
.option(
'--annot <annotation-ame>',
'Annotation name',
)
.option(
'--port [port]',
'Port on which GeneNoteBook is running. Default: 3000'
Expand All @@ -548,7 +563,7 @@ running GeneNoteBook server.`
.action(
(
file,
{ username, password, port = 3000, format, algorithm, matrix, database }
{ username, password, port = 3000, annot, format, algorithm, matrix, database }
) => {
if (typeof file !== 'string') addBlast.help();

Expand Down Expand Up @@ -584,6 +599,7 @@ file extension is not "xml", "txt"`);
parser: parserType,
program: 'blast',
algorithm: algorithm,
annot: annot,
matrix: matrix,
database: database,
}
Expand Down Expand Up @@ -619,6 +635,10 @@ addExpression
'-d, --sample-description <description>',
'Description of the experiment'
)
.option(
'--annot <annotation-ame>',
'Annotation name',
)
.option(
'-r, --replicas <replicas...>',
'Comma-separated column positions, which are part of the same replica group. Can be set multiple times for multiple groups. The replica group name will be the first column, unless replica-names is set'
Expand All @@ -639,7 +659,7 @@ addExpression
const replicas = opts.replicas || [];
const replicaNames = opts.replicaNames || [];
const isPublic = opts.public;

const annot = opts.annot
if (!(fileName && username && password)) {
program.help();
}
Expand All @@ -648,6 +668,7 @@ addExpression
{
fileName,
description,
annot,
replicas,
replicaNames,
isPublic
Expand Down Expand Up @@ -680,6 +701,10 @@ addExpression
'-d, --sample-description <description>',
'Description of the experiment'
)
.option(
'--annot <annotation-ame>',
'Annotation name',
)
.option(
'--public',
'Set the generated replica groups as public. Default: false',
Expand All @@ -692,6 +717,7 @@ addExpression
const replicaGroup = opts.replicaGroup || fileName;
const description = opts.sampleDescription || 'description';
const isPublic = opts.public
const anot = opts.annot

if (!(fileName && username && password)) {
program.help();
Expand All @@ -701,6 +727,7 @@ addExpression
{
fileName,
sampleName,
annot: annot,
replicaGroup,
description,
isPublic
Expand Down Expand Up @@ -728,12 +755,16 @@ addInterproscan
'--port [port]',
'Port on which GeneNoteBook is running. Default: 3000'
)
.option(
'--annot <annotation-ame>',
'Annotation name',
)
.option(
'--format [parser]',
`Choose a parser for the interproscan output files. Parses .gff3 and .tsv
extensions.`
)
.action((file, { username, password, port = 3000, format }) => {
.action((file, { username, password, port = 3000, format, annot }) => {
if (typeof file !== 'string') addInterproscan.help();

const fileName = path.resolve(file);
Expand Down Expand Up @@ -766,6 +797,7 @@ file extension is not "tsv", "gff3" or "xml".`);
{
fileName,
parser: parserType,
annot: annot
}
);
})
Expand Down Expand Up @@ -794,11 +826,15 @@ addEggnog
'-p, --password <adminPassword>',
'GeneNoteBook admin password'
)
.option(
'--annot <annotation-ame>',
'Annotation name',
)
.option(
'--port [port]',
'Port on which GeneNoteBook is running. Default: 3000'
)
.action((file, { username, password, port = 3000 }) => {
.action((file, { username, password, port = 3000, annot }) => {
if (typeof file !== 'string') addEggnog.help();

const fileName = path.resolve(file);
Expand All @@ -808,6 +844,7 @@ addEggnog

new GeneNoteBookConnection({ username, password, port }).call('addEggnog', {
fileName,
annot: annot
});
})
.on('--help', () => {
Expand All @@ -833,11 +870,15 @@ addHectar
'-p, --password <adminPassword>',
'GeneNoteBook admin password'
)
.option(
'--annot <annotation-ame>',
'Annotation name',
)
.option(
'--port [port]',
'Port on which GeneNoteBook is running. Default: 3000'
)
.action((file, { username, password, port = 3000 }) => {
.action((file, { username, password, port = 3000, annot }) => {
if (typeof file !== 'string') addHectar.help();

const fileName = path.resolve(file);
Expand All @@ -847,6 +888,7 @@ addHectar

new GeneNoteBookConnection({ username, password, port }).call('addHectar', {
fileName,
annot: annot
});
})
.on('--help', () => {
Expand Down Expand Up @@ -878,17 +920,23 @@ addOrthogroups
'-f, --force [force]',
'Ignore the use of prefixes.',
)
.option(
'-a, --annotations <annotations...>',
'Name of the annotation to use for gene matching. Can be set multiple times'
)
.requiredOption('-u, --username <username>', 'GeneNoteBook admin username')
.requiredOption('-p, --password <password>', 'GeneNoteBook admin password')
.option(
'--port [port]',
'Port on which GeneNoteBook is running. Default: 3000'
)
.action((file, { prefixe, list, force, username, password, port = 3000 }) => {
.action((file, { prefixe, list, force, annotations, username, password, port = 3000 }) => {
if (typeof file !== 'string') addOrthogroups.help();
const folderName = path.resolve(file);
const prefixes = (typeof list !== 'undefined' ? list : path.resolve(prefixe));

annotations = annotations || []

if (!(folderName && username && password)) {
addOrthogroups.help();
}
Expand All @@ -899,6 +947,7 @@ addOrthogroups
folderName,
force,
prefixes,
annotations
},
);
})
Expand Down
1 change: 0 additions & 1 deletion imports/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import './genomes/removeGenome.js';
import './genomes/annotation/removeAnnotationTrack.js';
import './genomes/annotation/addAnnotation.js';

import './genes/interproscan.js';
import './genes/addInterproscan.js';
import './genes/eggnog/addEggnog.js';
import './genes/hectar/addHectar.js';
Expand Down
20 changes: 14 additions & 6 deletions imports/api/genes/addInterproscan.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ import { Meteor } from 'meteor/meteor';
* @method finalize
*/
class InterproscanProcessor {
constructor() {
constructor(annot) {
this.bulkOp = interproscanCollection.rawCollection().initializeUnorderedBulkOp();
this.geneBulkOp = Genes.rawCollection().initializeUnorderedBulkOp();
this.currentProt = ""
this.currentGene = ""
this.currentContent = []
this.currentDB = []
this.currentOnto = []
this.currentOnto = [],
this.currentAnnotationName = "",
this.annot = annot
}

finalize = () => {
Expand All @@ -31,7 +33,7 @@ class InterproscanProcessor {
if (this.bulkOp.length > 0){
return this.bulkOp.execute();
}
return { nMatched: 0 }
return { nUpserted: 0 }
}

updateGenes = () => {
Expand All @@ -47,11 +49,13 @@ class InterproscanProcessor {
this.bulkOp.find({
gene_id: this.currentGene,
protein_id: this.currentProt,
annotationName: this.currentAnnotationName
}).upsert().update(
{
$set: {
gene_id: this.currentGene,
protein_id: this.currentProt,
annotationName: this.currentAnnotationName,
protein_domains: this.currentContent
},
},
Expand All @@ -63,7 +67,7 @@ class InterproscanProcessor {
}

if (this.currentDB != [] || this.currentOnto != []){
this.geneBulkOp.find({ID: this.currentGene}).update({
this.geneBulkOp.find({ID: this.currentGene, annotationName: this.currentAnnotationName}).update({
$addToSet: {
'attributes.Ontology_term': { $each: this.currentOnto },
'attributes.Dbxref': { $each: this.currentDB }
Expand All @@ -80,6 +84,10 @@ const addInterproscan = new ValidatedMethod({
name: 'addInterproscan',
validate: new SimpleSchema({
fileName: { type: String },
annot: {
type: String,
optional: true,
},
parser: {
type: String,
allowedValues: ['tsv', 'gff3'],
Expand All @@ -88,15 +96,15 @@ const addInterproscan = new ValidatedMethod({
applyOptions: {
noRetry: true,
},
run({ fileName, parser }) {
run({ fileName, annot, parser }) {
if (!this.userId) {
throw new Meteor.Error('not-authorized');
}
if (!Roles.userIsInRole(this.userId, 'admin')) {
throw new Meteor.Error('not-authorized');
}

const job = new Job(jobQueue, 'addInterproscan', { fileName, parser });
const job = new Job(jobQueue, 'addInterproscan', { fileName, annot, parser });
const jobId = job.priority('high').save();

// Continue with synchronous processing
Expand Down
Loading