# HG changeset patch # User iuc # Date 1741360944 0 # Node ID 6c310acd2f87961b8e8b40cde366df4d3f9f8383 # Parent 02b0ecc34d9ae3817c5f0f6ee8fc79dbf3ce30de planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/rna_tools/rnaformer commit a0639f646e953fe490559b10bb7271a67d07cac4 diff -r 02b0ecc34d9a -r 6c310acd2f87 infer_rnaformer.xml --- a/infer_rnaformer.xml Thu Jul 11 20:56:23 2024 +0000 +++ b/infer_rnaformer.xml Fri Mar 07 15:22:24 2025 +0000 @@ -1,19 +1,15 @@ - + Predict the secondary structure of an RNA with RNAformer macros.xml biopython + matplotlib + seaborn + requests - '$output' -]]> + '$output']]> 0: + output_buffer.append(f"NOTE: {pk_count} pseudoknots and/or multiplets present in predicted structure excluded from dot-bracket notation: {pk_list}\n") + + heatmaps_dir = './heatmaps' + os.makedirs(heatmaps_dir, exist_ok=True) + plt.figure(figsize=(12, 10)) + + if matrix_color_type == 'color': + raw_pred_mat = torch.sigmoid(logits[0, :, :, -1]) + sns.heatmap(raw_pred_mat, cmap="inferno", vmin=0.0, vmax=1.0, + xticklabels=list(orig_seq), + yticklabels=list(orig_seq) + ) + plt.title(f"RNAformer Base-pair Probability Matrix") + plt.xticks(rotation=90) + plt.tight_layout() + plt.savefig(f'{seq_dir}/RNAformer_structure_adjacency_matrix_color_{count}.{matrix_out_type}', dpi=150) + plt.close() + else: + sns.heatmap(pred_mat, cmap="gray", vmin=0.0, vmax=1.0, + xticklabels=list(orig_seq), + yticklabels=list(orig_seq) + ) + plt.title(f"RNAformer Base-pair Binary Probability Matrix") + plt.xticks(rotation=90) + plt.tight_layout() + plt.savefig(f'{seq_dir}/RNAformer_structure_adjacency_matrix_binary_{count}.{matrix_out_type}', dpi=150) + plt.close() + + full_text = "".join(output_buffer) + with open(f"{seq_dir}/RNAformer_output.txt", "w", encoding="utf-8") as txt_file: + txt_file.write(full_text) + txt_file.write("\n") + + total_output_buffer.append(full_text) + total_output_buffer.append("\n") + + full_job_output = "".join(total_output_buffer) + with open(f"./RNAformer_job_output.txt", "w", encoding="utf-8") as txt_file: + txt_file.write(full_job_output) + + count += 1 + +shutil.make_archive('output', "zip", job_name) ]]> @@ -178,35 +282,63 @@ + + + + + + + + + + + + + - + + + - - - - - - + + + + + + + + + "Paste/Fetch Data" and copy the following URLs): `https://ml.informatik.uni-freiburg.de/research-artifacts/RNAformer/models/RNAformer_32M_state_dict_intra_family_finetuned.pth https://ml.informatik.uni-freiburg.de/research-artifacts/RNAformer/models/RNAformer_32M_config_intra_family_finetuned.yml` + **Input format** RNAformer requires one or more RNA sequences either as a single FASTA file or as plain text. **Outputs** - - Predicted secondary structure as a text file in the following formats: - - base pair positions - - dot-bracket notation + - Predicted secondary structures as a text file for all sequences provided containing the following: + - Job name (with index based on order of input sequences in either plain text or FASTA file) + - RNA input sequence + - Length of input sequence + - Base pairs of predicted secondary structure + - Predicted secondary structure in dot-bracket notation (excluding pseudoknots and multiplets) + - Optional: pseudoknots and/or multiplets present in predicted structure excluded from dot-bracket notation + - A zip file containing: + - Sub-directory for each input sequence with the name _ containing: + - Predicted secondary structure text file (same as above) + - Heatmap of base pair probability matrix + + ]]> \ No newline at end of file diff -r 02b0ecc34d9a -r 6c310acd2f87 macros.xml --- a/macros.xml Thu Jul 11 20:56:23 2024 +0000 +++ b/macros.xml Fri Mar 07 15:22:24 2025 +0000 @@ -1,6 +1,6 @@ RNAformer - 1.0.0 + 1.2.0 22.05 diff -r 02b0ecc34d9a -r 6c310acd2f87 test-data/RNAformer_job_output.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/RNAformer_job_output.txt Fri Mar 07 15:22:24 2025 +0000 @@ -0,0 +1,7 @@ +Job name: RNAformer_Prediction_Test_1_0 +Sequence: GCCCGCAUGGUGAAAUCGGUAAACACAUCGCACUAAUGCGCCGCCUCUGGCUUGCCGGUUCAAGUCCGGCUGCGGGCACCA +Length: 81 +Base pairs: [[0, 76], [1, 75], [2, 74], [3, 73], [4, 72], [5, 71], [6, 70], [7, 13], [7, 21], [8, 23], [9, 25], [10, 24], [11, 23], [12, 22], [13, 7], [17, 59], [18, 60], [21, 7], [21, 13], [22, 12], [23, 8], [23, 11], [24, 10], [25, 9], [39, 30], [40, 29], [42, 50], [43, 49], [44, 48], [48, 44], [49, 43], [50, 42], [53, 69], [54, 68], [55, 67], [56, 66], [57, 65], [58, 62], [59, 17], [60, 18], [62, 58], [65, 57], [66, 56], [67, 55], [68, 54], [69, 53], [70, 6], [71, 5], [72, 4], [73, 3], [74, 2], [75, 1], [76, 0]] +Predicted Structure: (((((((((((.()...((...))))...))........((.(((...)))..(((((()).)..)))))))))))).... +NOTE: 28 pseudoknots and/or multiplets present in predicted structure excluded from dot-bracket notation: [[7, 21], [11, 23], [13, 7], [21, 7], [21, 13], [22, 12], [23, 8], [23, 11], [24, 10], [25, 9], [48, 44], [49, 43], [50, 42], [59, 17], [60, 18], [62, 58], [65, 57], [66, 56], [67, 55], [68, 54], [69, 53], [70, 6], [71, 5], [72, 4], [73, 3], [74, 2], [75, 1], [76, 0]] + diff -r 02b0ecc34d9a -r 6c310acd2f87 test-data/fasta_input_false1.fa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/fasta_input_false1.fa Fri Mar 07 15:22:24 2025 +0000 @@ -0,0 +1,4 @@ +>Anolis_caro_chrUn_GL343590.trna2_AlaAGC (218800-218872) Ala (AGC) 73 bp Sc: 49.55 +TGGGAATTAGCTCAAATGGAAGAGCGCTCGCTTAGCATGTGAGAGGTAGTGGGATCGATGCCCACATTCTCCA +>Anolis_caro_chrUn_GL343207.trna3_AlaAGC (1513626-1513698) Ala (AGC) 73 bp Sc: 56.15 +GGGAATTAGCTCAAATGGAAGAGCGCTCGCTTAGCATGCGAGAGGTAGCGGGATTGATGCCCGCATTCTCCA \ No newline at end of file diff -r 02b0ecc34d9a -r 6c310acd2f87 test-data/output.zip Binary file test-data/output.zip has changed diff -r 02b0ecc34d9a -r 6c310acd2f87 test-data/rna_2d_pred_FASTA.txt --- a/test-data/rna_2d_pred_FASTA.txt Thu Jul 11 20:56:23 2024 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -Pairing index 1: [0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 8, 9, 9, 10, 11, 12, 13, 13, 17, 18, 20, 21, 21, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71] -Pairing index 2: [71, 70, 69, 68, 67, 66, 65, 13, 14, 20, 47, 22, 24, 44, 23, 22, 21, 7, 20, 54, 55, 7, 12, 45, 8, 11, 10, 9, 43, 42, 41, 40, 39, 38, 37, 36, 32, 31, 30, 29, 28, 27, 26, 25, 9, 21, 64, 63, 62, 61, 60, 57, 17, 18, 53, 52, 51, 50, 49, 48, 6, 5, 4, 3, 2, 1, 0] -Pairing index 1: [0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 8, 9, 9, 10, 11, 12, 13, 13, 14, 20, 20, 21, 21, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 52, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71] -Pairing index 2: [71, 70, 69, 68, 67, 66, 65, 13, 14, 20, 22, 24, 44, 23, 22, 21, 7, 20, 7, 7, 13, 12, 45, 8, 11, 10, 9, 43, 42, 41, 40, 39, 38, 37, 32, 31, 30, 29, 28, 27, 26, 25, 9, 21, 64, 63, 62, 61, 60, 52, 51, 50, 49, 48, 6, 5, 4, 3, 2, 1, 0] diff -r 02b0ecc34d9a -r 6c310acd2f87 test-data/rna_2d_pred_text.txt --- a/test-data/rna_2d_pred_text.txt Thu Jul 11 20:56:23 2024 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -Pairing index 1: [0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 17, 18, 21, 21, 22, 23, 23, 24, 25, 39, 40, 42, 43, 44, 48, 49, 50, 53, 54, 55, 56, 57, 58, 59, 60, 62, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76] -Pairing index 2: [76, 75, 74, 73, 72, 71, 70, 13, 21, 23, 25, 24, 23, 22, 7, 59, 60, 7, 13, 12, 8, 11, 10, 9, 30, 29, 50, 49, 48, 44, 43, 42, 69, 68, 67, 66, 65, 62, 17, 18, 58, 57, 56, 55, 54, 53, 6, 5, 4, 3, 2, 1, 0]