Skip to content

Commit 17564f5

Browse files
Remove amino acid placeholder from tRNA structure JSONs
The ensure_cca_tail() function in generate_svgs.py appended a lowercase 'a' after CCA as an amino acid attachment placeholder. This extra nucleotide was rendered by R2R and parsed into JSON as an uppercase "A", causing structure diagrams to display "CCAA" instead of "CCA". The placeholder is no longer needed since add_end_labels() in R handles the amino acid label post-hoc. Also fix odds_ratios_filtered path in structure vignette. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e57f726 commit 17564f5

File tree

133 files changed

+138
-2248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+138
-2248
lines changed

data-raw/structures/generate_svgs.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,23 +442,19 @@ def postprocess_svg(svg_content: str, trna_name: str) -> str:
442442

443443

444444
def ensure_cca_tail(sequence: str, structure: str) -> tuple[str, str]:
445-
"""Append CCA tail and amino acid placeholder to sequence if missing.
445+
"""Append CCA tail to sequence if missing.
446446
447447
Most eukaryotic tRNAs in genomic sequences lack the post-transcriptionally
448-
added CCA tail. We add it plus a lowercase 'a' placeholder for the amino
449-
acid attachment site. This extra position can be used to visualize
450-
aminoacylation state alongside modification data.
448+
added CCA tail. We add it as unpaired nucleotides so the structure diagram
449+
includes the full mature tRNA sequence.
451450
"""
452451
upper_seq = sequence.upper()
453452
if upper_seq.endswith("CCA"):
454-
# Already has CCA, just add amino acid placeholder
455-
sequence = sequence + "a"
456-
structure = structure + "."
457453
return sequence, structure
458454

459-
# Append CCA + amino acid placeholder as unpaired nucleotides
460-
sequence = sequence + "CCAa"
461-
structure = structure + "...."
455+
# Append CCA as unpaired nucleotides
456+
sequence = sequence + "CCA"
457+
structure = structure + "..."
462458
return sequence, structure
463459

464460

inst/extdata/structures/Escherichia_coli/tRNA-Ala-GGC.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,6 @@
455455
"x": 84.16,
456456
"y": 29.06,
457457
"pos": 76
458-
},
459-
{
460-
"base": "A",
461-
"x": 84.16,
462-
"y": 21.5,
463-
"pos": 77
464458
}
465459
],
466460
"width": 154.67,
@@ -469,4 +463,4 @@
469463
"trna_name": "tRNA-Ala-GGC",
470464
"sequence": "GGGGCUAUAGCUCAGCUGGGAGAGCGCUUGCAUGGCAUGCAAGAGGUCAGCGGUUCGAUCCCGCUUAGCUCCACCA",
471465
"structure": "<<<<<<<..<<<<........>>>>.<<<<<.......>>>>>.....<<<<<.......>>>>>>>>>>>>...."
472-
}
466+
}

inst/extdata/structures/Escherichia_coli/tRNA-Ala-TGC.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,6 @@
455455
"x": 84.16,
456456
"y": 29.06,
457457
"pos": 76
458-
},
459-
{
460-
"base": "A",
461-
"x": 84.16,
462-
"y": 21.5,
463-
"pos": 77
464458
}
465459
],
466460
"width": 154.67,
@@ -469,4 +463,4 @@
469463
"trna_name": "tRNA-Ala-TGC",
470464
"sequence": "GGGGCUAUAGCUCAGCUGGGAGAGCGCCUGCUUUGCACGCAGGAGGUCUGCGGUUCGAUCCCGCAUAGCUCCACCA",
471465
"structure": "<<<<<<<..<<<<........>>>>.<<<<<.......>>>>>.....<<<<<.......>>>>>>>>>>>>...."
472-
}
466+
}

inst/extdata/structures/Escherichia_coli/tRNA-Arg-ACG.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,6 @@
461461
"x": 87.22,
462462
"y": 29.06,
463463
"pos": 77
464-
},
465-
{
466-
"base": "A",
467-
"x": 87.22,
468-
"y": 21.5,
469-
"pos": 78
470464
}
471465
],
472466
"width": 157.73,
@@ -475,4 +469,4 @@
475469
"trna_name": "tRNA-Arg-ACG",
476470
"sequence": "GCAUCCGUAGCUCAGCUGGAUAGAGUACUCGGCUACGAACCGAGCGGUCGGAGGUUCGAAUCCUCCCGGAUGCACCA",
477471
"structure": "<<<<<<<..<<<<.........>>>>.<<<<<.......>>>>>.....<<<<<.......>>>>>>>>>>>>...."
478-
}
472+
}

inst/extdata/structures/Escherichia_coli/tRNA-Arg-CCG.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,6 @@
461461
"x": 87.22,
462462
"y": 29.06,
463463
"pos": 77
464-
},
465-
{
466-
"base": "A",
467-
"x": 87.22,
468-
"y": 21.5,
469-
"pos": 78
470464
}
471465
],
472466
"width": 157.73,
@@ -475,4 +469,4 @@
475469
"trna_name": "tRNA-Arg-CCG",
476470
"sequence": "GCGCCCGUAGCUCAGCUGGAUAGAGCGCUGCCCUCCGGAGGCAGAGGUCUCAGGUUCGAAUCCUGUCGGGCGCGCCA",
477471
"structure": "<<<<<<<..<<<<.........>>>>.<<<<<.......>>>>>.....<<<<<.......>>>>>>>>>>>>...."
478-
}
472+
}

inst/extdata/structures/Escherichia_coli/tRNA-Arg-CCT.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,6 @@
449449
"x": 84.16,
450450
"y": 29.06,
451451
"pos": 75
452-
},
453-
{
454-
"base": "A",
455-
"x": 84.16,
456-
"y": 21.5,
457-
"pos": 76
458452
}
459453
],
460454
"width": 154.67,
@@ -463,4 +457,4 @@
463457
"trna_name": "tRNA-Arg-CCT",
464458
"sequence": "GUCCUCUUAGUUAAAUGGAUAUAACGAGCCCCUCCUAAGGGCUAAUUGCAGGUUCGAUUCCUGCAGGGGACACCA",
465459
"structure": "<<<<<<<..<<<<........>>>>.<<<<<.......>>>>>....<<<<<.......>>>>>>>>>>>>...."
466-
}
460+
}

inst/extdata/structures/Escherichia_coli/tRNA-Arg-TCT.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,6 @@
461461
"x": 87.22,
462462
"y": 29.06,
463463
"pos": 77
464-
},
465-
{
466-
"base": "A",
467-
"x": 87.22,
468-
"y": 21.5,
469-
"pos": 78
470464
}
471465
],
472466
"width": 157.73,
@@ -475,4 +469,4 @@
475469
"trna_name": "tRNA-Arg-TCT",
476470
"sequence": "GCGCCCUUAGCUCAGUUGGAUAGAGCAACGACCUUCUAAGUCGUGGGCCGCAGGUUCGAAUCCUGCAGGGCGCGCCA",
477471
"structure": "<<<<<<<..<<<<.........>>>>.<<<<<.......>>>>>.....<<<<<.......>>>>>>>>>>>>...."
478-
}
472+
}

inst/extdata/structures/Escherichia_coli/tRNA-Asn-GTT.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,6 @@
455455
"x": 84.16,
456456
"y": 29.06,
457457
"pos": 76
458-
},
459-
{
460-
"base": "A",
461-
"x": 84.16,
462-
"y": 21.5,
463-
"pos": 77
464458
}
465459
],
466460
"width": 154.67,
@@ -469,4 +463,4 @@
469463
"trna_name": "tRNA-Asn-GTT",
470464
"sequence": "UCCUCUGUAGUUCAGUCGGUAGAACGGCGGACUGUUAAUCCGUAUGUCACUGGUUCGAGUCCAGUCAGAGGAGCCA",
471465
"structure": "<<<<<<<..<<<<........>>>>.<<<<<.......>>>>>.....<<<<<.......>>>>>>>>>>>>...."
472-
}
466+
}

inst/extdata/structures/Escherichia_coli/tRNA-Asp-GTC.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,6 @@
461461
"x": 87.22,
462462
"y": 29.06,
463463
"pos": 77
464-
},
465-
{
466-
"base": "A",
467-
"x": 87.22,
468-
"y": 21.5,
469-
"pos": 78
470464
}
471465
],
472466
"width": 157.73,
@@ -475,4 +469,4 @@
475469
"trna_name": "tRNA-Asp-GTC",
476470
"sequence": "GGAGCGGUAGUUCAGUCGGUUAGAAUACCUGCCUGUCACGCAGGGGGUCGCGGGUUCGAGUCCCGUCCGUUCCGCCA",
477471
"structure": "<<<<<<<..<<<<.........>>>>.<<<<<.......>>>>>.....<<<<<.......>>>>>>>>>>>>...."
478-
}
472+
}

inst/extdata/structures/Escherichia_coli/tRNA-Cys-GCA.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,6 @@
443443
"x": 82.21,
444444
"y": 29.06,
445445
"pos": 74
446-
},
447-
{
448-
"base": "A",
449-
"x": 82.21,
450-
"y": 21.5,
451-
"pos": 75
452446
}
453447
],
454448
"width": 152.71,
@@ -457,4 +451,4 @@
457451
"trna_name": "tRNA-Cys-GCA",
458452
"sequence": "GGCGCGUUAACAAAGCGGUUAUGUAGCGGAUUGCAAAUCCGUCUAGUCCGGUUCGACUCCGGAACGCGCCUCCA",
459453
"structure": "<<<<<<<..<<<<.......>>>>.<<<<<.......>>>>>....<<<<<.......>>>>>>>>>>>>...."
460-
}
454+
}

0 commit comments

Comments
 (0)