git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3107 update any group associated annotation rows when a new group is created
[jalview.git]
/
src
/
jalview
/
analysis
/
AlignmentUtils.java
diff --git
a/src/jalview/analysis/AlignmentUtils.java
b/src/jalview/analysis/AlignmentUtils.java
index
dfb185a
..
343ebc7
100644
(file)
--- a/
src/jalview/analysis/AlignmentUtils.java
+++ b/
src/jalview/analysis/AlignmentUtils.java
@@
-1833,7
+1833,7
@@
public class AlignmentUtils
* @param seqMappings
* the set of mappings involving dnaSeq
* @param aMapping
* @param seqMappings
* the set of mappings involving dnaSeq
* @param aMapping
- * an initial candidate from seqMappings
+ * a transcript-to-peptide mapping
* @return
*/
static SequenceI findCdsForProtein(List<AlignedCodonFrame> mappings,
* @return
*/
static SequenceI findCdsForProtein(List<AlignedCodonFrame> mappings,
@@
-1858,7
+1858,15
@@
public class AlignmentUtils
if (mappedFromLength == dnaLength
|| mappedFromLength == dnaLength - CODON_LENGTH)
{
if (mappedFromLength == dnaLength
|| mappedFromLength == dnaLength - CODON_LENGTH)
{
- return seqDss;
+ /*
+ * if sequence has CDS features, this is a transcript with no UTR
+ * - do not take this as the CDS sequence! (JAL-2789)
+ */
+ if (seqDss.getFeatures().getFeaturesByOntology(SequenceOntologyI.CDS)
+ .isEmpty())
+ {
+ return seqDss;
+ }
}
/*
}
/*
@@
-1883,10
+1891,12
@@
public class AlignmentUtils
{
/*
* found a 3:1 mapping to the protein product which covers
{
/*
* found a 3:1 mapping to the protein product which covers
- * the whole dna sequence i.e. is from CDS; finally check it
- * is from the dna start sequence
+ * the whole dna sequence i.e. is from CDS; finally check the CDS
+ * is mapped from the given dna start sequence
*/
SequenceI cdsSeq = map.getFromSeq();
*/
SequenceI cdsSeq = map.getFromSeq();
+ // todo this test is weak if seqMappings contains multiple mappings;
+ // we get away with it if transcript:cds relationship is 1:1
List<AlignedCodonFrame> dnaToCdsMaps = MappingUtils
.findMappingsForSequence(cdsSeq, seqMappings);
if (!dnaToCdsMaps.isEmpty())
List<AlignedCodonFrame> dnaToCdsMaps = MappingUtils
.findMappingsForSequence(cdsSeq, seqMappings);
if (!dnaToCdsMaps.isEmpty())
@@
-2180,12
+2190,13
@@
public class AlignmentUtils
int mappedDnaLength = MappingUtils.getLength(ranges);
/*
int mappedDnaLength = MappingUtils.getLength(ranges);
/*
- * if not a whole number of codons, something is wrong,
- * abort mapping
+ * if not a whole number of codons, truncate mapping
*/
*/
- if (mappedDnaLength % CODON_LENGTH > 0)
+ int codonRemainder = mappedDnaLength % CODON_LENGTH;
+ if (codonRemainder > 0)
{
{
- return null;
+ mappedDnaLength -= codonRemainder;
+ MappingUtils.removeEndPositions(codonRemainder, ranges);
}
int proteinLength = proteinSeq.getLength();
}
int proteinLength = proteinSeq.getLength();