git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'improvement/JAL-1988+JAL-3416_flatlaf_osx_apqhandler' into improvement...
[jalview.git]
/
src
/
jalview
/
ws
/
dbsources
/
EmblXmlSource.java
diff --git
a/src/jalview/ws/dbsources/EmblXmlSource.java
b/src/jalview/ws/dbsources/EmblXmlSource.java
index
c2d661b
..
034ea4f
100644
(file)
--- a/
src/jalview/ws/dbsources/EmblXmlSource.java
+++ b/
src/jalview/ws/dbsources/EmblXmlSource.java
@@
-20,8
+20,6
@@
*/
package jalview.ws.dbsources;
*/
package jalview.ws.dbsources;
-import java.util.Locale;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
@@
-30,6
+28,7
@@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.List;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Map;
import java.util.Map.Entry;
@@
-44,7
+43,7
@@
import javax.xml.stream.XMLStreamReader;
import com.stevesoft.pat.Regex;
import jalview.analysis.SequenceIdMatcher;
import com.stevesoft.pat.Regex;
import jalview.analysis.SequenceIdMatcher;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
@@
-65,12
+64,6
@@
import jalview.xml.binding.embl.EntryType.Feature.Qualifier;
import jalview.xml.binding.embl.ROOT;
import jalview.xml.binding.embl.XrefType;
import jalview.xml.binding.embl.ROOT;
import jalview.xml.binding.embl.XrefType;
-/**
- * Provides XML binding and parsing of EMBL or EMBLCDS records retrieved from
- * (e.g.) {@code https://www.ebi.ac.uk/ena/data/view/x53828&display=xml}.
- *
- * @deprecated endpoint withdrawn August 2020 (JAL-3692), use EmblFlatfileSource
- */
public abstract class EmblXmlSource extends EbiFileRetrievedProxy
{
private static final Regex ACCESSION_REGEX = new Regex("^[A-Z]+[0-9]+");
public abstract class EmblXmlSource extends EbiFileRetrievedProxy
{
private static final Regex ACCESSION_REGEX = new Regex("^[A-Z]+[0-9]+");
@@
-104,8
+97,8
@@
public abstract class EmblXmlSource extends EbiFileRetrievedProxy
try
{
reply = dbFetch.fetchDataAsFile(
try
{
reply = dbFetch.fetchDataAsFile(
- emprefx.toLowerCase(Locale.ROOT) + ":" + query.trim(), "display=xml",
- "xml");
+ emprefx.toLowerCase(Locale.ROOT) + ":" + query.trim(),
+ "display=xml", "xml");
} catch (Exception e)
{
stopQuery();
} catch (Exception e)
{
stopQuery();
@@
-455,9
+448,8
@@
public abstract class EmblXmlSource extends EbiFileRetrievedProxy
else
{
// final product length truncation check
else
{
// final product length truncation check
- int[] cdsRanges = adjustForProteinLength(translationLength,
- exons);
- dnaToProteinMapping = new Mapping(product, cdsRanges,
+ int[] exons2 = adjustForProteinLength(translationLength, exons);
+ dnaToProteinMapping = new Mapping(product, exons2,
new int[]
{ 1, translationLength }, 3, 1);
if (product != null)
new int[]
{ 1, translationLength }, 3, 1);
if (product != null)
@@
-666,7
+658,7
@@
public abstract class EmblXmlSource extends EbiFileRetrievedProxy
return listToArray(ranges);
} catch (ParseException e)
{
return listToArray(ranges);
} catch (ParseException e)
{
- Cache.log.warn(
+ Console.warn(
String.format("Not parsing inexact CDS location %s in ENA %s",
location, accession));
return new int[] {};
String.format("Not parsing inexact CDS location %s in ENA %s",
location, accession));
return new int[] {};
@@
-759,8
+751,7
@@
public abstract class EmblXmlSource extends EbiFileRetrievedProxy
/**
* Truncates (if necessary) the exon intervals to match 3 times the length of
/**
* Truncates (if necessary) the exon intervals to match 3 times the length of
- * the protein; also accepts 3 bases longer (for stop codon not included in
- * protein)
+ * the protein (including truncation for stop codon included in exon)
*
* @param proteinLength
* @param exon
*
* @param proteinLength
* @param exon
@@
-777,11
+768,9
@@
public abstract class EmblXmlSource extends EbiFileRetrievedProxy
int exonLength = MappingUtils.getLength(Arrays.asList(exon));
/*
int exonLength = MappingUtils.getLength(Arrays.asList(exon));
/*
- * if exon length matches protein, or is shorter, or longer by the
- * length of a stop codon (3 bases), then leave it unchanged
+ * if exon length matches protein, or is shorter, then leave it unchanged
*/
*/
- if (expectedCdsLength >= exonLength
- || expectedCdsLength == exonLength - 3)
+ if (expectedCdsLength >= exonLength)
{
return exon;
}
{
return exon;
}