|
|
@@ -1,16 +1,27 @@
|
|
|
-def format:
|
|
|
- del(.hash, .position)
|
|
|
- | .vcf_variants[] |= (del(.hash,.position,.reference,.alternative) | .infos |= map(select(. != "Empty")));
|
|
|
-
|
|
|
-def n_alt_in_constit:
|
|
|
- (.annotations | map(select(.ConstitAlt != null).ConstitAlt) // [0] | .[0]);
|
|
|
-
|
|
|
def contig_to_num(contig):
|
|
|
if contig == "chrX" then 23
|
|
|
elif contig == "chrY" then 24
|
|
|
elif contig == "chrM" then 25
|
|
|
else (contig | ltrimstr("chr") | tonumber // 255) end;
|
|
|
|
|
|
+def num_to_contig(n_contig):
|
|
|
+ if n_contig == 23 then "chrX"
|
|
|
+ elif n_contig == 24 then "chrY"
|
|
|
+ elif n_contig == 25 then "chrM"
|
|
|
+ else (n_contig | "chr" + tostring // "other") end;
|
|
|
+
|
|
|
+def format:
|
|
|
+ . + {pos: .position} + . | del(.position) |
|
|
|
+ {position: (.pos.position + 1)} + . |
|
|
|
+ {contig: num_to_contig(.pos.contig)} + . |
|
|
|
+ del(.hash, .pos) |
|
|
|
+ .vcf_variants[] |= (del(.hash,.position,.reference,.alternative) |
|
|
|
+ .infos |= map(select(. != "Empty")));
|
|
|
+
|
|
|
+def n_alt_in_constit:
|
|
|
+ (.annotations | map(select(.ConstitAlt != null).ConstitAlt) // [0] | .[0]);
|
|
|
+
|
|
|
+
|
|
|
def contig(contig_str):
|
|
|
.position.contig == contig_to_num(contig_str);
|
|
|
|