Skip to content

Commit

Permalink
Update js docs : book:
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Apr 10, 2024
1 parent 789ef08 commit 56ebceb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 28 deletions.
2 changes: 0 additions & 2 deletions docs/scripts_js/ArcInvestigation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { ArcInvestigation, Comment$ as Comment, XlsxController, JsonController} from "@nfdi4plants/arctrl"
// Import Spreadsheet to XLSX reader/writer
import {Xlsx} from "@fslab/fsspreadsheet";

// # Comments

Expand Down
21 changes: 3 additions & 18 deletions docs/scripts_js/EXAMPLE_CreateAssayFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@

// Import ARCtrl
import * as arctrl from "@nfdi4plants/arctrl"
// Alternative import
// import {
// Comment$ as Comment, OntologyAnnotation, Person, Publication,
// IOType, CompositeHeader, CompositeCell, CompositeColumn, ArcTable,
// ArcAssay, ArcStudy, ArcInvestigation,
// Template, Organisation, Templates, JsWeb,
// ARC } from "@nfdi4plants/arctrl";

// Import ARCtrl Assay to Spreadsheet transformation
import {toFsWorkbook,fromFsWorkbook} from "@nfdi4plants/arctrl/ISA/ISA.Spreadsheet/ArcAssay.js"
// Import ARCtrl Study to Spreadsheet transformation
// import {toFsWorkbook,fromFsWorkbook} from "@nfdi4plants/arctrl/ISA/ISA.Spreadsheet/ArcStudy.js"
// Import ARCtrl Investigation to Spreadsheet transformation
// import {toFsWorkbook,fromFsWorkbook} from "@nfdi4plants/arctrl/ISA/ISA.Spreadsheet/ArcInvestigation.js"

// Import Spreadsheet to XLSX reader/writer
import {Xlsx} from "@fslab/fsspreadsheet";

Expand All @@ -36,15 +21,15 @@ const growth = arctrl.ArcTable.init("Growth");
growth.AddColumn(arctrl.CompositeHeader.input(arctrl.IOType.source()), [arctrl.CompositeCell.createFreeText("Input1")]);

// Add characteristic column with one value
const oa_species = arctrl.OntologyAnnotation.fromString("species", "GO", "GO:0123456");
const oa_chlamy = arctrl.OntologyAnnotation.fromString("Chlamy", "NCBI", "NCBI:0123456");
const oa_species = new arctrl.OntologyAnnotation("species", "GO", "GO:0123456");
const oa_chlamy = new arctrl.OntologyAnnotation("Chlamy", "NCBI", "NCBI:0123456");
growth.AddColumn(arctrl.CompositeHeader.characteristic(oa_species), [arctrl.CompositeCell.createTerm(oa_chlamy)]);

// Add table to assay
myAssay.AddTable(growth);

// -------- 2. Transform object to generic spreadsheet ----------
let spreadsheet = toFsWorkbook(myAssay);
let spreadsheet = arctrl.XlsxController.Assay.toFsWorkbook(myAssay);

// -------- 3. Write spreadsheet to xlsx file (or bytes) ----------
const outPath = "./myFile.xlsx";
Expand Down
6 changes: 3 additions & 3 deletions docs/scripts_js/Tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const growth = myStudy.InitTable("Growth")

// create ontology annotation for "species"
const oa_species =
OntologyAnnotation.fromString(
new OntologyAnnotation(
"species", "GO", "GO:0123456"
)
// create ontology annotation for "chlamy"
const oa_chlamy =
OntologyAnnotation.fromString(
new OntologyAnnotation(
"Chlamy", "NCBI", "NCBI:0123456"
);

Expand All @@ -23,7 +23,7 @@ const oa_chlamy =
// in xlsx this will be exactly 1 column.
// Syntax on CompositeHeader, IOType and even CompositeCell will soon improve!
growth.AddColumn(
CompositeHeader.input(IOType.source),
CompositeHeader.input(IOType.source()),
[CompositeCell.createFreeText("Input1")]
);

Expand Down
8 changes: 4 additions & 4 deletions docs/scripts_js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/scripts_js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Kevin Frey",
"license": "MIT",
"dependencies": {
"@fslab/fsspreadsheet": "^6.0.1",
"@fslab/fsspreadsheet": "^6.1.2",
"@nfdi4plants/arctrl": "^2.0.0-alpha.2"
}
}

0 comments on commit 56ebceb

Please sign in to comment.