Changing genetic_code_table in Biostrings
2
0
Entering edit mode
Sam • 0
@e53caefa
Last seen 2.8 years ago
United States

Hello,

I am trying to translate a DNA sequence in Biostrings. The problem I am running into is that my DNA sequence is from an amber codon suppresor strain of E.coli. Therefore, I would like to use a genetic code table that uses X as the amino acid for TAG/UAG. Is there a way to edit the standard genetic code table in Biostrings to change TAG from a stop codon to X?

Thank you, Sam

```

Biostrings • 1.9k views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 3 days ago
United States

Yes, but only by getting the sources and changing this file, and then installing.

ADD COMMENT
0
Entering edit mode

James, Can you say more about this? Bioconductor packages are usually installed by bioc, so there is little out there on building your own package. Could you point to an explanation? Might not be the exactly correct question.

ADD REPLY
1
Entering edit mode

Sure. Here's how to do it. I am assuming you are on a Linux-like computer, or have RTools installed on Windows. Here I am being charitable and including MacOS as a Linux like computer, but you may need XCode or some other stuff that I don't care to know about if you are on that OS.

$ git clone https://git.bioconductor.org:/packages/Biostrings
Cloning into 'Biostrings'...
remote: Enumerating objects: 17997, done.
remote: Counting objects: 100% (17997/17997), done.
remote: Compressing objects: 100% (4633/4633), done.
remote: Total 17997 (delta 14546), reused 16366 (delta 13322), pack-reused 0
Receiving objects: 100% (17997/17997), 31.09 MiB | 26.12 MiB/s, done.
Resolving deltas: 100% (14546/14546), done.

## cd into the directory and checkout the release version

$ cd Biostrings/
$ git checkout RELEASE_3_14
Branch RELEASE_3_14 set up to track remote branch RELEASE_3_14 from origin.
Switched to a new branch 'RELEASE_3_14'
## Go into the R directory and change the TAG
## you could just open the GENETIC_CODE.R file in an editor and change as well,
## but is that what the cool kids do? I didn't think so
$ cd R/
$ sed -i 's/TAG="\*"/TAG="X"/' GENETIC_CODE.R
## now back out and start R
$ cd ../../
$ R

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

<snip>
## install the package. If you are on Windows, you need an additional argument of type = "source"
> install.packages("Biostrings", repos = NULL)
Installing package into ‘/share/groups/edge/R/R-4.1.2’

<snip>

* DONE (Biostrings)
## load the library
> library(Biostrings)
Loading required package: BiocGenerics
<snip>

## check the GENETIC_CODE
> Biostrings:::GENETIC_CODE
TTT TTC TTA TTG TCT TCC TCA TCG TAT TAC TAA TAG TGT TGC TGA TGG CTT CTC CTA CTG
"F" "F" "L" "L" "S" "S" "S" "S" "Y" "Y" "*" "X" "C" "C" "*" "W" "L" "L" "L" "L"
CCT CCC CCA CCG CAT CAC CAA CAG CGT CGC CGA CGG ATT ATC ATA ATG ACT ACC ACA ACG
"P" "P" "P" "P" "H" "H" "Q" "Q" "R" "R" "R" "R" "I" "I" "I" "M" "T" "T" "T" "T"
AAT AAC AAA AAG AGT AGC AGA AGG GTT GTC GTA GTG GCT GCC GCA GCG GAT GAC GAA GAG
"N" "N" "K" "K" "S" "S" "R" "R" "V" "V" "V" "V" "A" "A" "A" "A" "D" "D" "E" "E"
GGT GGC GGA GGG
"G" "G" "G" "G"
attr(,"alt_init_codons")
[1] "TTG" "CTG"
ADD REPLY
2
Entering edit mode
@herve-pages-1542
Last seen 7 days ago
Seattle, WA, United States

or you can just pass your own custom genetic code to the genetic.code argument of translate():

library(Biostrings)
my_gen_code <- GENETIC_CODE
my_gen_code["TAG"] <- "X"
translate(some_dna, genetic.code=my_gen_code)

See ?translate for more information.

H.

ADD COMMENT
0
Entering edit mode

Thank you! This worked!

ADD REPLY

Login before adding your answer.

Traffic: 408 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6