Closed sapoudel closed 1 year ago
Was able to figure out the issues without changing any of the versions. My input looked like this:
mutation_data = gos.csv(
url='http://localhost:5000/gene',
chromosomeField="chrom:N",
genomicFields=["start", "end"],
separator=',',
)
Using this data works within jupyter notebook (and I can save as HTML) and creates the figures I want. When I export to json using .to_json()
it keeps the :N
field which breaks it when using it as the spec in react. The json looks like this:
data: {
chromosomeField: "chrom:N",
genomicFields: ["start", "end"],
separator: ",",
type: "csv",
url: "http://localhost:5000/gene",
}
Removing the :N
from the original python input fixes it for both. I am not sure if this should be a bug or not.
Additionally, prettier was also changing seperator: "\t"
to seperator: "\\t"
which was also causing problems.
Hi there, we probably need to make a release of gos
with the latest Gosling.js #143
Perfect! I think the schema validation should throw an error if you add :N
(or any other data type marker) field to chromosomeField
since it breaks the code downstream. If don't think this is a bug, feel free to close this issue.
I think the schema validation should throw an error if you add
:N
(or any other data type marker) field tochromosomeField
since it breaks the code downstream. If don't think this is a bug, feel free to close this issue.
This is not part of the schema that accepts the data type shorthand (e.g., :N
or :Q
). Instead this is part of the data definition and you are telling Gosling which header of the CSV corresponds to the chromosome names. There is no way for the Python library to validate this is a column name in your CSV, since the CSV parsing is done in the front end (after the schema has been compiled).
I am trying to use python gos to create specs that I can then plug into a react app. The react app uses
gosling 0.9.30
andreact ^18.2.0
and the python gos I am using is pip installedgosling-0.0.11
. So far, I can create simple visualization that works perfectly within the app with this "hand made" spec:I can also create a visualization within jupyter notebook using gos and save it as a HTML file. But, when I plug in a spec created with gos into the react, I get all the components but none of the data is displayed. I tried upgrading the python gos to the latest version, but the exported spec from that causes the app to crash. So what is the best way to figure out compatible versions without trying all of them?