14
14
* This class models a segment of a reference sequence, which can represent a complete genome,
15
15
* a plasmid, a single contig, or a scaffold. It extends the {@link Attributable} class to
16
16
* inherit functionality for managing attributes associated with the contig.
17
- * </p>
18
17
* <p>
19
18
* Each instance of this class is uniquely identified by its {@code name} and contains
20
19
* information about its nucleotide sequence, variants, and other relevant properties.
21
- * </p>
22
20
*/
23
21
public class Contig extends Attributable {
24
22
@@ -28,7 +26,6 @@ public class Contig extends Attributable {
28
26
* This field uniquely identifies the contig within the context of the application.
29
27
* It is a final field, meaning its value is immutable once assigned during the
30
28
* construction of the {@link Contig} instance.
31
- * </p>
32
29
*/
33
30
public final String name ;
34
31
@@ -38,10 +35,8 @@ public class Contig extends Attributable {
38
35
* This field stores the nucleotide sequence of the contig. The sequence is expected to be
39
36
* stored as a GZIP-compressed string to optimize storage. It may be empty or null if no
40
37
* sequence is available for the contig.
41
- * </p>
42
38
* <p>
43
39
* <b>Note:</b> The sequence is not validated against the variants stored in the {@code variants} map.
44
- * </p>
45
40
*/
46
41
protected final String sequence ;
47
42
@@ -55,11 +50,9 @@ public class Contig extends Attributable {
55
50
* <li>The third level (value: {@link VariantInformation}) contains additional information about the variant,
56
51
* such as associations with {@link SequenceType}s or {@link Sample}s.</li>
57
52
* </ul>
58
- * </p>
59
53
* <p>
60
54
* This structure allows storage and retrieval of variant data, enabling queries by position,
61
55
* alternative content, and associated metadata.
62
- * </p>
63
56
*/
64
57
protected final TreeMap <Integer , Map <String , VariantInformation >> variants ;
65
58
@@ -69,11 +62,9 @@ public class Contig extends Attributable {
69
62
* This field is a transient {@link HashMap} used to cache subsequences of the contig's sequence.
70
63
* The keys in the map are {@link Tuple} objects representing the start and end positions of the subsequence,
71
64
* and the values are the corresponding subsequences as {@link String}.
72
- * </p>
73
65
* <p>
74
66
* The cache is transient because it is not intended to be serialized, as it is dynamically populated
75
67
* during runtime to optimize performance by avoiding redundant sequence decompression or retrieval.
76
- * </p>
77
68
*/
78
69
protected transient HashMap <Tuple <Integer , Integer >, String > sequenceCache ;
79
70
@@ -84,7 +75,6 @@ public class Contig extends Attributable {
84
75
* initializes the {@link #variants} map to store variant information and the {@link #sequenceCache}
85
76
* map to cache subsequences for optimized retrieval. The sequence is expected to be stored
86
77
* as a GZIP-compressed string to reduce storage requirements.
87
- * </p>
88
78
*
89
79
* @param name The name or identifier of the contig.
90
80
* @param sequence The nucleotide sequence of the contig, stored as a GZIP-compressed string.
@@ -103,7 +93,6 @@ protected Contig(String name, String sequence) {
103
93
* This method determines whether the contig has a stored sequence by checking
104
94
* if the {@code sequence} field is not empty. A non-empty sequence indicates
105
95
* that the contig has an associated nucleotide sequence.
106
- * </p>
107
96
*
108
97
* @return {@code true} if the contig has a sequence (i.e., the sequence length is not zero),
109
98
* {@code false} otherwise.
@@ -117,7 +106,6 @@ public boolean hasSequence() {
117
106
* <p>
118
107
* This method decompresses the GZIP-compressed sequence stored in the {@code sequence} field
119
108
* and returns it as a string. If no sequence is stored, it returns an empty string.
120
- * </p>
121
109
*
122
110
* @return The decompressed nucleotide sequence of this contig, or an empty string if no sequence is stored.
123
111
* @throws IOException If an error occurs during the decompression of the sequence.
@@ -136,12 +124,9 @@ public String getSequence() throws IOException {
136
124
* specified start and end positions. The subsequence is cached to avoid redundant decompression
137
125
* and substring operations for the same range. If the subsequence is already cached, it is
138
126
* retrieved directly from the cache. Otherwise, it is computed, stored in the cache, and returned.
139
- * </p>
140
- *
141
127
* <p>
142
128
* The start and end positions are 1-based indices, meaning the first nucleotide in the sequence
143
129
* is at position 1. If no sequence is stored for the contig, the method returns an empty string.
144
- * </p>
145
130
*
146
131
* @param start The 1-based indexed start position of the subsequence (inclusive).
147
132
* @param end The 1-based indexed end position of the subsequence (exclusive).
@@ -169,7 +154,6 @@ public String getSubsequence(int start, int end) throws IOException {
169
154
* This method iterates through the hierarchical map of variants stored in the {@code variants} field.
170
155
* It computes the total count by summing up the sizes of all inner maps, where each inner map represents
171
156
* the alternative sequences for a specific position on the contig.
172
- * </p>
173
157
*
174
158
* @return The total number of variants located on this contig.
175
159
*/
@@ -184,7 +168,6 @@ public int getVariantsCount() {
184
168
* for a variant located at the specified position with the given alternative bases. The returned
185
169
* {@link VariantInformation} contains details about the variant, including its occurrences in
186
170
* samples and features, as well as any associated attributes.
187
- * </p>
188
171
*
189
172
* @param position The 1-based position of the variant on the contig.
190
173
* @param alternativeBases The alternative base sequence of the variant.
@@ -203,14 +186,11 @@ public VariantInformation getVariantInformation(int position, String alternative
203
186
* <li>The position of the variant (field {@code a} of the tuple).</li>
204
187
* <li>The alternate allele of the variant (field {@code b} of the tuple).</li>
205
188
* </ul>
206
- * </p>
207
- *
208
189
* <p>
209
190
* For each variant, the method retrieves the associated {@link VariantInformation} using
210
191
* the position and alternate allele. It then checks if the {@code Constants.EFFECTS} attribute
211
192
* is present. If the attribute is found, its value (a comma-separated string of effects) is split
212
193
* into individual effects, which are trimmed and aggregated into a {@link Set} to ensure uniqueness.
213
- * </p>
214
194
*
215
195
* @param variants A list of {@link Tuple} objects representing the variants. Each tuple contains:
216
196
* <ul>
@@ -236,7 +216,6 @@ public Set<String> getVariantsEffects(List<Tuple<Integer, String>> variants) {
236
216
* <li>The position of the variant on the contig.</li>
237
217
* <li>The alternative base sequence of the variant.</li>
238
218
* </ul>
239
- * </p>
240
219
*
241
220
* @return An {@link ArrayList} of {@link Tuple} objects, where each tuple contains
242
221
* the position and alternative base sequence of a variant.
@@ -261,7 +240,6 @@ public ArrayList<Tuple<Integer, String>> getVariants() {
261
240
* <li>The position of the variant on the contig.</li>
262
241
* <li>The alternative base sequence of the variant.</li>
263
242
* </ul>
264
- * </p>
265
243
*
266
244
* @param start The 1-based indexed inclusive start position of the range.
267
245
* @param end The 1-based indexed inclusive end position of the range.
@@ -289,7 +267,6 @@ public ArrayList<Tuple<Integer, String>> getVariantsByLocation(int start, int en
289
267
* <li>The position of the variant on the contig.</li>
290
268
* <li>The alternative base sequence of the variant.</li>
291
269
* </ul>
292
- * </p>
293
270
*
294
271
* @param feature The feature to filter variants by.
295
272
* @param alleleUids A set of allele unique identifiers to filter variants by.
@@ -320,7 +297,6 @@ public ArrayList<Tuple<Integer, String>> getVariantsByAlleles(Feature feature, S
320
297
* <li>The position of the variant on the contig.</li>
321
298
* <li>The alternative base sequence of the variant.</li>
322
299
* </ul>
323
- * </p>
324
300
*
325
301
* @param sampleName The name of the sample to filter variants by.
326
302
* @return An {@link ArrayList} of {@link Tuple} objects, where each tuple contains
@@ -349,7 +325,6 @@ public ArrayList<Tuple<Integer, String>> getVariantsBySample(String sampleName)
349
325
* <li>The position of the variant on the contig.</li>
350
326
* <li>The alternative base sequence of the variant.</li>
351
327
* </ul>
352
- * </p>
353
328
*
354
329
* @param sampleName The name of the sample to filter variants by.
355
330
* @param start The 1-based indexed inclusive start position of the location range.
0 commit comments