# How to parse CSQ (VEP) field inside Hail 0.2?

**URL:** <https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228>\
**Category:** Hail Query & hailctl\
**Created:** [December 21, 2019, 9:22pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228 "2019-12-21T21:22:43Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rost](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rost](https://discuss.hail.is/u/Rost)\
**Post date:** [December 21, 2019, 9:22pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/1 "2019-12-21T21:22:43Z")

</div>

Forgive me for the long post. 😓  
I want to calculate MAC `grouped_by` gene (`mt.sample_qc.n_singleton()`) for several subsets of variants and filtering, I must use specific field (for example “Consequence”, “CANONICAL” and “Gene”) for canonical transcripts. How can I do it inside Hail 0.2? I have tried to `hl.annotate_cols()` with extracting fields from transcripts, that had passed `mt.info.CSQ.filter()`, but did not succeed at every stage.  
This is a casual string of CSQ (VEP-annotation) for each transcript per variant:

> [“C|missense\_variant|MODERATE|AGRN|ENSG00000188157|Transcript|ENST0000037…”]

This is my hardcoding logic, that did not fit:

> consequence = 1  
> canonical = 23  
> gene = 4  
> correct\_transcript = hl.eval(mt.info.CSQ.filter(lambda x: all([hl.eval(hl.eval(x.split(‘|’))[consequence]) == ‘missense\_variant’, hl.eval(hl.eval(x.split(‘|’))[canonical]) == ‘YES’)))  
> mt = annotate\_rows(gene\_name = hl.eval(correct\_transcript[gene]))  
> hl.agg.group\_by(mt.gene\_name, hl.agg.sum(mt.sample\_qc.n\_singleton))

> mt.describe()  
> ----------------------------------------  
> Row fields:  
> …  
> ‘info’: struct {  
> …  
> CSQ: array\<str\>  
> }  
> ----------------------------------------  
> mt.info.CSQ  
> \<ArrayExpression of type array\<str\>\>

1. The first issue is that it is not clear how to handle the `ArrayExpression` of `StringExpression's`.
2. How to split in this case `StringExpression` (I suppose) and extract special field by a separator from a string.
3. It’s not clear how to apply the `ArrayExpression.filter()` or the alternative way in this case.
4. Should I create an additional variable (`hl.annotate_rows()`) with values from parsed CSQ-field necessarily?
5. How to exclude variants from dataset if correct\_transcript doesn’t pass the condition-filter (`None` or empty `[]`)?
6. Can I use `hl.eval()` for a sequence of conversions or I should hardcode nested `hl.eval(hl.eval(...))` for each operation?
7. Maybe it can be done somehow easier?

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [December 23, 2019, 1:53pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/2 "2019-12-23T13:53:54Z")

</div>

Dealing with VEP schemas is one of the most difficult problems to solve in Hail (or outside of Hail, I’m sure) so you should not be concerned about having trouble with this!

One of the first points to make is that `hl.eval` is something that won’t appear in most pipelines that process tables or matrix tables – it’s used in our docs to print the results of simple expressions for teaching purposes, and I think that’s probably a bad idea. Instead, you’ll be passing expressions into annotate\_rows, which knows how to apply those transformations to every row of a table / MatrixTable.

Here’s my attempt to write the VEP parser you’ve described:

```python
consequence = 1
canonical = 23
gene = 4
split_csq = mt.info.CSQ # it looks like this is already an array?
split_transcripts = split_csq.map(lambda x: x.split('|'))

kept_transcripts = split_transcripts.filter(
    lambda tx: (tx[consequence] == 'missense_variant') & (tx[canonical] == 'YES'))

mt = mt.annotate_rows(kept_transcripts = kept_transcripts)
# there can be more than one canonical transcript. If you want each to be treated separately, we can use explode. Otherwise, can use `head()`
mt = mt.explode_rows(mt.kept_transcripts) # option 1
mt = mt.annotate_rows(kept_transcripts = mt.kept_transcripts.head())) # option 2

# it looks like you want number of singleton variants per gene. This is just an aggregation of the rows.
mt_rows = mt.rows()
gene_ht = mt_rows.group_by(mt_rows.kept_transcripts.gene) \
    .aggregate(n_singleton = hl.agg.count_where(mt_rows.variant_qc.AC[1] == 1))

```

---

<div class="post-metadata">

**Author:** ![Rost](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rost](https://discuss.hail.is/u/Rost)\
**Post date:** [December 23, 2019, 5:52pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/3 "2019-12-23T17:52:23Z")

</div>

Thank you!

1. I assume that the “split” of hail supports regex, so we should use escaping of special symbols here:  
`split_csq.map(lambda x: x.split('\|'))`.
2. How to omit empty lists, which I got from `split_transcripts.filter()` ?

```auto
locus	alleles	
locus<GRCh37>	array<str>	array<array<str>>
1:957584	["C","A"]	[]
1:957593	["C","T"]	[["T","missense_variant","MODERATE","AGRN","ENSG00000188157","Transcript"...
1:957604	["G","A"]	[]
1:957624	["G","A"]	[["A","missense_variant","MODERATE","AGRN","ENSG00000188157","Transcript"...
1:957633	["T","C"]	[["C","missense_variant","MODERATE","AGRN","ENSG00000188157","Transcript"...

```

1. I suppose mt\_rows.kept\_transcripts doesn’t contain “gene” field, and I need to `annotate_rows()` before.

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [December 23, 2019, 6:09pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/4 "2019-12-23T18:09:19Z")

</div>

You may find the [overview](https://hail.is/docs/0.2/overview/index.html) a more accessible and broad introduction to Hail than the reference documentation.

1. Yes, the pipe should be escaped.
2. `Table.filter` removes rows of a table, try filtering on `hl.len(table.kept_transcripts[0]) > 0`
3. `kept_transcipts` is a field of a MatrixTable, or, after you call `.rows()`, a field of a Table, but as you’ve noticed it’s an array of arrays of strings. If these inner arrays have interesting structure rather than being arbitrary length collections of values, then you should consider converting the inner arrays to Hail Structs:

```auto
t.annotate(kept_transcripts=t.kept_transcripts.map(lambda x:
    hl.struct(alt=x[0], type=x[1], severity=x[2], gene=x[3], tid=x[4], ...)))

```

---

<div class="post-metadata">

**Author:** ![Rost](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rost](https://discuss.hail.is/u/Rost)\
**Post date:** [December 23, 2019, 10:42pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/5 "2019-12-23T22:42:11Z")

</div>

It’s still not clear for me how I should apply `hl.len(table.kept_transcripts[0]) > 0` to `ArrayExpression` of `ArrayExpressions`.

```auto
# I made a bool-mask for next filtering:
(hl.len(kept_transcripts) > 0).show(5)

locus	alleles	
locus<GRCh37>	array<str>	bool
1:957624	["G","A"]	false
1:957640	["C","T"]	true
1:957677	["C","T"]	false
1:957742	["C","T"]	true
1:957743	["C","G"]	false

# Even so, I don't know how to apply it. I tried to use your solution,
# but I still get unfiltered data:
kept_transcripts.filter(lambda tx: hl.len(tx) > 0)

locus	alleles	
locus<GRCh37>	array<str>	array<array<str>>
1:957624	["G","A"]	[]
1:957640	["C","T"]	[["T","synonymous_variant","LOW","AGRN","ENSG00000188157","Transcript","E...
1:957677	["C","T"]	[]
1:957742	["C","T"]	[["T","synonymous_variant","LOW","AGRN","ENSG00000188157","Transcript","E...
1:957743	["C","G"]	[]

```

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [December 24, 2019, 4:01pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/6 "2019-12-24T16:01:00Z")

</div>

OK, so, Tim used a somewhat advanced feature of Hail: _expressions_. I think the subtle difference between expressions and MatrixTables/Tables is causing confusion.

An expression is a hail value or a combination of hail values. Some simple examples:

```auto
x = hl.literal(3) # literal converts a python value to a hail value
a_str = hl.literal("abc")
y = x * 2 # python values are automatically converted in many cases
len_of_a_str = hl.len(a_str)

```

A key aspect of Hail is that expressions can be _keyed_. An _keyed_ expression is an element of a Table or MatrixTable.

```auto
t = hl.utils.range_table(10) # a table with a field idx with values 0 to 9
t # a Table
t.idx # a Table-keyed expression

```

You can `show` a Table or an expression. The difference is more clear when a Table has many columns:

```auto
import hail as hl
t = hl.utils.range_table(10) # a table with a field idx with values 0 to 9
t = t.annotate(idx_sqr = t.idx * t.idx,
               idx_cube = t.idx * t.idx * t.idx)
t.show()
t.idx.show()
t.idx_sqr.show()
(t.idx_sqr < 9).show()
t.describe()

```

Run the above. You’ll see that `Table.show` shows all the fields on a table. `Expression.show` shows the expressed value _and the key, if it exists_. `t.idx` is its own key, so it is printed alone. `t.idx_sqr`'s key is `t.idx`, so both are printed. Same for the boolean expression.

MatrixTables generalize a Table into two dimensions: there is both a row-key and a column-key. Row-keyed values are called “row fields”. Column-keyed values are called “column fields”. Row _and_ column keyed values are called “entry fields”.

```auto
mt = hl.utils.range_matrix_table(3, 3)
mt = mt.annotate_entries(product = mt.row_idx * mt.col_idx,
                         sum = mt.row_idx + mt.col_idx)
mt = mt.annotate_rows(row_idx_sqr = mt.row_idx * mt.row_idx)
mt = mt.annotate_cols(col_idx_sqr = mt.col_idx * mt.col_idx)
mt.show()
mt.col_idx_sqr.show()
mt.row_idx_sqr.show()
mt.product.show()
(mt.product == mt.sum).show()

```

Run the above. You’ll see again how expressions with a variety of keys are displayed.

* * *

Ok, let’s rewrite Tim’s code to avoid saving expressions in python variables. We’ll only save table or matrix tables in python variables. I think this will avoid confusion.

```auto
consequence = 1
canonical = 23
gene = 4

mt = mt.annotate_rows(kept_transcripts =
    mt.info.CSQ.map(
        lambda x: x.split('|')
    ).filter(
        lambda tx: (tx[consequence] == 'missense_variant') & (tx[canonical] == 'YES')
    )
)
# there can be more than one canonical transcript. If you want each to be treated separately, we can use explode. Otherwise, can use `head()`
mt = mt.explode_rows(mt.kept_transcripts) # option 1
mt = mt.annotate_rows(kept_transcripts = mt.kept_transcripts.head())) # option 2

# it looks like you want number of singleton variants per gene. This is just an aggregation of the rows.
mt_rows = mt.rows()
gene_ht = mt_rows.group_by(mt_rows.kept_transcripts.gene) \
    .aggregate(n_singleton = hl.agg.count_where(mt_rows.variant_qc.AC[1] == 1))

```

OK, so, let’s remove the last line and replace it with this:

```auto
mt_rows = mt_rows.filter(hl.len(mt_rows.kept_transcripts) >= 1)
mt_rows = mt_rows.annotate(kept_transcripts =
    mt_rows.kept_transcripts.map(
        lambda x: hl.struct(alt=x[0], type=x[1], severity=x[2], gene=x[3], tid=x[4], rest=x[5:])
    )
)

```

I filter to rows that have at least one transcript. Then I convert each transcript in the `kept_transcripts` array (a field of the Table `mt_rows`) to a struct that has some friendly names for its elements. All the elements that I chose not to name I kept as an array and gave the name `rest`.

Ok, one more thing, there can be multiple transcripts per locus and alleles because genes can overlap. So let’s copy every row for each transcript it has, converting the `kept_transcripts` array-of-structs field to a struct field.

```auto
mt_rows = mt_rows.explode(mt_rows.kept_transcripts)

```

Now we can group\_by:

```auto
gene_ht = mt_rows.group_by(mt_rows.kept_transcripts.gene) \
    .aggregate(n_singleton = hl.agg.count_where(mt_rows.variant_qc.AC[1] == 1))

```

---

<div class="post-metadata">

**Author:** ![Rost](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rost](https://discuss.hail.is/u/Rost)\
**Post date:** [December 30, 2019, 9:03pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/7 "2019-12-30T21:03:04Z")

</div>

Thank you! Everything is working fine!  
I have a last optional issue.  
Can I make one object (`mt`) which contain several different results of filtering? For example:

1. `kept_transcripts_synonymic`
2. `kept_transcripts_missense`,
3. `kept_transcripts_LoF`

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [December 31, 2019, 9:57pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/8 "2019-12-31T21:57:58Z")

</div>

yes, absolutely - you can add multiple lines as shown here:

```python
mt = mt.annotate_rows(kept_transcripts_synonymous =
    mt.info.CSQ.map(
        lambda x: x.split('|')
    ).filter(
        lambda tx: (tx[consequence] == 'synonymous') & (tx[canonical] == 'YES')
    ),
    kept_transcripts_missense =
    mt.info.CSQ.map(
        lambda x: x.split('|')
    ).filter(
        lambda tx: (tx[consequence] == 'synonymous') & (tx[canonical] == 'YES')
    ),
    ...
)

```

---

<div class="post-metadata">

**Author:** ![Rost](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rost](https://discuss.hail.is/u/Rost)\
**Post date:** [March 3, 2021, 11:43pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/9 "2021-03-03T23:43:22Z")

</div>

Hi, Hail!  
It’s been a long time since I used such type of annotation (as raw `tstr` object). Then I learned how to use VEP inside `Hail 0.2` and parse annotation as describes in `json` scheme. And now I need to choose elements from all fields from `mt.vep.transcript_consequences` according to the canonical transcript id. Is there a natural easy solution for that case?

```auto
In [39]: mt.vep.transcript_consequences.canonical.show(3)
+---------------+------------+--------------------------------------------+
| locus | alleles | <expr> |
+---------------+------------+--------------------------------------------+
| locus<GRCh37> | array<str> | array<int32> |
+---------------+------------+--------------------------------------------+
| 1:904165 | ["G","A"] | [1,NA,NA,1,NA,NA,NA,NA,NA,1,NA,1] |
| 1:909917 | ["G","A"] | [NA,NA,NA,1,1,NA,NA,NA,NA,NA,NA,1,1,NA,NA] |
| 1:986963 | ["C","T"] | [1,1,NA,NA,NA,NA,NA,1,NA,NA] |
+---------------+------------+--------------------------------------------+
```

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [March 4, 2021, 2:05pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/10 "2021-03-04T14:05:49Z")

</div>

You can do something like:

```auto
canonical_transcript_csq = mt.vep.transcript_consequences\
    .filter(lambda tc: tc.canonical == 1)

```

And then use that however you need.

---

<div class="post-metadata">

**Author:** ![Rost](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rost](https://discuss.hail.is/u/Rost)\
**Post date:** [March 4, 2021, 3:38pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/11 "2021-03-04T15:38:16Z")

</div>

Thanks! That works!

---

<div class="post-metadata">

**Author:** ![Rost](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rost](https://discuss.hail.is/u/Rost)\
**Post date:** [March 5, 2021, 10:00pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/12 "2021-03-05T22:00:57Z")

</div>

Well, but what should I do in the case when I need to select one annotation by `most_severe_consequence`?  
I try to do that as you suggest above however, it’s correct only for comparison with `int`.  
Then I decide that I need something kind of `which` in R and find an index of each needed element:

```auto
mt.vep.transcript_consequences.consequence_terms\
      .index(lambda x: x.contains(mt.vep.most_severe_consequence))

```

How to apply that indicies for each field in `mt.vep.transcript_consequences` or do that more naturally?

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [March 6, 2021, 4:45pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/13 "2021-03-06T16:45:10Z")

</div>

The gnomAD team has written a little function to do just this, as I understand it: [gnomad\_methods/vep.py at 8da14b2f438b3ca98b65658ad83cb65a449e7c46 · broadinstitute/gnomad\_methods · GitHub](https://github.com/broadinstitute/gnomad_methods/blob/8da14b2f438b3ca98b65658ad83cb65a449e7c46/gnomad/utils/vep.py#L478-L553)

---

<div class="post-metadata">

**Author:** ![shao](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@shao](https://discuss.hail.is/u/shao)\
**Post date:** [February 9, 2023, 3:31pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/14 "2023-02-09T15:31:50Z")

</div>

I tried to use this to parse the CSQ column using

```python
split_csq.map(lambda x: x.split('\|')).

```

However, the returned didn’t split by ‘|’

```python
split_csq = mt.info.CSQ
split_transcripts = split_csq.map(lambda x: x.split('|'))
split_transcripts = split_csq.map(lambda x: x.split('|'))
n
split_transcripts.show()
locus
alleles
locus<GRCh38>	array<str>	array<array<str>>
chr1:12672	["C","T"]	[["T","|","n","o","n","_","c","o","d","i","n","g","_","t","r","a","n","s","c","r","i","p","t","_","e","x","o","n","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","D","D","X","1","1","L","1","|","E","N","S","G","0","0","0","0","0","2","2","3","9","7","2","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","5","0","3","0","5","|","t","r","a","n","s","c","r","i","b","e","d","_","u","n","p","r","o","c","e","s","s","e","d","_","p","s","e","u","d","o","g","e","n","e","|","3","/","6","|","|","E","N","S","T","0","0","0","0","0","4","5","0","3","0","5",".","2",":","n",".","1","5","7","C",">","T","|","|","1","5","7","|","|","|","|","|","r","s","1","4","1","9","0","7","2","0","5","0","|","1","|","|","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","3","7","1","0","2","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","0","2","0","0","8","|","0",".","0","0","2","9","2","|","0",".","0","0","2","7","7","8","|","0","|","0",".","0","0","5","3","1","9","|","0","|","0",".","0","0","0","4","7","0","8","|","0","|","0",".","0","0","1","7","3","3","|","0",".","0","4","7","9","1","|","0",".","0","7","4","5","1","|","0","|","0",".","0","1","8","5","2","|","0",".","0","4","5","4","5","|","0",".","0","3","7","9","7","|","0","|","0","|","0",".","0","1","5","4","1","|","0",".","1","1","1","1","|","0",".","0","3","6","5","9","|","0",".","1","1","1","1","|","g","n","o","m","A","D","g","_","O","T","H","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["T","|","n","o","n","_","c","o","d","i","n","g","_","t","r","a","n","s","c","r","i","p","t","_","e","x","o","n","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","D","D","X","1","1","L","2","|","E","N","S","G","0","0","0","0","0","2","9","0","8","2","5","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","5","6","3","2","8","|","l","n","c","R","N","A","|","2","/","3","|","|","E","N","S","T","0","0","0","0","0","4","5","6","3","2","8",".","2",":","n",".","4","1","9","C",">","T","|","|","4","1","9","|","|","|","|","|","r","s","1","4","1","9","0","7","2","0","5","0","|","1","|","|","1","|","|","S","N","V","|","1","|","E","n","t","r","e","z","G","e","n","e","|","|","Y","E","S","|","|","|","1","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","0","2","0","0","8","|","0",".","0","0","2","9","2","|","0",".","0","0","2","7","7","8","|","0","|","0",".","0","0","5","3","1","9","|","0","|","0",".","0","0","0","4","7","0","8","|","0","|","0",".","0","0","1","7","3","3","|","0",".","0","4","7","9","1","|","0",".","0","7","4","5","1","|","0","|","0",".","0","1","8","5","2","|","0",".","0","4","5","4","5","|","0",".","0","3","7","9","7","|","0","|","0","|","0",".","0","1","5","4","1","|","0",".","1","1","1","1","|","0",".","0","3","6","5","9","|","0",".","1","1","1","1","|","g","n","o","m","A","D","g","_","O","T","H","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["T","|","d","o","w","n","s","t","r","e","a","m","_","g","e","n","e","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","W","A","S","H","7","P","|","E","N","S","G","0","0","0","0","0","2","2","7","2","3","2","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","8","8","1","4","7","|","u","n","p","r","o","c","e","s","s","e","d","_","p","s","e","u","d","o","g","e","n","e","|","|","|","|","|","|","|","|","|","|","r","s","1","4","1","9","0","7","2","0","5","0","|","1","|","1","7","3","2","|","-","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","3","8","0","3","4","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","0","2","0","0","8","|","0",".","0","0","2","9","2","|","0",".","0","0","2","7","7","8","|","0","|","0",".","0","0","5","3","1","9","|","0","|","0",".","0","0","0","4","7","0","8","|","0","|","0",".","0","0","1","7","3","3","|","0",".","0","4","7","9","1","|","0",".","0","7","4","5","1","|","0","|","0",".","0","1","8","5","2","|","0",".","0","4","5","4","5","|","0",".","0","3","7","9","7","|","0","|","0","|","0",".","0","1","5","4","1","|","0",".","1","1","1","1","|","0",".","0","3","6","5","9","|","0",".","1","1","1","1","|","g","n","o","m","A","D","g","_","O","T","H","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["T","|","d","o","w","n","s","t","r","e","a","m","_","g","e","n","e","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","M","I","R","6","8","5","9","-","1","|","E","N","S","G","0","0","0","0","0","2","7","8","2","6","7","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","6","1","9","2","1","6","|","m","i","R","N","A","|","|","|","|","|","|","|","|","|","|","r","s","1","4","1","9","0","7","2","0","5","0","|","1","|","4","6","9","7","|","-","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","5","0","0","3","9","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","0","2","0","0","8","|","0",".","0","0","2","9","2","|","0",".","0","0","2","7","7","8","|","0","|","0",".","0","0","5","3","1","9","|","0","|","0",".","0","0","0","4","7","0","8","|","0","|","0",".","0","0","1","7","3","3","|","0",".","0","4","7","9","1","|","0",".","0","7","4","5","1","|","0","|","0",".","0","1","8","5","2","|","0",".","0","4","5","4","5","|","0",".","0","3","7","9","7","|","0","|","0","|","0",".","0","1","5","4","1","|","0",".","1","1","1","1","|","0",".","0","3","6","5","9","|","0",".","1","1","1","1","|","g","n","o","m","A","D","g","_","O","T","H","|","|","|","|","|","|","|","|","|","|","|","|","|",""]]
chr1:12755	["G","A"]	[["A","|","i","n","t","r","o","n","_","v","a","r","i","a","n","t","&","n","o","n","_","c","o","d","i","n","g","_","t","r","a","n","s","c","r","i","p","t","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","D","D","X","1","1","L","1","|","E","N","S","G","0","0","0","0","0","2","2","3","9","7","2","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","5","0","3","0","5","|","t","r","a","n","s","c","r","i","b","e","d","_","u","n","p","r","o","c","e","s","s","e","d","_","p","s","e","u","d","o","g","e","n","e","|","|","3","/","5","|","E","N","S","T","0","0","0","0","0","4","5","0","3","0","5",".","2",":","n",".","1","8","2","+","5","8","G",">","A","|","|","|","|","|","|","|","r","s","1","2","8","3","3","0","2","4","6","9","|","1","|","|","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","3","7","1","0","2","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","0","0","4","9","7","2","|","0",".","0","0","1","3","3","5","|","0",".","0","0","0","5","1","0","7","|","0","|","0",".","0","0","0","5","0","6","1","|","0","|","0",".","0","0","0","2","1","2","5","|","0","|","0",".","0","0","0","4","2","6","6","|","0",".","0","1","7","1","3","|","0",".","0","4","1","5","6","|","0","|","0",".","0","0","9","0","7","7","|","0","|","0","|","0","|","0","|","0",".","0","0","0","3","3","|","0",".","0","0","7","0","4","2","|","0",".","0","0","1","3","2","3","|","0",".","0","4","1","5","6","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["A","|","i","n","t","r","o","n","_","v","a","r","i","a","n","t","&","n","o","n","_","c","o","d","i","n","g","_","t","r","a","n","s","c","r","i","p","t","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","D","D","X","1","1","L","2","|","E","N","S","G","0","0","0","0","0","2","9","0","8","2","5","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","5","6","3","2","8","|","l","n","c","R","N","A","|","|","2","/","2","|","E","N","S","T","0","0","0","0","0","4","5","6","3","2","8",".","2",":","n",".","4","6","8","+","3","4","G",">","A","|","|","|","|","|","|","|","r","s","1","2","8","3","3","0","2","4","6","9","|","1","|","|","1","|","|","S","N","V","|","1","|","E","n","t","r","e","z","G","e","n","e","|","|","Y","E","S","|","|","|","1","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","0","0","4","9","7","2","|","0",".","0","0","1","3","3","5","|","0",".","0","0","0","5","1","0","7","|","0","|","0",".","0","0","0","5","0","6","1","|","0","|","0",".","0","0","0","2","1","2","5","|","0","|","0",".","0","0","0","4","2","6","6","|","0",".","0","1","7","1","3","|","0",".","0","4","1","5","6","|","0","|","0",".","0","0","9","0","7","7","|","0","|","0","|","0","|","0","|","0",".","0","0","0","3","3","|","0",".","0","0","7","0","4","2","|","0",".","0","0","1","3","2","3","|","0",".","0","4","1","5","6","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["A","|","d","o","w","n","s","t","r","e","a","m","_","g","e","n","e","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","W","A","S","H","7","P","|","E","N","S","G","0","0","0","0","0","2","2","7","2","3","2","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","8","8","1","4","7","|","u","n","p","r","o","c","e","s","s","e","d","_","p","s","e","u","d","o","g","e","n","e","|","|","|","|","|","|","|","|","|","|","r","s","1","2","8","3","3","0","2","4","6","9","|","1","|","1","6","4","9","|","-","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","3","8","0","3","4","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","0","0","4","9","7","2","|","0",".","0","0","1","3","3","5","|","0",".","0","0","0","5","1","0","7","|","0","|","0",".","0","0","0","5","0","6","1","|","0","|","0",".","0","0","0","2","1","2","5","|","0","|","0",".","0","0","0","4","2","6","6","|","0",".","0","1","7","1","3","|","0",".","0","4","1","5","6","|","0","|","0",".","0","0","9","0","7","7","|","0","|","0","|","0","|","0","|","0",".","0","0","0","3","3","|","0",".","0","0","7","0","4","2","|","0",".","0","0","1","3","2","3","|","0",".","0","4","1","5","6","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["A","|","d","o","w","n","s","t","r","e","a","m","_","g","e","n","e","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","M","I","R","6","8","5","9","-","1","|","E","N","S","G","0","0","0","0","0","2","7","8","2","6","7","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","6","1","9","2","1","6","|","m","i","R","N","A","|","|","|","|","|","|","|","|","|","|","r","s","1","2","8","3","3","0","2","4","6","9","|","1","|","4","6","1","4","|","-","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","5","0","0","3","9","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","0","0","4","9","7","2","|","0",".","0","0","1","3","3","5","|","0",".","0","0","0","5","1","0","7","|","0","|","0",".","0","0","0","5","0","6","1","|","0","|","0",".","0","0","0","2","1","2","5","|","0","|","0",".","0","0","0","4","2","6","6","|","0",".","0","1","7","1","3","|","0",".","0","4","1","5","6","|","0","|","0",".","0","0","9","0","7","7","|","0","|","0","|","0","|","0","|","0",".","0","0","0","3","3","|","0",".","0","0","7","0","4","2","|","0",".","0","0","1","3","2","3","|","0",".","0","4","1","5","6","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""]]
chr1:12783	["G","A"]	[["A","|","i","n","t","r","o","n","_","v","a","r","i","a","n","t","&","n","o","n","_","c","o","d","i","n","g","_","t","r","a","n","s","c","r","i","p","t","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","D","D","X","1","1","L","1","|","E","N","S","G","0","0","0","0","0","2","2","3","9","7","2","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","5","0","3","0","5","|","t","r","a","n","s","c","r","i","b","e","d","_","u","n","p","r","o","c","e","s","s","e","d","_","p","s","e","u","d","o","g","e","n","e","|","|","3","/","5","|","E","N","S","T","0","0","0","0","0","4","5","0","3","0","5",".","2",":","n",".","1","8","2","+","8","6","G",">","A","|","|","|","|","|","|","|","r","s","6","2","6","3","5","2","8","4","|","1","|","|","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","3","7","1","0","2","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","1","4","4","3","|","0",".","0","3","2","3","2","|","0","|","0",".","0","0","8","5","2","3","|","0","|","0",".","0","0","0","4","4","3","7","|","0","|","0","|","0",".","0","0","0","1","8","2","|","0",".","0","1","0","4","5","|","0","|","0",".","0","3","2","3","2","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["A","|","i","n","t","r","o","n","_","v","a","r","i","a","n","t","&","n","o","n","_","c","o","d","i","n","g","_","t","r","a","n","s","c","r","i","p","t","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","D","D","X","1","1","L","2","|","E","N","S","G","0","0","0","0","0","2","9","0","8","2","5","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","5","6","3","2","8","|","l","n","c","R","N","A","|","|","2","/","2","|","E","N","S","T","0","0","0","0","0","4","5","6","3","2","8",".","2",":","n",".","4","6","8","+","6","2","G",">","A","|","|","|","|","|","|","|","r","s","6","2","6","3","5","2","8","4","|","1","|","|","1","|","|","S","N","V","|","1","|","E","n","t","r","e","z","G","e","n","e","|","|","Y","E","S","|","|","|","1","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","1","4","4","3","|","0",".","0","3","2","3","2","|","0","|","0",".","0","0","8","5","2","3","|","0","|","0",".","0","0","0","4","4","3","7","|","0","|","0","|","0",".","0","0","0","1","8","2","|","0",".","0","1","0","4","5","|","0","|","0",".","0","3","2","3","2","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["A","|","d","o","w","n","s","t","r","e","a","m","_","g","e","n","e","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","W","A","S","H","7","P","|","E","N","S","G","0","0","0","0","0","2","2","7","2","3","2","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","8","8","1","4","7","|","u","n","p","r","o","c","e","s","s","e","d","_","p","s","e","u","d","o","g","e","n","e","|","|","|","|","|","|","|","|","|","|","r","s","6","2","6","3","5","2","8","4","|","1","|","1","6","2","1","|","-","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","3","8","0","3","4","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","1","4","4","3","|","0",".","0","3","2","3","2","|","0","|","0",".","0","0","8","5","2","3","|","0","|","0",".","0","0","0","4","4","3","7","|","0","|","0","|","0",".","0","0","0","1","8","2","|","0",".","0","1","0","4","5","|","0","|","0",".","0","3","2","3","2","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["A","|","d","o","w","n","s","t","r","e","a","m","_","g","e","n","e","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","M","I","R","6","8","5","9","-","1","|","E","N","S","G","0","0","0","0","0","2","7","8","2","6","7","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","6","1","9","2","1","6","|","m","i","R","N","A","|","|","|","|","|","|","|","|","|","|","r","s","6","2","6","3","5","2","8","4","|","1","|","4","5","8","6","|","-","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","5","0","0","3","9","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","0","1","4","4","3","|","0",".","0","3","2","3","2","|","0","|","0",".","0","0","8","5","2","3","|","0","|","0",".","0","0","0","4","4","3","7","|","0","|","0","|","0",".","0","0","0","1","8","2","|","0",".","0","1","0","4","5","|","0","|","0",".","0","3","2","3","2","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""]]
chr1:12807	["C","T"]	[["T","|","i","n","t","r","o","n","_","v","a","r","i","a","n","t","&","n","o","n","_","c","o","d","i","n","g","_","t","r","a","n","s","c","r","i","p","t","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","D","D","X","1","1","L","1","|","E","N","S","G","0","0","0","0","0","2","2","3","9","7","2","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","5","0","3","0","5","|","t","r","a","n","s","c","r","i","b","e","d","_","u","n","p","r","o","c","e","s","s","e","d","_","p","s","e","u","d","o","g","e","n","e","|","|","3","/","5","|","E","N","S","T","0","0","0","0","0","4","5","0","3","0","5",".","2",":","n",".","1","8","2","+","1","1","0","C",">","T","|","|","|","|","|","|","|","r","s","6","2","6","3","5","2","8","5","|","1","|","|","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","3","7","1","0","2","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","2","1","2","4","|","0",".","3","1","2","4","|","0",".","0","8","5","2","3","|","0",".","1","6","0","6","|","0",".","1","9","3","5","|","0",".","1","8","3","4","|","0",".","2","8","1","1","|","0",".","1","4","5","8","|","0",".","1","1","5","|","0",".","2","1","2","8","|","0",".","1","8","3","7","|","0",".","3","1","2","4","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["T","|","i","n","t","r","o","n","_","v","a","r","i","a","n","t","&","n","o","n","_","c","o","d","i","n","g","_","t","r","a","n","s","c","r","i","p","t","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","D","D","X","1","1","L","2","|","E","N","S","G","0","0","0","0","0","2","9","0","8","2","5","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","5","6","3","2","8","|","l","n","c","R","N","A","|","|","2","/","2","|","E","N","S","T","0","0","0","0","0","4","5","6","3","2","8",".","2",":","n",".","4","6","8","+","8","6","C",">","T","|","|","|","|","|","|","|","r","s","6","2","6","3","5","2","8","5","|","1","|","|","1","|","|","S","N","V","|","1","|","E","n","t","r","e","z","G","e","n","e","|","|","Y","E","S","|","|","|","1","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","2","1","2","4","|","0",".","3","1","2","4","|","0",".","0","8","5","2","3","|","0",".","1","6","0","6","|","0",".","1","9","3","5","|","0",".","1","8","3","4","|","0",".","2","8","1","1","|","0",".","1","4","5","8","|","0",".","1","1","5","|","0",".","2","1","2","8","|","0",".","1","8","3","7","|","0",".","3","1","2","4","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["T","|","d","o","w","n","s","t","r","e","a","m","_","g","e","n","e","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","W","A","S","H","7","P","|","E","N","S","G","0","0","0","0","0","2","2","7","2","3","2","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","4","8","8","1","4","7","|","u","n","p","r","o","c","e","s","s","e","d","_","p","s","e","u","d","o","g","e","n","e","|","|","|","|","|","|","|","|","|","|","r","s","6","2","6","3","5","2","8","5","|","1","|","1","5","9","7","|","-","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","3","8","0","3","4","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","2","1","2","4","|","0",".","3","1","2","4","|","0",".","0","8","5","2","3","|","0",".","1","6","0","6","|","0",".","1","9","3","5","|","0",".","1","8","3","4","|","0",".","2","8","1","1","|","0",".","1","4","5","8","|","0",".","1","1","5","|","0",".","2","1","2","8","|","0",".","1","8","3","7","|","0",".","3","1","2","4","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["T","|","d","o","w","n","s","t","r","e","a","m","_","g","e","n","e","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","M","I","R","6","8","5","9","-","1","|","E","N","S","G","0","0","0","0","0","2","7","8","2","6","7","|","T","r","a","n","s","c","r","i","p","t","|","E","N","S","T","0","0","0","0","0","6","1","9","2","1","6","|","m","i","R","N","A","|","|","|","|","|","|","|","|","|","|","r","s","6","2","6","3","5","2","8","5","|","1","|","4","5","6","2","|","-","1","|","|","S","N","V","|","1","|","H","G","N","C","|","H","G","N","C",":","5","0","0","3","9","|","Y","E","S","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","2","1","2","4","|","0",".","3","1","2","4","|","0",".","0","8","5","2","3","|","0",".","1","6","0","6","|","0",".","1","9","3","5","|","0",".","1","8","3","4","|","0",".","2","8","1","1","|","0",".","1","4","5","8","|","0",".","1","1","5","|","0",".","2","1","2","8","|","0",".","1","8","3","7","|","0",".","3","1","2","4","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""],["T","|","r","e","g","u","l","a","t","o","r","y","_","r","e","g","i","o","n","_","v","a","r","i","a","n","t","|","M","O","D","I","F","I","E","R","|","|","|","R","e","g","u","l","a","t","o","r","y","F","e","a","t","u","r","e","|","E","N","S","R","0","0","0","0","1","1","6","4","7","4","5","|","e","n","h","a","n","c","e","r","|","|","|","|","|","|","|","|","|","|","r","s","6","2","6","3","5","2","8","5","|","1","|","|","|","|","S","N","V","|","1","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","|","0",".","2","1","2","4","|","0",".","3","1","2","4","|","0",".","0","8","5","2","3","|","0",".","1","6","0","6","|","0",".","1","9","3","5","|","0",".","1","8","3","4","|","0",".","2","8","1","1","|","0",".","1","4","5","8","|","0",".","1","1","5","|","0",".","2","1","2","8","|","0",".","1","8","3","7","|","0",".","3","1","2","4","|","g","n","o","m","A","D","g","_","A","F","R","|","|","|","|","|","|","|","|","|","|","|","|","|",""]]
chr1:12894	["G","T"]	

```

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [February 9, 2023, 7:39pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/15 "2023-02-09T19:39:41Z")

</div>

In your first code snippet you wrote

```python
split_csq.map(lambda x: x.split('\|'))

```

But your second code snippet you wrote

```python
split_transcripts = split_csq.map(lambda x: x.split('|'))

```

The former is correct, the latter is incorrect. Can you try the former?

---

<div class="post-metadata">

**Author:** ![shao](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@shao](https://discuss.hail.is/u/shao)\
**Post date:** [February 9, 2023, 8:14pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/16 "2023-02-09T20:14:47Z")

</div>

Ah my bad! Yes, the former worked, thanks so much!

---

<div class="post-metadata">

**Author:** ![shao](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@shao](https://discuss.hail.is/u/shao)\
**Post date:** [February 14, 2023, 7:59pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/17 "2023-02-14T19:59:50Z")

</div>

@danking  
I would like to annotate each of the fields in consequence as a specific term for the matrix, but when I tried it doesn’t split the array of strings to grab what is at array index 2

`mt = mt.annotate_rows(CSQ = split_transcripts) mt = mt.annotate_rows(consequence = mt.CSQ[2]) `

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/1X/845fcd6073f982c8422fc00705ea79874b0dfd89.png)

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [February 14, 2023, 9:24pm UTC](https://discuss.hail.is/t/how-to-parse-csq-vep-field-inside-hail-0-2/1228/18 "2023-02-14T21:24:01Z")

</div>

I think you’re confused by nested arrays. The CSQ field is an array of strings.

You could grab the second element of every split CSQ field:

```python
CSQ2s = mt.CSQ.map(lambda x: x[2])

```

Is that what you want?
