{
  "id": 579908,
  "title": "trRosettaRNA Merge Trick",
  "url": "/competitions/stanford-rna-3d-folding/discussion/579908",
  "author_name": "",
  "post_date": "2025-05-21T06:44:12.192000",
  "votes": 6,
  "comment_count": 9,
  "views": 0,
  "content": "<p>Insert trRosettaRNA results below 350 into the fifth position of ProteniX can increase the score to 0.381<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F13967749%2F84afbcb35144d44f2474141b818d74d9%2F173074781d26e7bd97457169ff2e8885.png?generation=1747809839381953&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": 3206312,
      "postDate": "2025-05-21T06:44:12.193Z",
      "content": "<p>Insert trRosettaRNA results below 350 into the fifth position of ProteniX can increase the score to 0.381<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F13967749%2F84afbcb35144d44f2474141b818d74d9%2F173074781d26e7bd97457169ff2e8885.png?generation=1747809839381953&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Insert trRosettaRNA results below 350 into the fifth position of ProteniX can increase the score to 0.381![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F13967749%2F84afbcb35144d44f2474141b818d74d9%2F173074781d26e7bd97457169ff2e8885.png?generation=1747809839381953&alt=media)",
      "votes": 6
    },
    {
      "id": 3206417,
      "postDate": "2025-05-21T09:23:20.040Z",
      "content": "<p>0.381 config: seed=42<br>\nusing torch.use_deterministic_algorithms(True) to make protenix deterministic:<br>\n<a href=\"https://www.kaggle.com/code/thekog/deterministic-protenix\" target=\"_blank\">https://www.kaggle.com/code/thekog/deterministic-protenix</a></p>",
      "rawMarkdown": "0.381 config: seed=42\nusing torch.use_deterministic_algorithms(True) to make protenix deterministic:\nhttps://www.kaggle.com/code/thekog/deterministic-protenix",
      "votes": 2,
      "replies": [
        {
          "id": 3207141,
          "postDate": "2025-05-22T09:39:11.780Z",
          "rawMarkdown": "",
          "isDeleted": true,
          "replies": [
            {
              "id": 3207200,
              "postDate": "2025-05-22T11:50:12.950Z",
              "content": "<p>There is a trick I forgot to post</p>\n<p>you can use op_score from pyrosetta to sort the result of protenix, to prevent the best output being replaced:</p>\n<p>import pyrosetta<br>\nfrom pyrosetta import pose_from_pdb, create_score_function<br>\nfrom pyrosetta.rosetta import core</p>\n<p>pyrosetta.init(options='-mute all') </p>\n<p>op_score = create_score_function('ref2015')<br>\nop_score.set_weight(core.scoring.atom_pair_constraint, 9.0)<br>\nop_score.set_weight(core.scoring.dihedral_constraint, 4.0)<br>\nop_score.set_weight(core.scoring.angle_constraint, 4.0)<br>\nop_score.set_weight(core.scoring.fa_rep, 9.0)<br>\nop_score.set_weight(core.scoring.rna_sugar_close, 9.0)<br>\nop_score.set_weight(core.scoring.fa_intra_rep, 9.0)<br>\nop_score.set_weight(core.scoring.rna_base_pair, 9.0)<br>\nop_score.set_weight(core.scoring.rna_base_stack, 9.0)</p>\n<p>def protenix_to_pdb_and_df(coordinate, atom_array, pdb_path):<br>\n    # Create a PandasPdb object<br>\n    lines= []<br>\n    for i, atom in enumerate(atom_array):<br>\n        # Extract atom information<br>\n        atom_name = atom.atom_name<br>\n        res_name = atom.res_name<br>\n        chain_id = atom.chain_id<br>\n        res_id = atom.res_id<br>\n        x, y, z = coordinate[i][0].item(), coordinate[i][1].item(), coordinate[i][2].item()</p>\n<pre><code>    \n    line = \n    lines.append(line)\n\n (pdb_path, )  f:\n    f.writelines(lines)\n\ndf = pd.DataFrame({\n    : [atom.atom_name  atom  atom_array],\n    : [atom.res_name  atom  atom_array],\n    : [atom.chain_id  atom  atom_array],\n    : [atom.res_id  atom  atom_array],\n    : [coordinate[i][].item()  i  ((atom_array))],\n    : [coordinate[i][].item()  i  ((atom_array))],\n    : [coordinate[i][].item()  i  ((atom_array))],\n    : [atom.element  atom  atom_array]\n})\n df\n</code></pre>\n<p>before using op score, you need to convert prediction['coordinate'] to pdb file, using protenix_to_pdb_and_df()</p>",
              "rawMarkdown": "There is a trick I forgot to post\n\nyou can use op_score from pyrosetta to sort the result of protenix, to prevent the best output being replaced:\n\n\nimport pyrosetta\nfrom pyrosetta import pose_from_pdb, create_score_function\nfrom pyrosetta.rosetta import core\n\npyrosetta.init(options='-mute all') \n\nop_score = create_score_function('ref2015')\nop_score.set_weight(core.scoring.atom_pair_constraint, 9.0)\nop_score.set_weight(core.scoring.dihedral_constraint, 4.0)\nop_score.set_weight(core.scoring.angle_constraint, 4.0)\nop_score.set_weight(core.scoring.fa_rep, 9.0)\nop_score.set_weight(core.scoring.rna_sugar_close, 9.0)\nop_score.set_weight(core.scoring.fa_intra_rep, 9.0)\nop_score.set_weight(core.scoring.rna_base_pair, 9.0)\nop_score.set_weight(core.scoring.rna_base_stack, 9.0)\n\ndef protenix_to_pdb_and_df(coordinate, atom_array, pdb_path):\n    # Create a PandasPdb object\n    lines= []\n    for i, atom in enumerate(atom_array):\n        # Extract atom information\n        atom_name = atom.atom_name\n        res_name = atom.res_name\n        chain_id = atom.chain_id\n        res_id = atom.res_id\n        x, y, z = coordinate[i][0].item(), coordinate[i][1].item(), coordinate[i][2].item()\n\n        # Create PDB line\n        line = f\"ATOM  {i+1:>5} {atom_name:<4} {res_name:<3} {chain_id:<1}{res_id:>4}    {x:>8.3f}{y:>8.3f}{z:>8.3f} 1.00  1.00           {atom.element:<2}\\n\"\n        lines.append(line)\n    # Write to PDB file\n    with open(pdb_path, 'w') as f:\n        f.writelines(lines)\n    # Create DataFrame\n    df = pd.DataFrame({\n        'atom_name': [atom.atom_name for atom in atom_array],\n        'res_name': [atom.res_name for atom in atom_array],\n        'chain_id': [atom.chain_id for atom in atom_array],\n        'res_id': [atom.res_id for atom in atom_array],\n        'x': [coordinate[i][0].item() for i in range(len(atom_array))],\n        'y': [coordinate[i][1].item() for i in range(len(atom_array))],\n        'z': [coordinate[i][2].item() for i in range(len(atom_array))],\n        'element': [atom.element for atom in atom_array]\n    })\n    return df\n\n\nbefore using op score, you need to convert prediction['coordinate'] to pdb file, using protenix_to_pdb_and_df()",
              "votes": 2
            },
            {
              "id": 3207674,
              "postDate": "2025-05-23T05:44:49.027Z",
              "content": "<p>Is it necessary to use multiple sequence secondary structure optimization?</p>",
              "rawMarkdown": "Is it necessary to use multiple sequence secondary structure optimization?",
              "votes": 1
            },
            {
              "id": 3208133,
              "postDate": "2025-05-23T18:22:07.863Z",
              "content": "<p>Not necessary   </p>",
              "rawMarkdown": "  Not necessary   ",
              "votes": 1
            },
            {
              "id": 3209853,
              "postDate": "2025-05-26T12:12:26.380Z",
              "content": "<p>Thx! I'm confused about the value of seed, which equal to 42, do you suggest that I change something else to test whether it will have an impact on the score?</p>",
              "rawMarkdown": "Thx! I'm confused about the value of seed, which equal to 42, do you suggest that I change something else to test whether it will have an impact on the score?",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 3206398,
      "postDate": "2025-05-21T08:48:42.067Z",
      "content": "<p>Good trick, Though it might be a bit tricky for folks to the competition. Best of luck to any Kagglers reading this! 🚀</p>",
      "rawMarkdown": "Good trick, Though it might be a bit tricky for folks to the competition. Best of luck to any Kagglers reading this! 🚀",
      "votes": 1
    },
    {
      "id": 3206313,
      "postDate": "2025-05-21T06:44:32.290Z",
      "content": "<p><a href=\"https://www.kaggle.com/code/thekog/trrosettarna-runable\" target=\"_blank\">https://www.kaggle.com/code/thekog/trrosettarna-runable</a></p>",
      "rawMarkdown": "https://www.kaggle.com/code/thekog/trrosettarna-runable",
      "votes": 1
    },
    {
      "id": 3207673,
      "postDate": "2025-05-23T05:43:53.227Z",
      "content": "<p>Very useful hints! Thanks a lot!</p>",
      "rawMarkdown": "Very useful hints! Thanks a lot!"
    }
  ],
  "comments": [
    {
      "id": 3206417,
      "author_name": "",
      "author_url": "",
      "post_date": "2025-05-21T09:23:20.040000",
      "content": "<p>0.381 config: seed=42<br>\nusing torch.use_deterministic_algorithms(True) to make protenix deterministic:<br>\n<a href=\"https://www.kaggle.com/code/thekog/deterministic-protenix\" target=\"_blank\">https://www.kaggle.com/code/thekog/deterministic-protenix</a></p>",
      "votes": 2,
      "replies": [
        {
          "id": 3207141,
          "author_name": "",
          "author_url": "",
          "post_date": "2025-05-22T09:39:11.780000",
          "content": "",
          "votes": 0,
          "replies": [
            {
              "id": 3207200,
              "author_name": "",
              "author_url": "",
              "post_date": "2025-05-22T11:50:12.950000",
              "content": "<p>There is a trick I forgot to post</p>\n<p>you can use op_score from pyrosetta to sort the result of protenix, to prevent the best output being replaced:</p>\n<p>import pyrosetta<br>\nfrom pyrosetta import pose_from_pdb, create_score_function<br>\nfrom pyrosetta.rosetta import core</p>\n<p>pyrosetta.init(options='-mute all') </p>\n<p>op_score = create_score_function('ref2015')<br>\nop_score.set_weight(core.scoring.atom_pair_constraint, 9.0)<br>\nop_score.set_weight(core.scoring.dihedral_constraint, 4.0)<br>\nop_score.set_weight(core.scoring.angle_constraint, 4.0)<br>\nop_score.set_weight(core.scoring.fa_rep, 9.0)<br>\nop_score.set_weight(core.scoring.rna_sugar_close, 9.0)<br>\nop_score.set_weight(core.scoring.fa_intra_rep, 9.0)<br>\nop_score.set_weight(core.scoring.rna_base_pair, 9.0)<br>\nop_score.set_weight(core.scoring.rna_base_stack, 9.0)</p>\n<p>def protenix_to_pdb_and_df(coordinate, atom_array, pdb_path):<br>\n    # Create a PandasPdb object<br>\n    lines= []<br>\n    for i, atom in enumerate(atom_array):<br>\n        # Extract atom information<br>\n        atom_name = atom.atom_name<br>\n        res_name = atom.res_name<br>\n        chain_id = atom.chain_id<br>\n        res_id = atom.res_id<br>\n        x, y, z = coordinate[i][0].item(), coordinate[i][1].item(), coordinate[i][2].item()</p>\n<pre><code>    \n    line = \n    lines.append(line)\n\n (pdb_path, )  f:\n    f.writelines(lines)\n\ndf = pd.DataFrame({\n    : [atom.atom_name  atom  atom_array],\n    : [atom.res_name  atom  atom_array],\n    : [atom.chain_id  atom  atom_array],\n    : [atom.res_id  atom  atom_array],\n    : [coordinate[i][].item()  i  ((atom_array))],\n    : [coordinate[i][].item()  i  ((atom_array))],\n    : [coordinate[i][].item()  i  ((atom_array))],\n    : [atom.element  atom  atom_array]\n})\n df\n</code></pre>\n<p>before using op score, you need to convert prediction['coordinate'] to pdb file, using protenix_to_pdb_and_df()</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 3207674,
              "author_name": "",
              "author_url": "",
              "post_date": "2025-05-23T05:44:49.027000",
              "content": "<p>Is it necessary to use multiple sequence secondary structure optimization?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3208133,
              "author_name": "Zhongyuan Zhang",
              "author_url": "",
              "post_date": "2025-05-23T18:22:07.863000",
              "content": "<p>Not necessary   </p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3209853,
              "author_name": "",
              "author_url": "",
              "post_date": "2025-05-26T12:12:26.380000",
              "content": "<p>Thx! I'm confused about the value of seed, which equal to 42, do you suggest that I change something else to test whether it will have an impact on the score?</p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3206398,
      "author_name": "Tan_T64",
      "author_url": "",
      "post_date": "2025-05-21T08:48:42.067000",
      "content": "<p>Good trick, Though it might be a bit tricky for folks to the competition. Best of luck to any Kagglers reading this! 🚀</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 3206313,
      "author_name": "",
      "author_url": "",
      "post_date": "2025-05-21T06:44:32.290000",
      "content": "<p><a href=\"https://www.kaggle.com/code/thekog/trrosettarna-runable\" target=\"_blank\">https://www.kaggle.com/code/thekog/trrosettarna-runable</a></p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 3207673,
      "author_name": "",
      "author_url": "",
      "post_date": "2025-05-23T05:43:53.227000",
      "content": "<p>Very useful hints! Thanks a lot!</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3206312": "Insert trRosettaRNA results below 350 into the fifth position of ProteniX can increase the score to 0.381![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F13967749%2F84afbcb35144d44f2474141b818d74d9%2F173074781d26e7bd97457169ff2e8885.png?generation=1747809839381953&alt=media)",
    "3206417": "0.381 config: seed=42\nusing torch.use_deterministic_algorithms(True) to make protenix deterministic:\nhttps://www.kaggle.com/code/thekog/deterministic-protenix",
    "3206398": "Good trick, Though it might be a bit tricky for folks to the competition. Best of luck to any Kagglers reading this! 🚀",
    "3206313": "https://www.kaggle.com/code/thekog/trrosettarna-runable",
    "3207673": "Very useful hints! Thanks a lot!"
  }
}