diff --git a/etc/versions b/etc/versions index 72b839549e253da0c67ef8306edf4124e5a63bfe..93e4033bb8f9d4d8dcb245c9f9a9505431e3143d 100644 --- a/etc/versions +++ b/etc/versions @@ -1,4 +1,4 @@ -Artemis Release 14.2.5 -ACT Release 11.2.5 +Artemis Release 14.2.6 +ACT Release 11.2.6 DNAPlotter Release 1.9 BamView 1.2.8 diff --git a/lib/j2ssh/j2ssh.properties b/lib/j2ssh/j2ssh.properties index ca0823e15bf4efea23a696f4913636b6df4d57e1..eeb9581e0228ff855ca2c05ece3e212bc9c7780d 100644 --- a/lib/j2ssh/j2ssh.properties +++ b/lib/j2ssh/j2ssh.properties @@ -54,7 +54,6 @@ default_db=%uniprot_bacteria # remote directories to use as roots in the file manager remotedir.PD=/nfs/pathdata remotedir.PD2=/nfs/pathdata2 -remotedir.YP=/nfs/disk222/yeastpub # local directories to use as roots in the file manager localdir.PD=/nfs/pathdata localdir.YP=/nfs/disk222/yeastpub diff --git a/uk/ac/sanger/artemis/components/BasePlot.java b/uk/ac/sanger/artemis/components/BasePlot.java index 1d46bfb497a598e6c9c28144bd353318685422a3..16e8e70b1e36dd0e1cad44f498988dfaa75b7a42 100644 --- a/uk/ac/sanger/artemis/components/BasePlot.java +++ b/uk/ac/sanger/artemis/components/BasePlot.java @@ -725,7 +725,7 @@ public class BasePlot extends Plot if( getAlgorithm() instanceof UserDataAlgorithm && ((UserDataAlgorithm)getAlgorithm()).FORMAT == UserDataAlgorithm.TABIX_INDEXED_FORMAT) { - ((UserDataAlgorithm) getAlgorithm()).readIndexValues( + ((UserDataAlgorithm) getAlgorithm()).readIndexValues(recalculate_flag, entryGroup.getSequenceEntry(), getStart(), getEnd()); } diff --git a/uk/ac/sanger/artemis/components/BasePlotGroup.java b/uk/ac/sanger/artemis/components/BasePlotGroup.java index a17683a16cb749a6bd113ed57bb32064fbbb4554..759e613ff97c7e379ff42eaf8469b6bcf384360f 100644 --- a/uk/ac/sanger/artemis/components/BasePlotGroup.java +++ b/uk/ac/sanger/artemis/components/BasePlotGroup.java @@ -33,6 +33,7 @@ import java.awt.*; import java.util.Vector; import javax.swing.JComponent; +import javax.swing.JOptionPane; import javax.swing.JPanel; /** @@ -46,6 +47,8 @@ import javax.swing.JPanel; public class BasePlotGroup extends JPanel implements DisplayAdjustmentListener { + private static final long serialVersionUID = 1L; + /** * The EntryGroup that contains the sequence that this JComponent is * displaying. @@ -56,7 +59,7 @@ public class BasePlotGroup extends JPanel * This array contains the Algorithm objects of the BasePlot components in * this BasePlotGroup, as set by the constructor. **/ - private final Vector plot_value_producers = new Vector (); + private final Vector<BaseAlgorithm> plot_value_producers = new Vector<BaseAlgorithm> (); /** * The layout object used by this component. @@ -203,12 +206,40 @@ public class BasePlotGroup extends JPanel **/ public void displayAdjustmentValueChanged(DisplayAdjustmentEvent event) { + final StringBuffer closingPlots = new StringBuffer(); final Component[] children = getComponents(); - for(int i = 0 ; i<children.length ; ++i) { if(children[i] instanceof BasePlot) + { + // if this is an indexed sequence change hide any + // userplots that are not indexed + if(event.getType() == DisplayAdjustmentEvent.IDX_SEQUENCE_CHANGE) + { + Algorithm alg = ((BasePlot)children[i]).getAlgorithm(); + if(alg instanceof UserDataAlgorithm && + ((UserDataAlgorithm)alg).FORMAT != UserDataAlgorithm.TABIX_INDEXED_FORMAT && + findPlotByAlgorithm(alg).isVisible()) + { + closingPlots.append(alg.getAlgorithmName()+"\n"); + setVisibleByAlgorithm(alg, false); + continue; + } + } + ((BasePlot)children[i]).displayAdjustmentValueChanged(event); + } + } + + if(event.getType() == DisplayAdjustmentEvent.IDX_SEQUENCE_CHANGE && + closingPlots.length() > 0) + { + JOptionPane.showMessageDialog(this, + closingPlots.toString()+ + "\nAs the sequence is changing the above user plots are closing as they are\n"+ + "not indexed with multiple sequences. You can load in the correponding plot\n"+ + "for the new sequence.", + "Closing Userplot", JOptionPane.INFORMATION_MESSAGE); } } @@ -231,9 +262,7 @@ public class BasePlotGroup extends JPanel { for(int i = 0 ; i < plot_value_producers.size() ; ++i) { - final BaseAlgorithm this_algorithm = - (BaseAlgorithm) plot_value_producers.elementAt(i); - + final BaseAlgorithm this_algorithm = plot_value_producers.elementAt(i); if(this_algorithm instanceof CodonUsageAlgorithm) return (CodonUsageAlgorithm) this_algorithm; } @@ -252,8 +281,7 @@ public class BasePlotGroup extends JPanel for(int i = 0 ; i < plot_value_producers.size () ; ++i) { - final BaseAlgorithm this_algorithm = - (BaseAlgorithm) plot_value_producers.elementAt (i); + final BaseAlgorithm this_algorithm = plot_value_producers.elementAt (i); return_array[i] = this_algorithm; } @@ -348,14 +376,6 @@ public class BasePlotGroup extends JPanel return selection; } - /** - * Return the EntryGroup object that was passed to the constructor. - **/ - private EntryGroup getEntryGroup() - { - return entry_group; - } - /** * Return the GotoEventSource object that was passed to the constructor. **/ diff --git a/uk/ac/sanger/artemis/components/DisplayAdjustmentEvent.java b/uk/ac/sanger/artemis/components/DisplayAdjustmentEvent.java index 223ea01638ad61b4206e8f02357745d2d6b0c169..911f0b74efbeb35c0972b12ce40815b73b8d60d3 100644 --- a/uk/ac/sanger/artemis/components/DisplayAdjustmentEvent.java +++ b/uk/ac/sanger/artemis/components/DisplayAdjustmentEvent.java @@ -100,6 +100,9 @@ public class DisplayAdjustmentEvent extends ChangeEvent final static public int CONTIG_REV_COMP_EVENT = 4; final static public int CONTIG_REORDER = 5; + + /** change tabix indexed sequence */ + final static public int IDX_SEQUENCE_CHANGE = 6; public DisplayAdjustmentEvent(Object source, int start_base, int end_base, diff --git a/uk/ac/sanger/artemis/components/EntryGroupDisplay.java b/uk/ac/sanger/artemis/components/EntryGroupDisplay.java index 426b11bf8c5e4ec44a25f1929b161bc58d26de0a..4cfc5f88d5ad530fc0c7187ef3fb5a7466e85155 100644 --- a/uk/ac/sanger/artemis/components/EntryGroupDisplay.java +++ b/uk/ac/sanger/artemis/components/EntryGroupDisplay.java @@ -251,6 +251,16 @@ public class EntryGroupDisplay extends JPanel owning_component.getFeatureDisplay().getBases().clearCodonCache(); owning_component.getFeatureDisplay().needVisibleFeatureVectorUpdate(); owning_component.repaint(); + owning_component.getBasePlotGroup().displayAdjustmentValueChanged( + new DisplayAdjustmentEvent( + owning_component, + owning_component.getFeatureDisplay().getFirstVisibleForwardBase(), + owning_component.getFeatureDisplay().getLastVisibleForwardBase(), + owning_component.getFeatureDisplay().getMaxVisibleBases(), + owning_component.getFeatureDisplay().getDisplayWidth(), + owning_component.getFeatureDisplay().getScaleFactor(), + owning_component.getFeatureDisplay().isRevCompDisplay(), + DisplayAdjustmentEvent.IDX_SEQUENCE_CHANGE)); } }; } diff --git a/uk/ac/sanger/artemis/plot/UserDataAlgorithm.java b/uk/ac/sanger/artemis/plot/UserDataAlgorithm.java index a4e6fc83ee7ab1740b56d16eecc92a77a4a68e89..5813c61920aa31985ed937281a80731f256d79ac 100644 --- a/uk/ac/sanger/artemis/plot/UserDataAlgorithm.java +++ b/uk/ac/sanger/artemis/plot/UserDataAlgorithm.java @@ -835,11 +835,11 @@ public class UserDataAlgorithm extends BaseAlgorithm return false; } - public void readIndexValues(Entry seqEntry, int start, int end) + public void readIndexValues(boolean recalculate_flag, Entry seqEntry, int start, int end) { if(start<1) start = 1; - idxReader.readValuesForRange(seqEntry, start, end); + idxReader.readValuesForRange(recalculate_flag, seqEntry, start, end); } class Wiggle @@ -928,19 +928,21 @@ public class UserDataAlgorithm extends BaseAlgorithm /** * Read the values in a range + * @param recalculate_flag * @param seqEntry - sequence entry * @param start - start base * @param end - end base */ - private void readValuesForRange(Entry seqEntry, int start, int end) + private void readValuesForRange(boolean recalculate_flag, Entry seqEntry, int start, int end) { - if(end <= start || (start == this.sbeg && end == this.send)) + if(!recalculate_flag && (end <= start || (start == this.sbeg && end == this.send)) ) return; this.sbeg = start; this.send = end; rvalues = new float[end-start+1][getNumberOfValues()]; final String r = getReferenceName(seqEntry)+":"+start+"-"+end; + try { final TabixReader.Iterator tbxIt = reader.query(r);