Post

2 followers Follow
0
Avatar

Consensus sequence in Alignment document.

I'm appending some special nucleotide sequences (containing gaps) into an alignment document.The new sequences are optimized sequences based on the originals but their bases are changed occasionally.

I need to build and display a COnsensus based on the optimized sequences but not on the original sequences. I managed to produce this Optimized Consensus sequence and append it to the Alignment document. The problem is with the initial Consensus sequence shown as first element of the view. It appears that it gets automatically modified using ALL  sequences (original +  the generated ones).  That is different from my newly generated optimized Consensus sequence. 

Is there any way to replace the original Consensus sequence Graph with mine that refers only some of the sequences shown on the screen?

 

I hope this makes it clear: s1 to s8 are original sequences, 10 to 17 are the ones generated in code along with Optimized Consensus.

As you could see, the default generated Consensus has a Y in position 18 while the optimized Consensus a T. The Generated consensus is correct in this instance while the default one is not and that's why I want to replace the default one with the generated one.

 

And I wish you a fast recovery from the recent natural events.

 

 

Cheers,

Adrian

 

 

 

Adrian

Please sign in to leave a comment.

5 comments

0
Avatar

Hi Adrian,

The consensus displayed at the top of the alignment is a dynamic consensus so you are unable to assign it to have a fixed sequence. I recommend you instead try one of the following options

1) It feels wrong to me to be generating an alignment containing a mixture of original and optimized sequences. How about generating an alignment of only optimized sequences, but add annotations to each optimized nucleotide to indicate that it has changed. Use for example annotations of type SequenceAnnotation.TYPE_EDITING_HISTORY_REPLACEMENT.

2) If you really want a mixture of optimized and unoptimized sequences in the alignment, you could add the "Unoptimized Consensus" as yet another sequence in your alignment and tell the user to turn off the automatically generated consensus.

3) You could call SequenceDocument.setFiedValue(DocumentField.NUMBER_OF_MAPPED_LOCATIONS,2) on sequences that you don't want to contribute to the automatically generated consensus. The consensus options will then have a setting called 'Ignore reads mapped to multiple locations' which you can turn on.

Best regards,
Matt.

Geneious Team 0 votes
Comment actions Permalink
0
Avatar

Hi Matt,

 

 

Thank you for your answer. I'll reply to the point directly for clarity.

1. I did put the annotations as you could see in the picture (optimized_codon and TYPE_EDITING_HISTORY_REPLACEMENT is also a good choice) but the user wants to also see the original sequence. In addition to that, I need to add some calculated oligos underneath so clearly I need to scope what goes in the consensus.

 

2. I did this but it would be so much better to be able to hook in my calculation method to be called in a dynamic way. Is there any way to do that?

 

3.  I tried this and it seems to work but it also seems to be sensitive to the place I call it. Would it be possible to set 'Ignore reads mapped to multiple locations' programatically? One less thing to document and ask of the biologists in this sequence.

 

 

Best regards,

Adrian

Adrian 0 votes
Comment actions Permalink
0
Avatar

Hi Adrian,

2. Sorry, but I can't think of a way to have the two dynamically generated consensus sequences in one alignment.

3. This should do it:
Preferences.userRoot().node("com/biomatters/geneious/publicapi/plugin/Options/com/biomatters/geneious/common/consensusSequence/ConsensusOptions").putBoolean("ignoreReadsMappedToMultipleLocations",true);

Best regards,
Matt.

Geneious Team 0 votes
Comment actions Permalink
0
Avatar

Hi Matt,

 

 

Thank you for the info in setting the preferences. It worked and it might be good for some other settings.

 

For the dynamic Consensus sequencem I am not looking to have 2 in the same time but rather to override the default one with an custom calculation that returns a sequence.

 

Cheers,

Adrian

Adrian 0 votes
Comment actions Permalink
0
Avatar

Hi Adrian,

 

Sorry, but unfortunately you can't override the dynamic consensus calculation.

 

Best regards,

Matt.

Geneious Team 0 votes
Comment actions Permalink