Exemple #1
0
    def add_target_feats_to_decoy(target: dict, decoy: Data):
        decoy.casp_ed = target["casp_ed"]
        decoy.target_id = target["target_id"]
        decoy.n_nodes = decoy.num_nodes
        decoy.n_edges = decoy.num_edges
        decoy.msa_feats = target["msa_feats"]
        decoy.aa = target["sequence"]

        if decoy.num_nodes == 0:
            # If a graph has 0 nodes and it's put last in the the batch formed by
            # Batch.from_data_list(...) it will cause a miscount in batch.num_graphs
            logger.warning(
                f"Found graph with 0 nodes: {decoy.casp_ed}/{decoy.target_id}/{decoy.decoy_id}"
            )
Exemple #2
0
    def add_target_feats_to_decoy(target: dict, decoy: Data):
        """
        Some features are shared between all decoys of a target,
        e.g. casp_ed, target_id, aa sequence, msa_features.
        Args:
            target:
            decoy:

        Returns:

        """
        decoy.casp_ed = target.get("casp_ed", target.get("dataset_id"))
        decoy.target_id = target["target_id"]
        decoy.n_nodes = decoy.num_nodes
        decoy.n_edges = decoy.num_edges
        decoy.msa_feats = target["msa_feats"]
        decoy.aa = target["sequence"]

        if decoy.num_nodes == 0:
            # If a graph has 0 nodes and it's put last in the the batch formed by
            # Batch.from_data_list(...) it will cause a miscount in batch.num_graphs
            logger.warning(
                f"Found graph with 0 nodes: {decoy.casp_ed}/{decoy.target_id}/{decoy.decoy_id}"
            )