From: Michele C. <mc...@us...> - 2003-04-19 15:53:38
|
Update of /cvsroot/gmod/apollo/src/java/jalview/datamodel In directory sc8-pr-cvs1:/tmp/cvs-serv1789/jalview/datamodel Modified Files: CondensedAlignment.java Log Message: Ok - genomic is in and looks fine for ensembl Game looks mostly fine but there are problems with odd off by ones which I'll sort out tomorrow. Reverse strand display is not reversed fully - i.e. it is displayed as it is in the main panel. This is presumably what we want to see i.e. if the main panel is revcomped we want to see revcomp. Index: CondensedAlignment.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/jalview/datamodel/CondensedAlignment.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CondensedAlignment.java 19 Apr 2003 15:03:30 -0000 1.4 --- CondensedAlignment.java 19 Apr 2003 15:53:34 -0000 1.5 *************** *** 11,14 **** --- 11,16 ---- import jalview.gui.DrawableSequence; + import org.bdgp.util.DNAUtils; + public class CondensedAlignment { *************** *** 235,238 **** --- 237,241 ---- apollo.datamodel.SequenceI genseq = null; + int strand = 1; while (en.hasMoreElements()) { *************** *** 264,271 **** apollo.datamodel.FeaturePair fp = (apollo.datamodel.FeaturePair)arr.get(i); ! if (genseq != null) { genseq = fp.getRefSequence(); System.out.println("Sequence " + genseq.getLength()); } --- 267,277 ---- apollo.datamodel.FeaturePair fp = (apollo.datamodel.FeaturePair)arr.get(i); ! if (genseq == null) { genseq = fp.getRefSequence(); + if (fp.getStrand() == -1) { + strand = -1; + } System.out.println("Sequence " + genseq.getLength()); } *************** *** 334,339 **** } - - StringBuffer tmpstring = new StringBuffer(); --- 340,343 ---- *************** *** 436,443 **** } - jalview.datamodel.Sequence[] seqarr = new jalview.datamodel.Sequence[seqs.size()]; ! for (int i = 0; i < seqs.size(); i++) { ! seqarr[i] = (jalview.datamodel.Sequence)seqs.get(i); } --- 440,479 ---- } ! // Now generate the genomic sequence ! ! ! StringBuffer genstr = new StringBuffer(); ! ! for (int j = 0; j < blocks.size(); j++) { ! ! int blockstart = ((Integer)starts.get(j)).intValue(); ! int blockend = ((Integer)ends.get(j)).intValue(); ! ! // blockstart -= pad; ! //blockend += pad; ! ! if (blockstart < 1) { blockstart = 1;} ! ! System.out.println("Blockstart/end" + blockstart + " " + blockend); ! String tmp = genseq.getResidues(blockstart,blockend-1); ! if (strand == -1) { ! tmp = DNAUtils.complement(tmp); ! } ! genstr.append(tmp); ! ! ! for (int k = 0; k < intron; k++) { ! genstr.append("-"); ! } ! ! } ! ! jalview.datamodel.Sequence[] seqarr = new jalview.datamodel.Sequence[seqs.size()+1]; ! ! seqarr[0] = new jalview.datamodel.Sequence("GENOMIC",genstr.toString(),1,genstr.toString().length()); ! ! for (int i = 1; i <= seqs.size(); i++) { ! seqarr[i] = (jalview.datamodel.Sequence)seqs.get(i-1); } |