diff --git a/etc/versions b/etc/versions index 9554acd842830fd4a4ffb8cf976daaf615dc3fa4..1730e086880d5c00de06f3b5c49fbe7ecc40ee88 100644 --- a/etc/versions +++ b/etc/versions @@ -1,4 +1,4 @@ -Artemis Release 15.1.11 -ACT Release 12.1.11 +Artemis Release 15.1.12 +ACT Release 12.1.12 DNAPlotter Release 1.11 BamView 1.2.10 \ No newline at end of file diff --git a/uk/ac/sanger/artemis/io/IndexedGFFDocumentEntry.java b/uk/ac/sanger/artemis/io/IndexedGFFDocumentEntry.java index 5a9ec3f634894c2dbb8b4eb60165075dde5158f3..746012cf9be2552a83fd020a0eddfe7df53b4564 100644 --- a/uk/ac/sanger/artemis/io/IndexedGFFDocumentEntry.java +++ b/uk/ac/sanger/artemis/io/IndexedGFFDocumentEntry.java @@ -69,6 +69,7 @@ public class IndexedGFFDocumentEntry implements DocumentEntry private EntryGroup entryGroup; private int featureCount = -1; + private boolean isGTF = false; // cache used by getFeatureAtIndex() and indexOf() private CacheHashMap gffCache = new CacheHashMap(150,5); @@ -202,6 +203,7 @@ public class IndexedGFFDocumentEntry implements DocumentEntry if(featuresInRange.size() > 0 && GFFStreamFeature.isGTF((Feature)featuresInRange.get(0))) { + isGTF = true; // GTF try { @@ -228,8 +230,25 @@ public class IndexedGFFDocumentEntry implements DocumentEntry { int start = getCoordInContigCoords(range.getStart(), c); int end = getCoordInContigCoords(range.getEnd(), c); + + if(isGTF) + { + // for GTF grab a larger range so Artemis knows about any + // connecting exons outside the view + start -= 500000; + if(start < 1) + start = 1; + end += 500000; + try + { + range = new Range(start, end); + } + catch (OutOfRangeException e){} + if(end < start) + return; + } + String r = c.chr+":"+start+"-"+end; - TabixReader.Iterator tabixIterator = null; try { @@ -265,15 +284,14 @@ public class IndexedGFFDocumentEntry implements DocumentEntry final FeatureVector features) throws NumberFormatException, ReadFormatException, IOException { String ln; - while( (ln = tabixIterator.next()) != null ) { StringVector parts = StringVector.getStrings(ln, "\t", true); ln = getGffInArtemisCoordinates(ln, parts, c); parts = StringVector.getStrings(ln, "\t", true); - int sbeg = Integer.parseInt(((String)parts.elementAt(3)).trim()); - int send = Integer.parseInt(((String)parts.elementAt(4)).trim()); + int sbeg = Integer.parseInt(parts.elementAt(3).trim()); + int send = Integer.parseInt(parts.elementAt(4).trim()); if( (sbeg < min && send < min) || (sbeg > max && send > max) ) continue; @@ -282,7 +300,7 @@ public class IndexedGFFDocumentEntry implements DocumentEntry gff.setReadOnlyFeature(true); features.add(gff); - if( ((String)parts.elementAt(2)).equals("gene") ) + if( parts.elementAt(2).equals("gene") ) { if(sbeg < min) min = sbeg; @@ -1050,6 +1068,8 @@ public class IndexedGFFDocumentEntry implements DocumentEntry public FeatureVector getAllFeatures() { return new FeatureVector(){ + private static final long serialVersionUID = 1L; + public int size() { return getFeatureCount();