X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FCigarArray.java;h=837a10bd3942df6240aa9ebc2e98492cae1f5ea1;hb=136c0793b90b72b928c4d77dc109dd5c644e00d3;hp=447b4d016ed31087d81502042ae89e1ebc0ebd25;hpb=95789943eb181b1768a081e779a044bf595b6bf6;p=jalview.git diff --git a/src/jalview/datamodel/CigarArray.java b/src/jalview/datamodel/CigarArray.java index 447b4d0..837a10b 100644 --- a/src/jalview/datamodel/CigarArray.java +++ b/src/jalview/datamodel/CigarArray.java @@ -1,23 +1,49 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * 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. + * + * 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 . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.datamodel; +import java.util.List; + public class CigarArray extends CigarBase { - /** - * Do CIGAR operations on a set of sequences from many other cigars - * BAD THINGS WILL HAPPEN IF A CIGARARRAY IS PASSED TO A CIGARARRAY - * or a CIGARCIGAR is given a CIGARARRAY to insert gaps into. - */ - /** - * array of subject cigars - */ - public CigarSimple refCigars[]=null; - private boolean seqcigararray=false; - private CigarArray() { + /** + * Do CIGAR operations on a set of sequences from many other cigars BAD THINGS + * WILL HAPPEN IF A CIGARARRAY IS PASSED TO A CIGARARRAY or a CIGARCIGAR is + * given a CIGARARRAY to insert gaps into. + */ + /** + * array of subject cigars + */ + public CigarSimple refCigars[] = null; + + private boolean seqcigararray = false; + + private CigarArray() + { super(); } /** * isSeqCigarArray() + * * @return boolean true if all refCigars resolve to a SeqCigar or a CigarCigar */ public boolean isSeqCigarArray() @@ -26,11 +52,14 @@ public class CigarArray extends CigarBase } /** - * Apply CIGAR operations to several cigars in parallel - * will throw an error if any of cigar are actually CigarArrays. - * @param cigar Cigar[] + * Apply CIGAR operations to several cigars in parallel will throw an error if + * any of cigar are actually CigarArrays. + * + * @param cigar + * Cigar[] */ - public CigarArray(CigarSimple[] cigars) { + public CigarArray(CigarSimple[] cigars) + { super(); seqcigararray = true; if (cigars != null && cigars.length > 0) @@ -39,79 +68,334 @@ public class CigarArray extends CigarBase for (int c = 0; c < cigars.length; c++) { refCigars[c] = cigars[c]; - if (! ( (cigars[c] instanceof SeqCigar) - || cigars[c] instanceof CigarCigar)) + if (!((cigars[c] instanceof SeqCigar) || cigars[c] instanceof CigarCigar)) { seqcigararray = false; } } } } + /** - * @see Cigar.getSequenceAndDeletions - * @param GapChar char - * @return Object[][] + * construct a cigar array from the current alignment, or just the subset of + * the current alignment specified by selectionGroup. Any columns marked as + * hidden in columnSelection will be marked as deleted in the array. + * + * @param alignment + * @param columnSelection + * @param selectionGroup */ - protected Object[][] getArrayofSequenceAndDeletions(char GapChar) { - if (refCigars == null || refCigars.length == 0 || length == 0) { - return null; - } - Object[][] sqanddels = new Object[refCigars.length][]; - for (int c=0; c