-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: fasta write compression * fix: option for compressed sg_object to gbk output * fix: file compression suffix * fix: account for input max proteins being greater than actual proteins * fix: npatlas import * fix: lint * fix: pytest * chore: remove temporary function * style: flake8 * feat: add args for blast options * feat: add genomes to the neo4j database * fix: antismash as nodes * fix: jaccard score * fix: bgc comparison scoring * fix: blast arg in bgc search * fix: neo4j escaping I had no idea Neo4j removed '\'. Which means SMILES (and other) strings have to be stored as escaped '\\' https://neo4j.com/docs/cypher-manual/current/queries/expressions/#string * feat: BGC search, adaptive width * fix: genbank output * fix: to conform to antismash and gbk output * fix: ability to modify clustermap assembly name without modifying uid * fix: bgc search scoring * fix: clustermap.js links color based on on 0-1 scale * fix: tests for release * fix: metavar deprecation * style: black, isort, flake8 * fix: make pytest * style: clean and recreate package and class diagrams * chore: bump dependencies * style: black
- Loading branch information
Showing
50 changed files
with
1,828 additions
and
989 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from socialgene.neo4j.neo4j_element import Node, Relationship | ||
|
||
|
||
class Product(Node): | ||
neo4j_label = ["product"] | ||
description = "Represents the product of an antiSMASH BGC" | ||
property_specification = { | ||
"uid": int, | ||
} | ||
constraints_unique = ["uid"] | ||
|
||
|
||
class Category(Node): | ||
neo4j_label = ["category"] | ||
description = "Represents the category of an antiSMASH BGC" | ||
property_specification = { | ||
"uid": int, | ||
} | ||
constraints_unique = ["uid"] | ||
|
||
|
||
class ProductToCategory(Relationship): | ||
neo4j_label = "IS_A" | ||
description = "Connects an antiSMASH product to category " | ||
start_class = Product | ||
end_class = Category | ||
|
||
|
||
class GeneClusterToProduct(Relationship): | ||
neo4j_label = "IS_A" | ||
description = "Connects an antiSMASH BGC to product " | ||
start_class = Product | ||
end_class = Category | ||
property_specification = { | ||
"tool": str, | ||
"start": int, | ||
"end": int, | ||
"core_start": int, | ||
"core_end": int, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
# from socialgene.neo4j.neo4j_element import Node, Relationship | ||
# try to use classes already created that inherit from Nodes() or Relationship() | ||
# to do that create a mixin class in a separate file and then import that | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# from socialgene.neo4j.neo4j import GraphDriver | ||
# import logging | ||
# import os | ||
# from socialgene.base.chem import ChemicalCompound | ||
# from rich.progress import Progress | ||
# from socialgene.addons.chemistry.nr import ChemicalSubstructure, ContainsSubstructure, ChemicalCompoundNode | ||
# from rdkit import Chem | ||
# from multiprocessing import Pool | ||
# from rdkit.Chem.MolStandardize import rdMolStandardize | ||
# from itertools import batched | ||
# logging.getLogger("neo4j").setLevel(logging.WARNING) | ||
# logging.getLogger().setLevel(logging.INFO) | ||
|
||
# if __name__ == "__main__": | ||
|
||
# #inspect(a) | ||
# with GraphDriver() as db: | ||
# results = db.run( | ||
# """ | ||
# MATCH (n:chemical_compound) RETURN n.inchi as inchi | ||
# """ | ||
# ).value() | ||
|
||
|
||
# nodes=set() | ||
# rels=set() | ||
|
||
# def process_subgraph(batched_results): | ||
# nodes=set() | ||
# rels=set() | ||
# for i in batched_results: | ||
# sgmol = ChemicalCompound(i) | ||
# subgraphs = Chem.FindAllSubgraphsOfLengthN(sgmol.mol, 5) | ||
# for subgraph in subgraphs: | ||
# sub_mol = Chem.PathToSubmol(sgmol.mol, subgraph, useQuery=True) | ||
# sub_mol = rdMolStandardize.Cleanup(sub_mol) | ||
# sub_mol = rdMolStandardize.Normalize(sub_mol) | ||
# r = rdMolStandardize.Reionizer() | ||
# sub_mol = r.reionize(sub_mol) | ||
# Chem.RemoveStereochemistry( sub_mol ) | ||
# #sub_mol=Chem.MolToSmiles(sub_mol, canonical=True) | ||
# node = ChemicalSubstructure() | ||
# temp_compound = ChemicalCompound(sub_mol) | ||
# node.fill_from_dict(temp_compound.base_properties | temp_compound.hash_dict) | ||
# del temp_compound | ||
# nodes.add(node) | ||
# cn = ChemicalCompoundNode() | ||
# cn.fill_from_dict(sgmol.base_properties | sgmol.hash_dict) | ||
# rel = ContainsSubstructure(cn, node) | ||
# rels.add(rel) | ||
# nodes[0].add_multiple_to_neo4j(nodes) | ||
# rels[0].add_multiple_to_neo4j(rels) | ||
|
||
# def update_progress(*args): | ||
# pg.update(task, advance=1) | ||
|
||
# with Progress(transient=True) as pg: | ||
# task = pg.add_task("Progress...", total=len(results)) | ||
# batched_results = batched(results, 100) | ||
# with Pool() as p: | ||
# for i in p.imap_unordered(process_subgraph, batched_results): | ||
# nodes.update(i[0]) | ||
# rels.update(i[1]) | ||
# update_progress() |
Empty file.
Empty file.
Oops, something went wrong.