| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.io.gff; |
| 22 |
|
|
| 23 |
|
import jalview.datamodel.AlignmentI; |
| 24 |
|
import jalview.datamodel.SequenceFeature; |
| 25 |
|
import jalview.datamodel.SequenceI; |
| 26 |
|
import jalview.util.StringUtils; |
| 27 |
|
|
| 28 |
|
import java.io.IOException; |
| 29 |
|
import java.util.List; |
| 30 |
|
import java.util.Map; |
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| |
|
| 70% |
Uncovered Elements: 9 (30) |
Complexity: 11 |
Complexity Density: 0.61 |
|
| 35 |
|
public class InterProScanHelper extends Gff3Helper |
| 36 |
|
{ |
| 37 |
|
private static final String INTER_PRO_SCAN = "InterProScan"; |
| 38 |
|
|
| 39 |
|
private static final String SIGNATURE_DESC = "signature_desc"; |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
@param |
| 45 |
|
|
| 46 |
|
@param |
| 47 |
|
|
| 48 |
|
@param |
| 49 |
|
|
| 50 |
|
@param |
| 51 |
|
|
| 52 |
|
@param |
| 53 |
|
|
| 54 |
|
@return |
| 55 |
|
|
| 56 |
|
|
| 57 |
|
@throws |
| 58 |
|
|
| |
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 59 |
0 |
@Override... |
| 60 |
|
public SequenceFeature processGff(SequenceI seq, String[] gff, |
| 61 |
|
AlignmentI align, List<SequenceI> newseqs, |
| 62 |
|
boolean relaxedIdMatching) throws IOException |
| 63 |
|
{ |
| 64 |
|
|
| 65 |
|
|
| 66 |
|
|
| 67 |
0 |
if (".".equals(gff[SOURCE_COL])) |
| 68 |
|
{ |
| 69 |
0 |
return null; |
| 70 |
|
} |
| 71 |
|
|
| 72 |
0 |
return super.processGff(seq, gff, align, newseqs, relaxedIdMatching); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
|
|
| 83 |
|
|
| |
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
| 84 |
1 |
@Override... |
| 85 |
|
protected SequenceFeature buildSequenceFeature(String[] gff, |
| 86 |
|
Map<String, List<String>> attributes) |
| 87 |
|
{ |
| 88 |
1 |
SequenceFeature sf = super.buildSequenceFeature(gff, SOURCE_COL, |
| 89 |
|
INTER_PRO_SCAN, attributes); |
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
1 |
List<String> desc = attributes.get(SIGNATURE_DESC); |
| 95 |
1 |
String description = StringUtils.listToDelimitedString(desc, ", "); |
| 96 |
1 |
if (description.length() > 0) |
| 97 |
|
{ |
| 98 |
1 |
sf.setDescription(description); |
| 99 |
|
} |
| 100 |
|
|
| 101 |
1 |
return sf; |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
|
| 105 |
|
|
| 106 |
|
|
| 107 |
|
@param |
| 108 |
|
@return |
| 109 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 4 |
Complexity Density: 0.8 |
|
| 110 |
24 |
public static boolean recognises(String[] columns)... |
| 111 |
|
{ |
| 112 |
24 |
SequenceOntologyI so = SequenceOntologyFactory.getSequenceOntology(); |
| 113 |
24 |
String type = columns[TYPE_COL]; |
| 114 |
24 |
if (so.isA(type, SequenceOntologyI.PROTEIN_MATCH) |
| 115 |
|
|| (".".equals(columns[SOURCE_COL]) |
| 116 |
|
&& so.isA(type, SequenceOntologyI.POLYPEPTIDE))) |
| 117 |
|
{ |
| 118 |
1 |
return true; |
| 119 |
|
} |
| 120 |
23 |
return false; |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 125 |
|
|
| 126 |
|
|
| |
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
| 127 |
1 |
@Override... |
| 128 |
|
protected String findTargetId(String target, |
| 129 |
|
Map<String, List<String>> set) |
| 130 |
|
{ |
| 131 |
1 |
List<String> ids = set.get(ID); |
| 132 |
1 |
if (ids == null || ids.size() != 1) |
| 133 |
|
{ |
| 134 |
0 |
return null; |
| 135 |
|
} |
| 136 |
1 |
return ids.get(0); |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
} |