Skip to content

Commit

Permalink
metadata fields updated to control the color of the annotation; added…
Browse files Browse the repository at this point in the history
… updated metadata.json #67
  • Loading branch information
AndreaGuarracino committed Jun 26, 2020
1 parent b6d96bd commit 734cd55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
15 changes: 1 addition & 14 deletions public/test_data/SARS-CoV-2.genbank.small/metadata.json
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
[
{
"Accession": "NC_045512.2",
"Info": "InfoGene A"
},
{
"Accession": "MT534320.1",
"Info": "InfoGene B"
},
{
"Accession": "MT534314.1",
"Info": "InfoGene C"
}
]
[{"Path": "id-NC_045512.2:1..265", "Color": "five_prime_UTR", "Info": ""},{"Path": "gene-GU280_gp01", "Color": "gene", "Info": ""},{"Path": "cds-YP_009724389.1", "Color": "CDS", "Info": ""},{"Path": "cds-YP_009724389.1", "Color": "CDS", "Info": ""},{"Path": "id-YP_009724389.1:1..180", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:181..818", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:819..2763", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:2764..3263", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:3264..3569", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:3570..3859", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:3860..3942", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:3943..4140", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:4141..4253", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:4254..4392", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:4393..5324", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:4393..5324", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:5325..5925", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:5926..6452", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:6453..6798", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009724389.1:6799..7096", "Color": "mature_protein_region", "Info": ""},{"Path": "cds-YP_009725295.1", "Color": "CDS", "Info": ""},{"Path": "id-YP_009725295.1:1..180", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:181..818", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:819..2763", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:2764..3263", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:3264..3569", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:3570..3859", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:3860..3942", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:3943..4140", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:4141..4253", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:4254..4392", "Color": "mature_protein_region", "Info": ""},{"Path": "id-YP_009725295.1:4393..4405", "Color": "mature_protein_region", "Info": ""},{"Path": "id-GU280_gp01", "Color": "stem_loop", "Info": ""},{"Path": "id-GU280_gp01-2", "Color": "stem_loop", "Info": ""},{"Path": "gene-GU280_gp02", "Color": "gene", "Info": ""},{"Path": "cds-YP_009724390.1", "Color": "CDS", "Info": ""},{"Path": "gene-GU280_gp03", "Color": "gene", "Info": ""},{"Path": "cds-YP_009724391.1", "Color": "CDS", "Info": ""},{"Path": "gene-GU280_gp04", "Color": "gene", "Info": ""},{"Path": "cds-YP_009724392.1", "Color": "CDS", "Info": ""},{"Path": "gene-GU280_gp05", "Color": "gene", "Info": ""},{"Path": "cds-YP_009724393.1", "Color": "CDS", "Info": ""},{"Path": "gene-GU280_gp06", "Color": "gene", "Info": ""},{"Path": "cds-YP_009724394.1", "Color": "CDS", "Info": ""},{"Path": "gene-GU280_gp07", "Color": "gene", "Info": ""},{"Path": "cds-YP_009724395.1", "Color": "CDS", "Info": ""},{"Path": "gene-GU280_gp08", "Color": "gene", "Info": ""},{"Path": "cds-YP_009725318.1", "Color": "CDS", "Info": ""},{"Path": "gene-GU280_gp09", "Color": "gene", "Info": ""},{"Path": "cds-YP_009724396.1", "Color": "CDS", "Info": ""},{"Path": "gene-GU280_gp10", "Color": "gene", "Info": ""},{"Path": "cds-YP_009724397.2", "Color": "CDS", "Info": ""},{"Path": "gene-GU280_gp11", "Color": "gene", "Info": ""},{"Path": "cds-YP_009725255.1", "Color": "CDS", "Info": ""},{"Path": "id-GU280_gp11", "Color": "stem_loop", "Info": ""},{"Path": "id-GU280_gp11-2", "Color": "stem_loop", "Info": ""},{"Path": "id-NC_045512.2:29675..29903", "Color": "three_prime_UTR", "Info": ""},{"Path": "id-NC_045512.2:29728..29768", "Color": "stem_loop", "Info": ""}]
2 changes: 1 addition & 1 deletion src/ComponentRect.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ComponentRect extends React.Component {
if (this.props.store.colorByGeneAnnotation && this.props.store.metaData) {
let metaData = this.props.store.metaData;
if (metaData.get(pathName) !== undefined) {
rowColor = colorFromStr(metaData.get(pathName).Accession);
rowColor = colorFromStr(metaData.get(pathName).Color);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/ViewportInputsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const PathNucPos = types.model("PathNucPos", {
});

const metaDataModelEntry = types.model({
Accession: types.identifier,
Path: types.identifier,
Color: types.string,
Info: types.string,
});

Expand Down Expand Up @@ -96,7 +97,7 @@ RootStore = types
last_bin_pangenome: 0,

colorByGeneAnnotation: true,
metaDataKey: "Accession",
metaDataKey: "Path",
metaData: types.map(metaDataModelEntry),
//metaDataChoices: types.array(types.string)
})
Expand Down

0 comments on commit 734cd55

Please sign in to comment.