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-2789 avoid using transcript (with no UTR) as CDS sequence
[jalview.git]
/
src
/
jalview
/
analysis
/
Dna.java
diff --git
a/src/jalview/analysis/Dna.java
b/src/jalview/analysis/Dna.java
index
799a8ed
..
a10b037
100644
(file)
--- a/
src/jalview/analysis/Dna.java
+++ b/
src/jalview/analysis/Dna.java
@@
-45,7
+45,6
@@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
-import java.util.Map;
public class Dna
{
public class Dna
{
@@
-134,7
+133,8
@@
public class Dna
* @param ac2
* @return
*/
* @param ac2
* @return
*/
- private static int jalview_2_8_2compare(AlignedCodon ac1, AlignedCodon ac2)
+ private static int jalview_2_8_2compare(AlignedCodon ac1,
+ AlignedCodon ac2)
{
if (ac1 == null || ac2 == null || (ac1.equals(ac2)))
{
{
if (ac1 == null || ac2 == null || (ac1.equals(ac2)))
{
@@
-435,7
+435,8
@@
public class Dna
/*
* Filled up a reading frame...
*/
/*
* Filled up a reading frame...
*/
- AlignedCodon alignedCodon = new AlignedCodon(cdp[0], cdp[1], cdp[2]);
+ AlignedCodon alignedCodon = new AlignedCodon(cdp[0], cdp[1],
+ cdp[2]);
String aa = ResidueProperties.codonTranslate(new String(codon));
rf = 0;
final String gapString = String.valueOf(gapChar);
String aa = ResidueProperties.codonTranslate(new String(codon));
rf = 0;
final String gapString = String.valueOf(gapChar);
@@
-444,10
+445,11
@@
public class Dna
aa = gapString;
if (skipint == null)
{
aa = gapString;
if (skipint == null)
{
- skipint = new int[] { alignedCodon.pos1, alignedCodon.pos3 /*
- * cdp[0],
- * cdp[2]
- */};
+ skipint = new int[] { alignedCodon.pos1,
+ alignedCodon.pos3 /*
+ * cdp[0],
+ * cdp[2]
+ */ };
}
skipint[1] = alignedCodon.pos3; // cdp[2];
}
}
skipint[1] = alignedCodon.pos3; // cdp[2];
}
@@
-502,8
+504,8
@@
public class Dna
}
if (vc + 2 < t.length)
{
}
if (vc + 2 < t.length)
{
- System.arraycopy(scontigs, vc + 2, t, vc, t.length
- - vc + 2);
+ System.arraycopy(scontigs, vc + 2, t, vc,
+ t.length - vc + 2);
}
scontigs = t;
}
}
scontigs = t;
}
@@
-596,9
+598,9
@@
public class Dna
}
else if (!alignedCodons[aspos].equals(alignedCodon))
{
}
else if (!alignedCodons[aspos].equals(alignedCodon))
{
- throw new IllegalStateException("Tried to coalign "
- + alignedCodons[aspos].toString() + " with "
- + alignedCodon.toString());
+ throw new IllegalStateException(
+ "Tried to coalign " + alignedCodons[aspos].toString()
+ + " with " + alignedCodon.toString());
}
if (aspos >= aaWidth)
{
}
if (aspos >= aaWidth)
{
@@
-685,7
+687,7
@@
public class Dna
*/
MapList map = new MapList(scontigs, new int[] { 1, resSize }, 3, 1);
*/
MapList map = new MapList(scontigs, new int[] { 1, resSize }, 3, 1);
- transferCodedFeatures(selection, newseq, map, null, null);
+ transferCodedFeatures(selection, newseq, map);
/*
* Construct a dataset sequence for our new peptide.
/*
* Construct a dataset sequence for our new peptide.
@@
-754,25
+756,15
@@
public class Dna
/**
* Given a peptide newly translated from a dna sequence, copy over and set any
/**
* Given a peptide newly translated from a dna sequence, copy over and set any
- * features on the peptide from the DNA. If featureTypes is null, all features
- * on the dna sequence are searched (rather than just the displayed ones), and
- * similarly for featureGroups.
+ * features on the peptide from the DNA.
*
* @param dna
* @param pep
* @param map
*
* @param dna
* @param pep
* @param map
- * @param featureTypes
- * hash whose keys are the displayed feature type strings
- * @param featureGroups
- * hash where keys are feature groups and values are Boolean objects
- * indicating if they are displayed.
*/
private static void transferCodedFeatures(SequenceI dna, SequenceI pep,
*/
private static void transferCodedFeatures(SequenceI dna, SequenceI pep,
- MapList map, Map<String, Object> featureTypes,
- Map<String, Boolean> featureGroups)
+ MapList map)
{
{
- SequenceFeature[] sfs = dna.getSequenceFeatures();
- Boolean fgstate;
DBRefEntry[] dnarefs = DBRefUtils.selectRefs(dna.getDBRefs(),
DBRefSource.DNACODINGDBS);
if (dnarefs != null)
DBRefEntry[] dnarefs = DBRefUtils.selectRefs(dna.getDBRefs(),
DBRefSource.DNACODINGDBS);
if (dnarefs != null)
@@
-786,24
+778,15
@@
public class Dna
}
}
}
}
}
}
- if (sfs != null)
+ for (SequenceFeature sf : dna.getFeatures().getAllFeatures())
{
{
- for (SequenceFeature sf : sfs)
- {
- fgstate = (featureGroups == null) ? null : featureGroups
- .get(sf.featureGroup);
- if ((featureTypes == null || featureTypes.containsKey(sf.getType()))
- && (fgstate == null || fgstate.booleanValue()))
+ if (FeatureProperties.isCodingFeature(null, sf.getType()))
{
{
- if (FeatureProperties.isCodingFeature(null, sf.getType()))
+ // if (map.intersectsFrom(sf[f].begin, sf[f].end))
{
{
- // if (map.intersectsFrom(sf[f].begin, sf[f].end))
- {
- }
}
}
}
}
- }
}
}
}
}