We on the FAS Team recently had a case we wanted to share where Compute Field could help a customer navigate filtering a unique edge case. This edge case coincides with the rising popularity of filtering on a specific value for the Alternate of the Allelic Depths Column. Said another way, we could be looking for Alt DP greater than or equal to 1. This may be useful as an alternative to a Variant Allele Fraction (VAF) filter or in addition to a VAF filter.
The first step of this problem is isolating the second portion of the AD field. This can be easily done with Compute Fields, as seen below (Figure 1). This will generate a new column with the other Sample Fields in the small variant table in VarSeq.
Hypothetically, this is a sound strategy, where the user could generate a filter from the new field and continue on with their day. One customer, though, stumbled across an extremely rare edge case where this filter was no longer functional, and we needed to get a clearer idea of how we use Compute Fields. In this example, we are still looking to filter on the AD [1] field, but this field returned a missing indication despite the variant being in the project (Figure 2). Upon investigation, we found out that the sample in question is in a project with many other samples, and there is another variant in the project that is at the same position with a different Alt call.
So, what will a FAS with access to the Compute Fields Algorithm do? There are technically many ways you could get around this problem. Here is just one example of how we decided to get the correct value for filtering. Back in Compute Fields, we use the following expression:
len(AD) > 2 ? AD[2] : AD[1]
This says that if the length of the AD field is greater than two positions deep, and if the second position is missing (?), go with the third position [2]. This is simple and fixes the current problem for sure. We could also go further to build out hypothetical fields if a position has even more alt calls (for example, G/C/T/A where G is the Ref and the rest are alternate calls).
So, how would you design a Compute Fields Function to grab that last position? We would love to see what you came up with, so feel free to add it to the comments! Meanwhile, if you have any questions or similar problems you would like to discuss with our FAS team, please contact us at [email protected], and we are happy to help you find a solution.