Discussion:
[Jalview-discuss] Changing Protein to Nucleotide Sequence
Vonyx Crystal
2018-06-13 18:02:00 UTC
Permalink
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
Mungo Carstairs (Staff)
2018-06-14 08:59:19 UTC
Permalink
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<https://issues.jalview.org/browse/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




[University of Dundee shield logo]<http://uod.ac.uk/sig-home>

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<http://www.jalview.org>

www.compbio.dundee.ac.uk<http://www.compbio.dundee.ac.uk>
***@dundee.ac.uk<mailto:***@dundee.ac.uk>



[University of Dundee Facebook]<http://uod.ac.uk/sig-fb> [University of Dundee Twitter] <http://uod.ac.uk/sig-tw> [University of Dundee LinkedIn] <http://uod.ac.uk/sig-li> [University of Dundee YouTube] <http://uod.ac.uk/sig-yt> [University of Dundee Instagram] <http://uod.ac.uk/sig-ig> [University of Dundee Snapchat] <http://uod.ac.uk/sig-sc>
We're Scottish University of the Year again!<http://uod.ac.uk/sig-strapline>
The Times / Sunday Times Good University Guide 2016 and 2017
________________________________
From: jalview-discuss-***@jalview.org <jalview-discuss-***@jalview.org> on behalf of Vonyx Crystal <***@gmail.com>
Sent: 13 June 2018 19:02:00
To: jalview-***@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
Mungo Carstairs (Staff)
2018-06-15 09:57:02 UTC
Permalink
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."




[University of Dundee shield logo]<http://uod.ac.uk/sig-home>

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<http://www.jalview.org>

www.compbio.dundee.ac.uk<http://www.compbio.dundee.ac.uk>
***@dundee.ac.uk<mailto:***@dundee.ac.uk>



[University of Dundee Facebook]<http://uod.ac.uk/sig-fb> [University of Dundee Twitter] <http://uod.ac.uk/sig-tw> [University of Dundee LinkedIn] <http://uod.ac.uk/sig-li> [University of Dundee YouTube] <http://uod.ac.uk/sig-yt> [University of Dundee Instagram] <http://uod.ac.uk/sig-ig> [University of Dundee Snapchat] <http://uod.ac.uk/sig-sc>
We're Scottish University of the Year again!<http://uod.ac.uk/sig-strapline>
The Times / Sunday Times Good University Guide 2016 and 2017
________________________________
From: jalview-discuss-***@jalview.org <jalview-discuss-***@jalview.org> on behalf of Mungo Carstairs (Staff) <***@dundee.ac.uk>
Sent: 14 June 2018 09:59:19
To: Vonyx Crystal; jalview-***@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<https://issues.jalview.org/browse/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




[University of Dundee shield logo]<http://uod.ac.uk/sig-home>

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<http://www.jalview.org>

www.compbio.dundee.ac.uk<http://www.compbio.dundee.ac.uk>
***@dundee.ac.uk<mailto:***@dundee.ac.uk>



[University of Dundee Facebook]<http://uod.ac.uk/sig-fb> [University of Dundee Twitter] <http://uod.ac.uk/sig-tw> [University of Dundee LinkedIn] <http://uod.ac.uk/sig-li> [University of Dundee YouTube] <http://uod.ac.uk/sig-yt> [University of Dundee Instagram] <http://uod.ac.uk/sig-ig> [University of Dundee Snapchat] <http://uod.ac.uk/sig-sc>
We're Scottish University of the Year again!<http://uod.ac.uk/sig-strapline>
The Times / Sunday Times Good University Guide 2016 and 2017
________________________________
From: jalview-discuss-***@jalview.org <jalview-discuss-***@jalview.org> on behalf of Vonyx Crystal <***@gmail.com>
Sent: 13 June 2018 19:02:00
To: jalview-***@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
Continue reading on narkive:
Loading...