&& !al.getCodonFrames().isEmpty())
{
/*
- * fudge - check first mapping is protein-to-nucleotide
+ * fudge - check first for protein-to-nucleotide mappings
* (we don't want to do this for protein-to-protein)
*/
- AlignedCodonFrame mapping = al.getCodonFrames().iterator().next();
- // TODO hold mapping type e.g. dna-to-protein in AlignedCodonFrame?
- MapList[] mapLists = mapping.getdnaToProt();
- // mapLists can be empty if project load has not finished resolving seqs
- if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3)
+ boolean doConsensus = false;
+ for (AlignedCodonFrame mapping : al.getCodonFrames())
+ {
+ // TODO hold mapping type e.g. dna-to-protein in AlignedCodonFrame?
+ MapList[] mapLists = mapping.getdnaToProt();
+ // mapLists can be empty if project load has not finished resolving seqs
+ if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3)
+ {
+ doConsensus = true;
+ break;
+ }
+ }
+ if (doConsensus)
{
if (calculator
.getRegisteredWorkersOfClass(ComplementConsensusThread.class) == null)
.getCodonFrames();
if (codonMappings != null && !codonMappings.isEmpty())
{
- // fudge: check mappings are not protein-to-protein
- // TODO: nicer
- AlignedCodonFrame mapping = codonMappings.iterator().next();
- MapList[] mapLists = mapping.getdnaToProt();
- // mapLists can be empty if project load has not finished resolving seqs
- if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3)
+ boolean doConsensus = false;
+ for (AlignedCodonFrame mapping : codonMappings)
+ {
+ // TODO hold mapping type e.g. dna-to-protein in AlignedCodonFrame?
+ MapList[] mapLists = mapping.getdnaToProt();
+ // mapLists can be empty if project load has not finished resolving
+ // seqs
+ if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3)
+ {
+ doConsensus = true;
+ break;
+ }
+ }
+ if (doConsensus)
{
complementConsensus = new AlignmentAnnotation("cDNA Consensus",
"PID for cDNA", new Annotation[1], 0f, 100f,