X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FDna.java;h=9f3a8d020b14342fac880beada644f5938ba91e5;hb=22445eedc735ed8f51e5993318301ee9c3614635;hp=5ff6751450507150237ee1bc16a5d1fc49168302;hpb=1e5fe67a3cfd5b0dbae0847d3cff7dc93c31f174;p=jalview.git
diff --git a/src/jalview/analysis/Dna.java b/src/jalview/analysis/Dna.java
index 5ff6751..9f3a8d0 100644
--- a/src/jalview/analysis/Dna.java
+++ b/src/jalview/analysis/Dna.java
@@ -1,20 +1,19 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
*/
package jalview.analysis;
@@ -85,7 +84,7 @@ public class Dna
* @param annotations
* @param aWidth
* @param dataset
- * destination dataset for translated sequences and mappings
+ * destination dataset for translated sequences and mappings
* @return
*/
public static AlignmentI CdnaTranslate(SequenceI[] selection,
@@ -100,9 +99,9 @@ public class Dna
*
* @param selection
* @param seqstring
- * @param product -
- * array of DbRefEntry objects from which exon map in seqstring
- * is derived
+ * @param product
+ * - array of DbRefEntry objects from which exon map in seqstring is
+ * derived
* @param viscontigs
* @param gapCharacter
* @param annotations
@@ -128,7 +127,7 @@ public class Dna
SequenceI newseq = translateCodingRegion(selection[s], seqstring[s],
viscontigs, codons, gapCharacter,
(product != null) ? product[s] : null); // possibly anonymous
- // product
+ // product
if (newseq != null)
{
pepseqs.addElement(newseq);
@@ -215,7 +214,7 @@ public class Dna
* @param viscontigs
* @param gapCharacter
* @param dataset
- * destination dataset for translated sequences
+ * destination dataset for translated sequences
* @param annotations
* @param aWidth
* @return
@@ -364,42 +363,45 @@ public class Dna
{
// Have a look at all the codon positions for annotation and put the first
// one found into the translated annotation pos.
- int contrib=0;
+ int contrib = 0;
Annotation annot = null;
for (int p = 0; p < 3; p++)
{
if (annotations[is[p]] != null)
{
- if (annot==null) {
+ if (annot == null)
+ {
annot = new Annotation(annotations[is[p]]);
contrib = 1;
- } else {
+ }
+ else
+ {
// merge with last
Annotation cpy = new Annotation(annotations[is[p]]);
- if (annot.colour==null)
+ if (annot.colour == null)
{
annot.colour = cpy.colour;
}
- if (annot.description==null || annot.description.length()==0)
+ if (annot.description == null || annot.description.length() == 0)
{
annot.description = cpy.description;
}
- if (annot.displayCharacter==null)
+ if (annot.displayCharacter == null)
{
annot.displayCharacter = cpy.displayCharacter;
}
- if (annot.secondaryStructure==0)
+ if (annot.secondaryStructure == 0)
{
annot.secondaryStructure = cpy.secondaryStructure;
}
- annot.value+=cpy.value;
+ annot.value += cpy.value;
contrib++;
}
}
}
- if (contrib>1)
+ if (contrib > 1)
{
- annot.value/=(float)contrib;
+ annot.value /= (float) contrib;
}
return annot;
}
@@ -408,14 +410,13 @@ public class Dna
* Translate a na sequence
*
* @param selection
- * sequence displayed under viscontigs visible columns
+ * sequence displayed under viscontigs visible columns
* @param seqstring
- * ORF read in some global alignment reference frame
+ * ORF read in some global alignment reference frame
* @param viscontigs
- * mapping from global reference frame to visible seqstring ORF
- * read
+ * mapping from global reference frame to visible seqstring ORF read
* @param codons
- * Definition of global ORF alignment reference frame
+ * Definition of global ORF alignment reference frame
* @param gapCharacter
* @param newSeq
* @return sequence ready to be added to alignment.
@@ -547,8 +548,9 @@ public class Dna
}
if (aspos >= codons.aaWidth)
{
- // update maximum alignment width
- // (we can do this without calling checkCodonFrameWidth because it was already done above)
+ // update maximum alignment width
+ // (we can do this without calling checkCodonFrameWidth because it was
+ // already done above)
codons.setAaWidth(aspos);
}
// ready for next translated reading frame alignment position (if any)
@@ -557,8 +559,8 @@ public class Dna
}
if (resSize > 0)
{
- SequenceI newseq = new Sequence(selection.getName(), protein
- .toString());
+ SequenceI newseq = new Sequence(selection.getName(),
+ protein.toString());
if (rf != 0)
{
jalview.bin.Cache.log
@@ -617,14 +619,13 @@ public class Dna
* new ranges to exclude untranslated regions. if (skip.size()>0) {
* Vector narange = new Vector(); for (vc=0; vc=skipint[0] && iv[0]<=skipint[1]) { if (iv[0]==skipint[0]) { //
- * delete beginning of range } else { // truncate range and create new
- * one if necessary iv = (int[]) narange.elementAt(vc+1); if (iv[0]<=skipint[1]) { //
- * truncate range iv[0] = skipint[1]; } else {
- * } } } else if (iv[0]=skipint[0] &&
+ * iv[0]<=skipint[1]) { if (iv[0]==skipint[0]) { // delete beginning of
+ * range } else { // truncate range and create new one if necessary iv =
+ * (int[]) narange.elementAt(vc+1); if (iv[0]<=skipint[1]) { // truncate
+ * range iv[0] = skipint[1]; } else { } } } else if (iv[0]