Skip to content

Commit

Permalink
Merge pull request #300 from kpepper/perf_fixes
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
kpepper authored Nov 28, 2019
2 parents 6debf11 + 993d8c9 commit 5a2454b
Show file tree
Hide file tree
Showing 88 changed files with 56,197 additions and 396 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The Artemis Software is a set of software tools for genome browsing and annotati
[![status](https://img.shields.io/badge/Bioinformatics-10.1093%2Fbioinformatics%2Fbtq010-brightgreen.svg)](https://doi.org/10.1093/bioinformatics/btq010)
[![status](https://img.shields.io/badge/Bioinformatics-10.1093%2Fbioinformatics%2Fbtn578-brightgreen.svg)](https://doi.org/10.1093/bioinformatics/btn578)

![GitHub Releases (by Release)](https://img.shields.io/github/downloads/sanger-pathogens/artemis/v18.0.2/total)
![GitHub Releases (by Release)](https://img.shields.io/github/downloads/sanger-pathogens/artemis/v18.1.0/total)

## Contents
* [Introduction](#introduction)
Expand Down
3 changes: 2 additions & 1 deletion etc/feature_keys_gff
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ repeat_unit ID Name Alias Parent Note Target Gap Derives_from Dbxref Ontolo
#stem_loop ID Name Alias Parent Note Target Gap Derives_from Dbxref Ontology_term feature_id isObsolete timelastmodified allele citation evidence function gene label locus_tag map note comment operon partial standard_name
#terminator ID Name Alias Parent Note Target Gap Derives_from Dbxref Ontology_term feature_id isObsolete timelastmodified allele citation evidence gene label locus_tag map note comment operon partial standard_name
#transit_peptide ID Name Alias Parent Note Target Gap Derives_from Dbxref Ontology_term feature_id isObsolete timelastmodified allele citation codon codon_start evidence function gene label locus_tag map note comment partial product pseudo standard_name

low_complexity_region ID Name Alias Parent Note Target Gap Derives_from Dbxref Ontology_term Start_range End_range feature_id isObsolete timelastmodified note comment private score
tandem_repeat ID Name Alias Parent Note Target Gap Derives_from Dbxref Ontology_term feature_id isObsolete timelastmodified score
2 changes: 2 additions & 0 deletions etc/key_mapping
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ nucleotide_match misc_feature note=nucleotide_match
uORF misc_feature note=uORF
sORF misc_feature note=sORF
tnaORF misc_feature note=tnaORF
low_complexity_region misc_feature note=low_complexity_region
tandem_repeat repeat_region rpt_type=tandem
19 changes: 6 additions & 13 deletions etc/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ log4j.logger.uk.ac.sanger.artemis.components.alignment.LookSeqPanel=DEBUG, R
log4j.logger.uk.ac.sanger.artemis.components.alignment.BamView=INFO, R
log4j.logger.uk.ac.sanger.artemis.components.variant=DEBUG, R
log4j.logger.uk.ac.sanger.artemis.io.ReadAndWriteEntry=DEBUG, R
log4j.logger.uk.ac.sanger.artemis.io.GFFStreamFeature=DEBUG, R
log4j.logger.uk.ac.sanger.artemis.io.GFFStreamFeature=INFO, R
log4j.logger.uk.ac.sanger.artemis.io.IndexedGFFDocumentEntry=INFO, R
log4j.logger.uk.ac.sanger.artemis.util.FTPSeekableStream=DEBUG, R
log4j.logger.uk.ac.sanger.artemis.plot.UserDataAlgorithm=DEBUG, R
log4j.logger.uk.ac.sanger.artemis.ComparisonDataFactory=INFO, R
log4j.logger.uk.ac.sanger.artemis.components.genebuilder.GeneUtils=ERROR, R

#log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG, stdout, R
#log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG, stdout, R
Expand All @@ -56,7 +58,6 @@ log4j.logger.java.sql.ResultSet=INFO, R

# j2ssh
log4j.logger.com.sshtools.j2ssh=WARN, R
# Pattern to output the caller's file name and line number.

!-----------------------------------------------------------------------------!
! Configure appenders (log destinations/targets) and their options !
Expand All @@ -65,13 +66,13 @@ log4j.logger.com.sshtools.j2ssh=WARN, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
#log4j.appender.stdout.layout.ConversionPattern=%m%n
log4j.appender.Default=uk.ac.sanger.artemis.components.LogViewer
log4j.appender.R=uk.ac.sanger.artemis.components.LogViewer
log4j.appender.R.MaxLogLines=2000
log4j.appender.R.layout=org.apache.log4j.PatternLayout
#log4j.appender.R.layout.ConversionPattern=%5p [%t] %c - %m%n
log4j.appender.R.layout.ConversionPattern=%d{dd MMM HH:mm:ss} - %m%n
# The next property determines the number of lines we see in the log viewer screen.
# If it's too big then we will get display performance impacts
log4j.appender.R.MaxLogLines=300

!-------------------------RollingFileAppender OPTIONS-------------------------!
log4j.appender.LOGFILE=org.apache.log4j.DailyRollingFileAppender
Expand All @@ -81,11 +82,3 @@ log4j.appender.LOGFILE.DatePattern='.'yyyy-MM-dd
#log4j.appender.LOGFILE.Threshold=INFO
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-4r [%t] %-5p %c %x - %m%n


#log4j.appender.srv=org.apache.log4j.net.SocketAppender
#log4j.appender.srv.layout=org.apache.log4j.PatternLayout
#log4j.appender.srv.RemoteHost=localhost
#log4j.appender.srv.Port=10105
#log4j.appender.srv.LocationInfo=false
#log4j.appender.srv.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %X{username} %X{host} %-4r [%t] %-5p %c %x - %m%n
6 changes: 2 additions & 4 deletions etc/options
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# (Note that comment lines start with a hash (#) symbol)

# $Header: //tmp/pathsoft/artemis/etc/options,v 1.73 2009-08-06 16:15:19 tjc Exp $

# This file should contain option settings that look like this:
#
# option_name = option_value
Expand Down Expand Up @@ -305,11 +303,11 @@ colour_of_GFF = 11
colour_of_start_codon = 6

# suffixes used on files that contain features - used in file requesters
feature_file_suffixes = tab embl gbk genbank tab_embl gff feature feat \
feature_file_suffixes = tab embl gbk genbank tab_embl gff gff3 feature feat \
art artemis

# suffixes used on files that contain sequence - used in file requesters
sequence_file_suffixes = embl gbk genbank gff tab_embl seq dna \
sequence_file_suffixes = embl gbk genbank gff gff3 tab_embl seq dna dat \
art artemis fa fasta fas gb fna ffn

# the default height for the base plot window
Expand Down
8 changes: 4 additions & 4 deletions etc/versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Artemis Release 18.0.3
ACT Release 18.0.3
DNAPlotter Release 18.0.3
BamView 18.0.3
Artemis Release 18.1.0
ACT Release 18.1.0
DNAPlotter Release 18.1.0
BamView 18.1.0
7 changes: 6 additions & 1 deletion etc/writedb_entry
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

QUIET=no
PROXY_SETTINGS=
HELP_FLAG=false

add_proxy_properties() {

Expand Down Expand Up @@ -80,6 +81,10 @@ while test $# != 0
DEFAULT_CONNECTION="$1" ;;
-D*)
FLAGS="$FLAGS $1" ;;
-help)
HELP_FLAG=true ;;
-h)
HELP_FLAG=true ;;
*) break ;;
esac
shift
Expand Down Expand Up @@ -109,7 +114,7 @@ do
done

# Check that a database connection has been provided
if [[ "$DEFAULT_CONNECTION" = "" ]]
if [[ "$DEFAULT_CONNECTION" = "" ]] && [[ "$HELP_FLAG" != "true" ]]
then
echo "ERROR: Please supply a database connection argument"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>uk.ac.sanger</groupId>
<artifactId>artemis</artifactId>
<version>18.0.3</version>
<version>18.1.0</version>

<name>Artemis</name>
<description>Artemis is a free genome browser and annotation tool that allows visualisation of sequence features, next generation data and the results of analyses within the context of the sequence, and also its six-frame translation.
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/uk/ac/sanger/artemis/Entry.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ public void save(final File file, final int destination_type,
final EntryInformation artemis_entry_information;

if((getEMBLEntry() instanceof DatabaseDocumentEntry ||
getEMBLEntry() instanceof GFFDocumentEntry) &&
getEMBLEntry() instanceof GFFDocumentEntry ||
getEMBLEntry() instanceof IndexedGFFDocumentEntry) &&
destination_type == DocumentEntryFactory.EMBL_FORMAT)
artemis_entry_information = Options.getArtemisEntryInformation();
else
Expand Down Expand Up @@ -1164,6 +1165,11 @@ private void fireAction(Vector<ChangeListener> listeners, ChangeEvent event)
private Feature
getFeatureOf(uk.ac.sanger.artemis.io.Feature embl_feature)
{
if (embl_feature == null)
{
return null;
}

final Feature test_feature =(Feature) embl_feature.getUserData();

if(test_feature == null)
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/uk/ac/sanger/artemis/FeatureSegment.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public Marker getEnd () {
**/
void setStartPosition (final int position)
throws OutOfRangeException {
getStart ().setPosition (position);
start.setPosition (position);
updateRange ();
}

Expand All @@ -198,7 +198,7 @@ void setStartPosition (final int position)
**/
void setEndPosition (final int position)
throws OutOfRangeException {
getEnd ().setPosition (position);
end.setPosition (position);
updateRange ();
}

Expand All @@ -216,8 +216,8 @@ public Range getRawRange () {
public MarkerRange getMarkerRange () {
try {
return new MarkerRange (getFeature ().getStrand (),
getStart ().getPosition (),
getEnd ().getPosition ());
start.getPosition (),
end.getPosition ());
} catch (OutOfRangeException e) {
throw new Error ("internal error - " + e);
}
Expand All @@ -236,7 +236,7 @@ public void removeFromFeature ()
* Return the number of bases in this feature (total of all segments).
**/
public int getBaseCount () {
return getEnd ().getPosition () - getStart ().getPosition () + 1;
return end.getPosition () - start.getPosition () + 1;
}

/**
Expand All @@ -245,8 +245,8 @@ public int getBaseCount () {
public String getBases () {
final Strand strand = getFeature ().getStrand ();
try {
return strand.getSubSequence (new Range (getStart ().getPosition (),
getEnd ().getPosition ()));
return strand.getSubSequence (new Range (start.getPosition (),
end.getPosition ()));
} catch (OutOfRangeException e) {
throw new Error ("internal error - unexpected exception: " + e);
}
Expand Down Expand Up @@ -306,11 +306,11 @@ private void updateRange () {

try {
if (getFeature ().isForwardFeature ()) {
new_range = range.change (getStart ().getRawPosition (),
getEnd ().getRawPosition ());
new_range = range.change (start.getRawPosition (),
end.getRawPosition ());
} else {
new_range = range.change (getEnd ().getRawPosition (),
getStart ().getRawPosition ());
new_range = range.change (end.getRawPosition (),
start.getRawPosition ());
}

range = new_range;
Expand Down Expand Up @@ -440,7 +440,7 @@ else if(this_direction != direction)
public int getFrameID () {
// this will be 0, 1 or 2 depending on which frame the segment is in
final int start_base_modulo =
(getStart ().getPosition () - 1 + getFrameShift ()) % 3;
(start.getPosition () - 1 + getFrameShift ()) % 3;

// if (getFeature ().getStrand ().isForwardStrand ())
if(isForwardSegment())
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/uk/ac/sanger/artemis/Selection.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ public void add (final FeatureVector features) {
* selection.
**/
private boolean addWithoutEvent (final Feature feature) {
if (features.contains (feature)) {

if (feature != null && features.contains (feature)) {
return false;
// do nothing
} else {
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/uk/ac/sanger/artemis/SimpleEntryGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,16 @@ public FeatureVector getFeaturesInIndexRange(final int start_index,
{
final FeatureVector return_vector = new FeatureVector();

Feature f = null;

for(int i = start_index; i <= end_index; ++i)
return_vector.add(featureAt(i));
{
f = featureAt(i);
if (f != null)
{
return_vector.add(featureAt(i));
}
}

return return_vector;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import uk.ac.sanger.artemis.io.Entry;
import uk.ac.sanger.artemis.io.DocumentEntryFactory;
import uk.ac.sanger.artemis.io.GFFDocumentEntry;
import uk.ac.sanger.artemis.io.IndexedGFFDocumentEntry;
import uk.ac.sanger.artemis.io.ReadFormatException;
import uk.ac.sanger.artemis.io.EntryInformation;
import uk.ac.sanger.artemis.io.EntryInformationException;
Expand Down Expand Up @@ -470,7 +471,8 @@ else if(entry.getEMBLEntry() instanceof DatabaseDocumentEntry ||
{
DocumentEntryFactory.REMOVE_PRODUCT_FROM_PSEUDOGENE = removeProductForPseudo.isSelected();
if(entry.getEMBLEntry() instanceof DatabaseDocumentEntry ||
entry.getEMBLEntry() instanceof GFFDocumentEntry)
entry.getEMBLEntry() instanceof GFFDocumentEntry ||
entry.getEMBLEntry() instanceof IndexedGFFDocumentEntry)
ReadAndWriteEntry.writeDatabaseEntryToFile(entry, file,
flattenGeneModel.isSelected(),
ignoreObsoleteFeatures.isSelected(), false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ private void handleCanvasMousePress(final MouseEvent event)
final Feature clicked_feature =
getEntryGroup().featureAt(clicked_feature_index);

if(selected_features.contains(clicked_feature))
if(clicked_feature != null && selected_features.contains(clicked_feature))
{
getSelection().remove(clicked_feature);
getSelection().removeSegmentsOf(clicked_feature);
Expand Down Expand Up @@ -527,7 +527,7 @@ private void onSelectionChange()
++i)
{
final Feature this_feature = entry_group.featureAt(i);
if(selected_features.contains(this_feature))
if(this_feature != null && selected_features.contains(this_feature))
{
a_selected_feature_is_visible = true;
break;
Expand Down Expand Up @@ -603,6 +603,7 @@ protected void paintComponent(Graphics g)
{
final Feature this_feature = features_in_view.elementAt(i);
final String feature_string = makeFeatureString(this_feature, false);

drawFeatureLine(g, this_feature, feature_string);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* GeneUtils.java
*
* This file is part of Artemis
* Copyright (C) 2007 Genome Research Limited
* Copyright (C) 2019 Genome Research Limited
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -43,6 +43,7 @@
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import org.apache.log4j.Logger;
import org.gmod.schema.general.DbXRef;
import org.gmod.schema.sequence.FeatureCvTerm;
import org.gmod.schema.sequence.FeatureDbXRef;
Expand Down Expand Up @@ -99,6 +100,9 @@ public class GeneUtils
private static StringVector featuresToUpdateResidues =
Options.getOptions().getOptionValues("sequence_update_features");

/** Logging instance. */
private static Logger logger = Logger.getLogger(GeneUtils.class);

static
{
hideFeatures.add("polypeptide");
Expand Down Expand Up @@ -1453,6 +1457,16 @@ public static String getUniqueName(final Feature feature)
{
e.printStackTrace();
}
catch(NullPointerException e)
{
StringBuilder buf = new StringBuilder(80);
buf.append("Feature at position ")
.append(feature.getFirstBase())
.append("-")
.append(feature.getLastBase())
.append(" has no ID");
logger.warn(buf.toString());
}
return null;
}

Expand Down
Loading

0 comments on commit 5a2454b

Please sign in to comment.