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
JAL-3954 Do not retrieve alignment for failed jobs
[jalview.git]
/
src
/
jalview
/
ext
/
ensembl
/
EnsemblGene.java
diff --git
a/src/jalview/ext/ensembl/EnsemblGene.java
b/src/jalview/ext/ensembl/EnsemblGene.java
index
461226b
..
ae85b45
100644
(file)
--- a/
src/jalview/ext/ensembl/EnsemblGene.java
+++ b/
src/jalview/ext/ensembl/EnsemblGene.java
@@
-33,6
+33,7
@@
import jalview.io.gff.SequenceOntologyI;
import jalview.schemes.FeatureColour;
import jalview.schemes.FeatureSettingsAdapter;
import jalview.util.MapList;
import jalview.schemes.FeatureColour;
import jalview.schemes.FeatureSettingsAdapter;
import jalview.util.MapList;
+import jalview.util.Platform;
import java.awt.Color;
import java.io.UnsupportedEncodingException;
import java.awt.Color;
import java.io.UnsupportedEncodingException;
@@
-54,7
+55,7
@@
public class EnsemblGene extends EnsemblSeqProxy
* accepts anything as we will attempt lookup of gene or
* transcript id or gene name
*/
* accepts anything as we will attempt lookup of gene or
* transcript id or gene name
*/
- private static final Regex ACCESSION_REGEX = new Regex(".*");
+ private static final Regex ACCESSION_REGEX = Platform.newRegex(".*");
private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
EnsemblFeatureType.gene, EnsemblFeatureType.transcript,
private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
EnsemblFeatureType.gene, EnsemblFeatureType.transcript,
@@
-139,7
+140,6
@@
public class EnsemblGene extends EnsemblSeqProxy
* convert to a non-duplicated list of gene identifiers
*/
List<String> geneIds = getGeneIds(query);
* convert to a non-duplicated list of gene identifiers
*/
List<String> geneIds = getGeneIds(query);
-
AlignmentI al = null;
for (String geneId : geneIds)
{
AlignmentI al = null;
for (String geneId : geneIds)
{
@@
-151,14
+151,12
@@
public class EnsemblGene extends EnsemblSeqProxy
{
continue;
}
{
continue;
}
-
+
if (geneAlignment.getHeight() == 1)
{
// ensure id has 'correct' case for the Ensembl identifier
geneId = geneAlignment.getSequenceAt(0).getName();
if (geneAlignment.getHeight() == 1)
{
// ensure id has 'correct' case for the Ensembl identifier
geneId = geneAlignment.getSequenceAt(0).getName();
-
findGeneLoci(geneAlignment.getSequenceAt(0), geneId);
findGeneLoci(geneAlignment.getSequenceAt(0), geneId);
-
getTranscripts(geneAlignment, geneId);
}
if (al == null)
getTranscripts(geneAlignment, geneId);
}
if (al == null)
@@
-320,8
+318,8
@@
public class EnsemblGene extends EnsemblSeqProxy
SequenceOntologyI.NMD_TRANSCRIPT_VARIANT,
SequenceOntologyI.TRANSCRIPT, SequenceOntologyI.EXON,
SequenceOntologyI.CDS };
SequenceOntologyI.NMD_TRANSCRIPT_VARIANT,
SequenceOntologyI.TRANSCRIPT, SequenceOntologyI.EXON,
SequenceOntologyI.CDS };
- List<SequenceFeature> sfs = gene.getFeatures().getFeaturesByOntology(
- soTerms);
+ List<SequenceFeature> sfs = gene.getFeatures()
+ .getFeaturesByOntology(soTerms);
for (SequenceFeature sf : sfs)
{
gene.deleteFeature(sf);
for (SequenceFeature sf : sfs)
{
gene.deleteFeature(sf);
@@
-471,8
+469,9
@@
public class EnsemblGene extends EnsemblSeqProxy
transcriptLoci.add(geneMapping.locateInTo(exon[0], exon[1]));
}
transcriptLoci.add(geneMapping.locateInTo(exon[0], exon[1]));
}
- List<int[]> transcriptRange = Arrays.asList(new int[] {
- transcript.getStart(), transcript.getEnd() });
+ List<int[]> transcriptRange = Arrays
+ .asList(new int[]
+ { transcript.getStart(), transcript.getEnd() });
MapList mapList = new MapList(transcriptRange, transcriptLoci, 1, 1);
transcript.setGeneLoci(loci.getSpeciesId(), loci.getAssemblyId(),
MapList mapList = new MapList(transcriptRange, transcriptLoci, 1, 1);
transcript.setGeneLoci(loci.getSpeciesId(), loci.getAssemblyId(),
@@
-540,10
+539,11
@@
public class EnsemblGene extends EnsemblSeqProxy
@Override
public String getTestQuery()
{
@Override
public String getTestQuery()
{
- return "ENSG00000157764"; // BRAF, 5 transcripts, reverse strand
+ return Platform.isJS() ? "ENSG00000123569" : "ENSG00000157764";
+ // ENSG00000123569 // H2BFWT histone, 2 transcripts, reverse strand
+ // ENSG00000157764 // BRAF, 5 transcripts, reverse strand
// ENSG00000090266 // NDUFB2, 15 transcripts, forward strand
// ENSG00000101812 // H2BFM histone, 3 transcripts, forward strand
// ENSG00000090266 // NDUFB2, 15 transcripts, forward strand
// ENSG00000101812 // H2BFM histone, 3 transcripts, forward strand
- // ENSG00000123569 // H2BFWT histone, 2 transcripts, reverse strand
}
/**
}
/**
@@
-579,7
+579,7
@@
public class EnsemblGene extends EnsemblSeqProxy
@Override
protected boolean retainFeature(SequenceFeature sf, String accessionId)
{
@Override
protected boolean retainFeature(SequenceFeature sf, String accessionId)
{
- SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+ SequenceOntologyI so = SequenceOntologyFactory.getSequenceOntology();
String type = sf.getType();
if (so.isA(type, SequenceOntologyI.GENE))
{
String type = sf.getType();
if (so.isA(type, SequenceOntologyI.GENE))
{
@@
-626,7
+626,7
@@
public class EnsemblGene extends EnsemblSeqProxy
{
return new FeatureSettingsAdapter()
{
{
return new FeatureSettingsAdapter()
{
- SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+ SequenceOntologyI so = SequenceOntologyFactory.getSequenceOntology();
@Override
public boolean isFeatureHidden(String type)
@Override
public boolean isFeatureHidden(String type)