Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A set of tools for navigating, viewing and manipulating hierarchical brain atlases
This package is intended as a toolkit for manipulating hierarchical brain atlases. For example, the Allen Mouse Brain Atlas has a parent-child ontology of this structure:
{
"id": 997,
"acronym": "root",
"name": "root",
"graph_order": 0,
"parent_structure_id": null,
"children": [
{
"id": 8,
"acronym": "grey",
"name": "Basic cell groups and regions",
"graph_order": 1,
"parent_structure_id": 997,
"children": [
{
"id": 567,
"acronym": "CH",
"name": "Cerebrum",
"graph_order": 2,
"parent_structure_id": 8,
"children": [
...
from brain_atlas_toolkit import graph_tools
import json
json_file = "allen_ontology.json"
with open(json_file,'r') as infile:
ontology_dict = json.load(infile)
Note that this JSON file must have the structure of the example ontology shown above. The minimal set of keys in each element are:
ontology_graph = graph_tools.Graph(ontology_dict)
ontology_graph.get_progeny('Somatomotor areas')
which returns:
['Somatomotor areas, Layer 1', 'Somatomotor areas, Layer 2/3', 'Somatomotor areas, Layer 5', 'Somatomotor areas, Layer 6a', 'Somatomotor areas, Layer 6b', 'Primary motor area', 'Primary motor area, Layer 1', 'Primary motor area, Layer 2/3', 'Primary motor area, Layer 5', 'Primary motor area, Layer 6a', 'Primary motor area, Layer 6b', 'Secondary motor area', 'Secondary motor area, layer 1', 'Secondary motor area, layer 2/3', 'Secondary motor area, layer 5', 'Secondary motor area, layer 6a', 'Secondary motor area, layer 6b']
ontology_graph.get_parent('Somatomotor areas')
which returns:
Isocortex
ontology_graph.get_id('Somatomotor areas')
which returns:
500
ontology_graph.get_parent('Somatomotor areas')
which returns:
MO
ontology_graph.print_branch('Somatomotor areas')
which returns
0 Somatomotor areas
1 Somatomotor areas, Layer 1
1 Somatomotor areas, Layer 2/3
1 Somatomotor areas, Layer 5
1 Somatomotor areas, Layer 6a
1 Somatomotor areas, Layer 6b
1 Primary motor area
2 Primary motor area, Layer 1
2 Primary motor area, Layer 2/3
2 Primary motor area, Layer 5
2 Primary motor area, Layer 6a
2 Primary motor area, Layer 6b
1 Secondary motor area
2 Secondary motor area, layer 1
2 Secondary motor area, layer 2/3
2 Secondary motor area, layer 5
2 Secondary motor area, layer 6a
2 Secondary motor area, layer 6b
ontology_graph.print_branch('Somatomotor areas',stoplevel=1)
which returns
0 Somatomotor areas
1 Somatomotor areas, Layer 1
1 Somatomotor areas, Layer 2/3
1 Somatomotor areas, Layer 5
1 Somatomotor areas, Layer 6a
1 Somatomotor areas, Layer 6b
1 Primary motor area
1 Secondary motor area
The default stoplevel value is -1, which means print the entire tree to max depth.
digraph = ontology_graph.visualize_graph('Somatomotor areas',level=2)
digraph.format='png' # control the image type; supports png, pdf and other formats
digraph.view()
The last line will save and then open up an image in your default image viewer application. The image should look like this (click image to view zoomed in version):
For full documentation of the digraph
object, see the graphviz Python API documentation: https://graphviz.readthedocs.io/en/stable/
FAQs
A set of tools for navigating, viewing and manipulating hierarchical brain atlases
We found that brain-atlas-toolkit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.