# HG changeset patch # User bgruening # Date 1737881136 0 # Node ID 50a3903370a66958a11e8b7958be6c13de3f9ac4 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/rna_tools/rnaformer commit 81ae3a5a824f820d2ee4212dcacb334b3dabd683 diff -r 000000000000 -r 50a3903370a6 infer_rnaformer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/infer_rnaformer.xml Sun Jan 26 08:45:36 2025 +0000 @@ -0,0 +1,229 @@ + + Predict the secondary structure of an RNA with RNAformer + + macros.xml + + + biopython + + '$output' +]]> + + 0.5 + + pos_id = torch.where(pred_mat == True) + pos1_id = pos_id[0].cpu().tolist() + pos2_id = pos_id[1].cpu().tolist() + predicted_structure = f"Pairing index 1: {pos1_id} \nPairing index 2: {pos2_id}" + pairs = [[a, b] for a, b in zip(pos1_id, pos2_id)] + + seqlen = len(sample['src_seq']) + dot_bracket =['.'] * seqlen + pk_count = 0 + pk_list = [] + for i in range(len(pos1_id)): + open_index = pos1_id[i] + close_index = pos2_id[i] + + if 0 <= open_index < len(dot_bracket) and 0 <= close_index < len(dot_bracket): + if dot_bracket[open_index] == '.' and dot_bracket[close_index] == '.': + dot_bracket[open_index] = '(' + dot_bracket[close_index] = ')' + else: + ## pseudoknots or multiplets present in structure- cannot represent with dot-bracket + pk_count += 1 + pk_list.append(pairs[i]) + dot_bracket_str_pred = ''.join(dot_bracket) + + print(f"{orig_seq}") + print(f"Base pairs: {str(pairs)}") + print(f"Predicted Structure: {dot_bracket_str_pred}") + if pk_count > 0: + print(f"NOTE: {pk_count} pseudoknots and/or multiplets present in predicted structure excluded from dot-bracket notation: {pk_list}") + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 50a3903370a6 macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Sun Jan 26 08:45:36 2025 +0000 @@ -0,0 +1,16 @@ + + RNAformer + 1.0.0 + 22.05 + + + rnaformer + + + + + + 10.1101/2024.02.12.579881 + + + \ No newline at end of file diff -r 000000000000 -r 50a3903370a6 test-data/fasta_input1.fa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/fasta_input1.fa Sun Jan 26 08:45:36 2025 +0000 @@ -0,0 +1,4 @@ +>Anolis_caro_chrUn_GL343590.trna2_AlaAGC (218800-218872) Ala (AGC) 73 bp Sc: 49.55 +UGGGAAUUAGCUCAAAUGGUAGAGCGCUCGCUUAGCAUGUGAGAGGUAGUGGGAUCGAUGCCCACAUUCUCCA +>Anolis_caro_chrUn_GL343207.trna3_AlaAGC (1513626-1513698) Ala (AGC) 73 bp Sc: 56.15 +GGGGAAUUAGCUCAAAUGGUAGAGCGCUCGCUUAGCAUGCGAGAGGUAGCGGGAUUGAUGCCCGCAUUCUCCA diff -r 000000000000 -r 50a3903370a6 test-data/fasta_input_false1.fa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/fasta_input_false1.fa Sun Jan 26 08:45:36 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 000000000000 -r 50a3903370a6 test-data/rna_2d_pred_FASTA.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/rna_2d_pred_FASTA.txt Sun Jan 26 08:45:36 2025 +0000 @@ -0,0 +1,8 @@ +UGGGAAUUAGCUCAAAUGGUAGAGCGCUCGCUUAGCAUGUGAGAGGUAGUGGGAUCGAUGCCCACAUUCUCCA +Base pairs: [[0, 71], [1, 70], [2, 69], [3, 68], [4, 67], [5, 66], [6, 65], [7, 13], [7, 14], [7, 20], [7, 47], [8, 22], [9, 24], [9, 44], [10, 23], [11, 22], [12, 21], [13, 7], [13, 20], [17, 54], [18, 55], [20, 7], [21, 12], [21, 45], [22, 8], [22, 11], [23, 10], [24, 9], [25, 43], [26, 42], [27, 41], [28, 40], [29, 39], [30, 38], [31, 37], [32, 36], [36, 32], [37, 31], [38, 30], [39, 29], [40, 28], [41, 27], [42, 26], [43, 25], [44, 9], [45, 21], [48, 64], [49, 63], [50, 62], [51, 61], [52, 60], [53, 57], [54, 17], [55, 18], [57, 53], [60, 52], [61, 51], [62, 50], [63, 49], [64, 48], [65, 6], [66, 5], [67, 4], [68, 3], [69, 2], [70, 1], [71, 0]] +Predicted Structure: (((((((((((.()...((..))))((((((((...))))))))....(((((()).)..)))))))))))). +NOTE: 39 pseudoknots and/or multiplets present in predicted structure excluded from dot-bracket notation: [[7, 14], [7, 20], [7, 47], [9, 44], [11, 22], [13, 7], [13, 20], [20, 7], [21, 12], [21, 45], [22, 8], [22, 11], [23, 10], [24, 9], [36, 32], [37, 31], [38, 30], [39, 29], [40, 28], [41, 27], [42, 26], [43, 25], [44, 9], [45, 21], [54, 17], [55, 18], [57, 53], [60, 52], [61, 51], [62, 50], [63, 49], [64, 48], [65, 6], [66, 5], [67, 4], [68, 3], [69, 2], [70, 1], [71, 0]] +GGGGAAUUAGCUCAAAUGGUAGAGCGCUCGCUUAGCAUGCGAGAGGUAGCGGGAUUGAUGCCCGCAUUCUCCA +Base pairs: [[0, 71], [1, 70], [2, 69], [3, 68], [4, 67], [5, 66], [6, 65], [7, 13], [7, 14], [7, 20], [8, 22], [9, 24], [9, 44], [10, 23], [11, 22], [12, 21], [13, 7], [13, 20], [14, 7], [20, 7], [20, 13], [21, 12], [21, 45], [22, 8], [22, 11], [23, 10], [24, 9], [25, 43], [26, 42], [27, 41], [28, 40], [29, 39], [30, 38], [31, 37], [36, 32], [37, 31], [38, 30], [39, 29], [40, 28], [41, 27], [42, 26], [43, 25], [44, 9], [45, 21], [48, 64], [49, 63], [50, 62], [51, 61], [52, 60], [60, 52], [61, 51], [62, 50], [63, 49], [64, 48], [65, 6], [66, 5], [67, 4], [68, 3], [69, 2], [70, 1], [71, 0]] +Predicted Structure: (((((((((((.().......))))((((((()...()))))))....(((((.......)))))))))))). +NOTE: 36 pseudoknots and/or multiplets present in predicted structure excluded from dot-bracket notation: [[7, 14], [7, 20], [9, 44], [11, 22], [13, 7], [13, 20], [14, 7], [20, 7], [20, 13], [21, 12], [21, 45], [22, 8], [22, 11], [23, 10], [24, 9], [37, 31], [38, 30], [39, 29], [40, 28], [41, 27], [42, 26], [43, 25], [44, 9], [45, 21], [60, 52], [61, 51], [62, 50], [63, 49], [64, 48], [65, 6], [66, 5], [67, 4], [68, 3], [69, 2], [70, 1], [71, 0]] diff -r 000000000000 -r 50a3903370a6 test-data/rna_2d_pred_out.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/rna_2d_pred_out.txt Sun Jan 26 08:45:36 2025 +0000 @@ -0,0 +1,4 @@ +GCCCGCAUGGUGAAAUCGGUAAACACAUCGCACUAAUGCGCCGCCUCUGGCUUGCCGGUUCAAGUCCGGCUGCGGGCACCA +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 000000000000 -r 50a3903370a6 test-data/rna_2d_pred_text.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/rna_2d_pred_text.txt Sun Jan 26 08:45:36 2025 +0000 @@ -0,0 +1,4 @@ +GCCCGCAUGGUGAAAUCGGUAAACACAUCGCACUAAUGCGCCGCCUCUGGCUUGCCGGUUCAAGUCCGGCUGCGGGCACCA +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]]