Skip to content

Commit

Permalink
Added SRA (and SRP* accessions) as a possible data source.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Dec 18, 2023
1 parent 12171f1 commit 4a5d0d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion schemas/bioconductor.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"provider": {
"type": "string",
"description": "Name of the data provider.",
"enum": [ "GEO", "ArrayExpress", "PubMed", "DOI", "other" ]
"enum": [ "GEO", "SRA", "ArrayExpress", "PubMed", "DOI", "other" ]
},
"id": {
"type": "string",
Expand All @@ -79,6 +79,10 @@
"if": { "properties": { "provider": { "const": "GEO" } } },
"then": { "properties": { "id": { "type": "string", "pattern": "^GSE[0-9]+$" } } }
},
{
"if": { "properties": { "provider": { "const": "SRA" } } },
"then": { "properties": { "id": { "type": "string", "pattern": "^SRP[0-9]+$" } } }
},
{
"if": { "properties": { "provider": { "const": "ArrayExpress" } } },
"then": { "properties": { "id": { "type": "string", "pattern": "^E-MTAB-[0-9]+$" } } }
Expand Down
3 changes: 3 additions & 0 deletions tests/schemas/bioconductor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test("Bioconductor schema behaves as expected", () => {
genome: [ "GRCm38" ],
sources: [
{ provider: "GEO", id: "GSE12345" },
{ provider: "SRA", id: "SRP12345" },
{ provider: "ArrayExpress", id: "E-MTAB-12345" },
{ provider: "PubMed", id: "12332423" },
{ provider: "DOI", id: "123.13/231.23" },
Expand Down Expand Up @@ -86,6 +87,8 @@ test("Bioconductor schema behaves as expected", () => {

obj.sources = [{ provider: "GEO", id: "foo" }];
expect(() => validate(obj)).toThrow("pattern");
obj.sources = [{ provider: "SRA", id: "foo" }];
expect(() => validate(obj)).toThrow("pattern");
obj.sources = [{ provider: "ArrayExpress", id: "foo" }];
expect(() => validate(obj)).toThrow("pattern");
obj.sources = [{ provider: "PubMed", id: "foo" }];
Expand Down

0 comments on commit 4a5d0d0

Please sign in to comment.