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

Remove unwanted (?!) keys in output jbrowse config #470

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion packages/apollo-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @apollo-annotation/cli
$ apollo COMMAND
running command...
$ apollo (--version)
@apollo-annotation/cli/0.1.20 linux-x64 node-v20.17.0
@apollo-annotation/cli/0.1.20 linux-x64 node-v20.13.0
$ apollo --help [COMMAND]
USAGE
$ apollo COMMAND
Expand Down
4 changes: 4 additions & 0 deletions packages/apollo-cli/src/commands/jbrowse/get-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export default class GetConfig extends BaseCommand<typeof GetConfig> {
}

const json = (await response.json()) as object
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete json['_id' as keyof typeof json]
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete json['__v' as keyof typeof json]
this.log(JSON.stringify(json, null, 2))
}
}
26 changes: 26 additions & 0 deletions packages/apollo-cli/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ def testLogin(self):
) # NB: "Timeout" comes from utils.py, not Apollo
# This should be ok
shell(f"{apollo} login {P} --force", timeout=5, strict=True)

def testFileUpload(self):
p = shell(f"{apollo} file upload {P} -i test_data/tiny.fasta")
out = json.loads(p.stdout)
Expand Down Expand Up @@ -1219,6 +1220,31 @@ def testDeleteFile(self):
out = json.loads(p.stdout)
self.assertEqual(0, len(out))

def testGetAndSetJbrowseConfig(self):
shell(f"{apollo} jbrowse get-config {P} > tmp.jb.json")
shell(
"""
jq '.configuration += {
"ApolloPlugin": {
"featureTypeOntology": "Some Ontology Name",
"ontologies": [
{
"name": "Some Ontology Name",
"version": "full",
"source": {
"uri": "http://localhost:9000/test_data/so-v3.1.json",
"locationType": "UriLocation"
}
}
]
}
}' tmp.jb.json > tmp.jb2.json
"""
)
shell(f"{apollo} jbrowse set-config {P} tmp.jb2.json")
os.remove("tmp.jb.json")
os.remove("tmp.jb2.json")


if __name__ == "__main__":
unittest.main()
Loading