| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.ext.ensembl; |
| 22 |
|
|
| 23 |
|
import jalview.analysis.AlignmentUtils; |
| 24 |
|
import jalview.bin.Cache; |
| 25 |
|
import jalview.datamodel.DBRefSource; |
| 26 |
|
import jalview.util.Platform; |
| 27 |
|
import jalview.ws.seqfetcher.DbSourceProxyImpl; |
| 28 |
|
|
| 29 |
|
import com.stevesoft.pat.Regex; |
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
@author |
| 35 |
|
|
| |
|
| 0% |
Uncovered Elements: 24 (24) |
Complexity: 11 |
Complexity Density: 0.92 |
|
| 36 |
|
abstract class EnsemblSequenceFetcher extends DbSourceProxyImpl |
| 37 |
|
{ |
| 38 |
|
|
| 39 |
|
protected static final String ENSEMBL_BASEURL = "ENSEMBL_BASEURL"; |
| 40 |
|
|
| 41 |
|
protected static final String ENSEMBL_GENOMES_BASEURL = "ENSEMBL_GENOMES_BASEURL"; |
| 42 |
|
|
| 43 |
|
|
| 44 |
|
protected static final String DEFAULT_ENSEMBL_BASEURL = "https://rest.ensembl.org"; |
| 45 |
|
|
| 46 |
|
|
| 47 |
|
protected static final String DEFAULT_ENSEMBL_GENOMES_BASEURL = DEFAULT_ENSEMBL_BASEURL; |
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
private static final Regex ACCESSION_REGEX = Platform.newRegex( |
| 55 |
|
"(ENS([A-Z]{3}|)[GTEP]{1}[0-9]{11}$)" + "|" |
| 56 |
|
+ "(CCDS[0-9.]{3,}$)"); |
| 57 |
|
|
| 58 |
|
protected final String ensemblGenomesDomain; |
| 59 |
|
|
| 60 |
|
protected final String ensemblDomain; |
| 61 |
|
|
| 62 |
|
protected static final String OBJECT_TYPE_TRANSLATION = "Translation"; |
| 63 |
|
|
| 64 |
|
protected static final String OBJECT_TYPE_TRANSCRIPT = "Transcript"; |
| 65 |
|
|
| 66 |
|
protected static final String OBJECT_TYPE_GENE = "Gene"; |
| 67 |
|
|
| 68 |
|
protected static final String PARENT = "Parent"; |
| 69 |
|
|
| 70 |
|
protected static final String JSON_ID = AlignmentUtils.VARIANT_ID; |
| 71 |
|
|
| 72 |
|
protected static final String OBJECT_TYPE = "object_type"; |
| 73 |
|
|
| 74 |
|
|
| 75 |
|
|
| 76 |
|
@see |
| 77 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 78 |
|
protected enum EnsemblFeatureType |
| 79 |
|
{ |
| 80 |
|
gene, transcript, cds, exon, repeat, simple, misc, variation, |
| 81 |
|
somatic_variation, structural_variation, somatic_structural_variation, |
| 82 |
|
constrained, regulatory |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
private String domain; |
| 86 |
|
|
| 87 |
|
|
| 88 |
|
|
| 89 |
|
|
| |
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 90 |
0 |
public EnsemblSequenceFetcher()... |
| 91 |
|
{ |
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
|
|
| 96 |
0 |
ensemblDomain = Cache |
| 97 |
|
.getDefault(ENSEMBL_BASEURL, DEFAULT_ENSEMBL_BASEURL).trim(); |
| 98 |
0 |
ensemblGenomesDomain = Cache.getDefault(ENSEMBL_GENOMES_BASEURL, |
| 99 |
|
DEFAULT_ENSEMBL_GENOMES_BASEURL).trim(); |
| 100 |
0 |
domain = ensemblDomain; |
| 101 |
|
} |
| 102 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 103 |
0 |
@Override... |
| 104 |
|
public String getDbSource() |
| 105 |
|
{ |
| 106 |
|
|
| 107 |
0 |
return DBRefSource.ENSEMBL; |
| 108 |
|
} |
| 109 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 110 |
0 |
@Override... |
| 111 |
|
public String getAccessionSeparator() |
| 112 |
|
{ |
| 113 |
0 |
return " "; |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
@see |
| 121 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 122 |
0 |
@Override... |
| 123 |
|
public Regex getAccessionValidator() |
| 124 |
|
{ |
| 125 |
0 |
return ACCESSION_REGEX; |
| 126 |
|
} |
| 127 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 128 |
0 |
@Override... |
| 129 |
|
public boolean isValidReference(String accession) |
| 130 |
|
{ |
| 131 |
0 |
return getAccessionValidator().search(accession); |
| 132 |
|
} |
| 133 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 134 |
0 |
@Override... |
| 135 |
|
public int getTier() |
| 136 |
|
{ |
| 137 |
0 |
return 0; |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 143 |
0 |
@Override... |
| 144 |
|
public String getTestQuery() |
| 145 |
|
{ |
| 146 |
|
|
| 147 |
0 |
return "ENST00000288602"; |
| 148 |
|
|
| 149 |
|
} |
| 150 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 151 |
0 |
@Override... |
| 152 |
|
public boolean isDnaCoding() |
| 153 |
|
{ |
| 154 |
0 |
return true; |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
|
| 158 |
|
|
| 159 |
|
|
| 160 |
|
|
| 161 |
|
@return |
| 162 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 163 |
0 |
protected String getDomain()... |
| 164 |
|
{ |
| 165 |
0 |
return domain; |
| 166 |
|
} |
| 167 |
|
|
| |
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
| 168 |
0 |
protected void setDomain(String d)... |
| 169 |
|
{ |
| 170 |
0 |
domain = d == null ? null : d.trim(); |
| 171 |
|
} |
| 172 |
|
} |