Changing Protein to Nucleotide Sequence

Hello!

I’m trying to align RNA sequences and had a few questions. The first, currently Jalview automatically identifies sequences as DNA or RNA depending on the AGCT content. Is it possible to force Jalview to view a sequence as a nucleotide sequence rather than a protein? (like a setting or command to do so). Our sequences have metacharacters and 'N’s in them that confuses Jalview into thinking its a protein.

My second question is somewhat simple. Is there a way that Jalview can turn all the 'T’s in a sequence (DNA) into 'U’s (RNA)?

Thanks,
Vaish

Hello Vaish,

Two good questions there! The short answer is no, not at present, but we can bump and/or raise feature requests for these.

Protein / Nucleotide

You are right, Jalview ‘guesses’ nucleotide if the alignment is more than 85% ACGTU - and this doesn’t work well with lots of N’s. You can force it to nucleotide by running the following Groovy script (Tools | Groovy Console…):

def alf = Jalview.alignFrames;
alf[0].viewport.alignment.nucleotide=true
alf[0].buildColourMenu()
If you have multiple alignment windows open you may need to change alf[0] to alf[1] or other index (or loop over all). (The Help page reference to using Jalview.getCurrentAlignFrame() is not correct and won’t work.)

You should then see that

(a) nucleotide colour schemes are offered in the Colour menu and

(b) nucleotide substitution matrix is offered in the Calculate Tree or PCA dialog

Note this is only a temporary workaround, and would need to be redone, for example, after reloading the data from a saved Jalview project.

I will raise a new feature request for this in Jalview.

T/U translation

For translation of T/U, we have a feature request JAL-1000 on the books. I’ll update this for your request.

We have a package of work on RNA to get to some time when this may get done, but I can’t promise when.

The Groovy workaround for this is (adapt as required):

def replace = { jalview.datamodel.Sequence sq, String x, String y →
if (sq != null) {
str = sq.sequenceAsString
str = str.replaceAll(x, y)
sq.setSequence(str)
}
}
def alf = Jalview.alignFrames
def al = alf[0].viewport.alignment
for (seq in al.sequences) {
from = ‘U’
to = ‘T’
replace(seq, from, to)
replace(seq.datasetSequence, from, to)
}
alf[0].repaint()

Let us know if this gives any problems!

Best regards,

Mungo

The University of Dundee is a registered Scottish Charity, No: SC015096

···

Email signature

University of Dundee shield logo

Mungo Carstairs
Jalview Computational Scientist

The Barton Group
Division of Computational Biology

School of Life Sciences

University of Dundee, Dundee, Scotland, UK

www.jalview.org

www.compbio.dundee.ac.uk
g.m.carstairs@dundee.ac.uk

University of Dundee FacebookUniversity of Dundee TwitterUniversity of Dundee LinkedInUniversity of Dundee YouTubeUniversity of Dundee InstagramUniversity of Dundee Snapchat
We’re Scottish University of the Year again!
The Times / Sunday Times Good University Guide 2016 and 2017


From: jalview-discuss-bounces@jalview.org jalview-discuss-bounces@jalview.org on behalf of Vonyx Crystal vonyxcrystal@gmail.com
Sent: 13 June 2018 19:02:00
To: jalview-discuss@jalview.org
Subject: [Jalview-discuss] Changing Protein to Nucleotide Sequence

Hello!

I’m trying to align RNA sequences and had a few questions. The first, currently Jalview automatically identifies sequences as DNA or RNA depending on the AGCT content. Is it possible to force Jalview to view a sequence as a nucleotide sequence rather than a protein? (like a setting or command to do so). Our sequences have metacharacters and 'N’s in them that confuses Jalview into thinking its a protein.

My second question is somewhat simple. Is there a way that Jalview can turn all the 'T’s in a sequence (DNA) into 'U’s (RNA)?

Thanks,
Vaish

I was negligent in not adding…

“Scripting with Groovy does not provide any ‘Undo’ mechanism, and is offered ‘as is’ with no guarantees. You are advised always to checkpoint (save to Jalview project) any important analysis before running Groovy scripts, so as to provide a backout point if needed.”

···

Email signature

University of Dundee shield logo

Mungo Carstairs
Jalview Computational Scientist

The Barton Group
Division of Computational Biology

School of Life Sciences

University of Dundee, Dundee, Scotland, UK

www.jalview.org

www.compbio.dundee.ac.uk
g.m.carstairs@dundee.ac.uk

University of Dundee FacebookUniversity of Dundee TwitterUniversity of Dundee LinkedInUniversity of Dundee YouTubeUniversity of Dundee InstagramUniversity of Dundee Snapchat
We’re Scottish University of the Year again!
The Times / Sunday Times Good University Guide 2016 and 2017


From: jalview-discuss-bounces@jalview.org jalview-discuss-bounces@jalview.org on behalf of Mungo Carstairs (Staff) g.m.carstairs@dundee.ac.uk
Sent: 14 June 2018 09:59:19
To: Vonyx Crystal; jalview-discuss@jalview.org
Subject: Re: [Jalview-discuss] Changing Protein to Nucleotide Sequence

Hello Vaish,

Two good questions there! The short answer is no, not at present, but we can bump and/or raise feature requests for these.

Protein / Nucleotide

You are right, Jalview ‘guesses’ nucleotide if the alignment is more than 85% ACGTU - and this doesn’t work well with lots of N’s. You can force it to nucleotide by running the following Groovy script (Tools | Groovy Console…):

def alf = Jalview.alignFrames;
alf[0].viewport.alignment.nucleotide=true
alf[0].buildColourMenu()
If you have multiple alignment windows open you may need to change alf[0] to alf[1] or other index (or loop over all). (The Help page reference to using Jalview.getCurrentAlignFrame() is not correct and won’t work.)

You should then see that

(a) nucleotide colour schemes are offered in the Colour menu and

(b) nucleotide substitution matrix is offered in the Calculate Tree or PCA dialog

Note this is only a temporary workaround, and would need to be redone, for example, after reloading the data from a saved Jalview project.

I will raise a new feature request for this in Jalview.

T/U translation

For translation of T/U, we have a feature request JAL-1000 on the books. I’ll update this for your request.

We have a package of work on RNA to get to some time when this may get done, but I can’t promise when.

The Groovy workaround for this is (adapt as required):

def replace = { jalview.datamodel.Sequence sq, String x, String y →
if (sq != null) {
str = sq.sequenceAsString
str = str.replaceAll(x, y)
sq.setSequence(str)
}
}
def alf = Jalview.alignFrames
def al = alf[0].viewport.alignment
for (seq in al.sequences) {
from = ‘U’
to = ‘T’
replace(seq, from, to)
replace(seq.datasetSequence, from, to)
}
alf[0].repaint()

Let us know if this gives any problems!

Best regards,

Mungo

Email signature

University of Dundee shield logo

Mungo Carstairs
Jalview Computational Scientist

The Barton Group
Division of Computational Biology

School of Life Sciences

University of Dundee, Dundee, Scotland, UK

www.jalview.org

www.compbio.dundee.ac.uk
g.m.carstairs@dundee.ac.uk

University of Dundee FacebookUniversity of Dundee TwitterUniversity of Dundee LinkedInUniversity of Dundee YouTubeUniversity of Dundee InstagramUniversity of Dundee Snapchat
We’re Scottish University of the Year again!
The Times / Sunday Times Good University Guide 2016 and 2017

From: jalview-discuss-bounces@jalview.org jalview-discuss-bounces@jalview.org on behalf of Vonyx Crystal vonyxcrystal@gmail.com
Sent: 13 June 2018 19:02:00
To: jalview-discuss@jalview.org
Subject: [Jalview-discuss] Changing Protein to Nucleotide Sequence

Hello!

I’m trying to align RNA sequences and had a few questions. The first, currently Jalview automatically identifies sequences as DNA or RNA depending on the AGCT content. Is it possible to force Jalview to view a sequence as a nucleotide sequence rather than a protein? (like a setting or command to do so). Our sequences have metacharacters and 'N’s in them that confuses Jalview into thinking its a protein.

My second question is somewhat simple. Is there a way that Jalview can turn all the 'T’s in a sequence (DNA) into 'U’s (RNA)?

Thanks,
Vaish

The University of Dundee is a registered Scottish Charity, No: SC015096

The University of Dundee is a registered Scottish Charity, No: SC015096