brentp / slivar

genetic variant expressions, annotation, and filtering for great good.
MIT License
248 stars 23 forks source link

trio and family expr results #124

Open luceamso opened 2 years ago

luceamso commented 2 years ago

Hi Brent,

I encountered the following issues and would like to ask you for help. I ran --family-expr because I considered fam1(unaffected parents and 3 affected kids) as one cohort. When using the --family-epxr, no any recessive variants were observed. However, it was found when the trio vcf file(cut fam1 to trio) was input to check other conditions.

So I tested expression with following: 1)--family-expr with trio vcf file 2)--trio with fam1's vcf file

And the recessive variants were extracted from each. Only in --family-expr with fam1's vcf file, the recessive variants doesn't appear. (I also applied the same filter condition to all expressions.)

Thanks for your time, Seoon.

--------------------------------PED-------------------------------------

family_ID sample_ID paternal_ID maternal_ID sex affection

fam1 F7 0 0 1 1 fam1 F9 0 0 2 1 fam1 F8 F7 F9 2 2 fam1 F14 F7 F9 2 2 fam1 F15 F7 F9 1 2 fam2 F10 0 0 1 1 fam2 F11 F10 0 1 1 fam2 F16 F10 0 2 1

--------------------------------codes------------------------------------- 1)--family-epxr slivar expr --js slivar-functions.js --vcf cs_affected_fam1_snpanno.vcf.gz --ped cs_two_fam.ped --info "(INFO['gnomAD_r2.1.1_merged_all'] < 0.01 || INFO['gnomAD_r2.1.1_merged_all'] == '.') && INFO.AC >1 && (INFO['Func.refGeneWithVer'] == 'exonic' || INFO['Func.refGeneWithVer'] == 'splicing') && INFO['ExonicFunc.refGeneWithVer'] != 'unknown' && variant.FILTER == 'PASS' && variant.ALT[0] != '*'" --family-expr "recessive:fam.every(segregating_recessive)"

2)--trio slivar expr --js slivar-functions.js --vcf cs_affected_fam1_snpanno.vcf.gz --ped cs_two_fam.ped--info "(INFO['gnomAD_r2.1.1_merged_all'] < 0.01 || INFO['gnomAD_r2.1.1_merged_all'] == '.') && INFO.AC >1 && (INFO['Func.refGeneWithVer'] == 'exonic' || INFO['Func.refGeneWithVer'] == 'splicing') && INFO['ExonicFunc.refGeneWithVer'] != 'unknown' && variant.FILTER == 'PASS' && variant.ALT[0] != '*'" --trio "recessive:recessive(kid, mom, dad)"

brentp commented 2 years ago

the --family-expr would require all the affected kids to share the same recessive variant whereas --trio would find variants where each kid individually had a recessive variant. The intersection of the 3 trio expressions (where all 3 kids have the same variant) should match the recessive for the --family-expr -- that is, there should be no intersection. If that's not the case, you could paste the genotypes and variant and I can have a look.

luceamso commented 2 years ago

Thanks for getting back to me so quickly.

No, you're right. I thought --family-expr also showed every recessive variants. Thanks very much.

luceamso commented 2 years ago

Hi, --family-expr require variants shared by all the affected kids, but my output doesn't. It shows that all the affected kids do not share the variant, but the slivar does. I used the following codes:

--family-expr 'rec:fam.every(segregating_recessive) && (INFO["Func.refGeneWithVer"] == "splicing" || INFO["Func.refGeneWithVer"] == "exonic" || INFO["Func.refGeneWithVer"].match("x3bsplicing") != null)' \
--family-expr 'a:fam.every(function(s) {return (s.het || s.hom_ref) && s.GQ >= 20 }) && fam.some(function(s) { return s.het && s.affected }) && (INFO["Func.refGeneWithVer"] == "splicing" || INFO["Func.refGeneWithVer"].match("x3bsplicing") != null)' \
--family-expr 'b:fam.every(function(s) {return (s.het || s.hom_ref) && s.GQ >= 20 }) && fam.some(function(s) { return s.het && s.affected }) && (INFO["ExonicFunc.refGeneWithVer"]  == "stopgain" || INFO["ExonicFunc.refGeneWithVer"] == "frameshift_deletion" || INFO["ExonicFunc.refGeneWithVer"] == "frameshift_insertion")' \
--family-expr 'c:fam.every(function(s) {return (s.het || s.hom_ref) && s.GQ >= 20 }) && fam.some(function(s) { return s.het && s.affected }) && (INFO["Func.refGeneWithVer"] == "exonic" && (INFO.MetaSVM_pred == "D" || INFO.REVEL_rankscore >= 0.75))' \
--family-expr 'd:fam.every(function(s) {return (s.het || s.hom_ref) && s.GQ >= 20 }) && fam.some(function(s) { return s.het && s.affected }) && (INFO["ExonicFunc.refGeneWithVer"] == "nonframeshift_deletion" || INFO["ExonicFunc.refGeneWithVer"] == "nonframeshift_insertion")' \
--family-expr 'e:fam.every(function(s) {return (s.het || s.hom_ref) && s.GQ >= 20 }) && fam.some(function(s) { return s.het && s.affected }) && (INFO["Func.refGeneWithVer"] == "intronic" && (INFO.spliceAI_DS_AG > 0.5 || INFO.spliceAI_DS_AL > 0.5 || INFO.spliceAI_DS_DG > 0.5 || INFO.spliceAI_DS_DL > 0.5))' \

Could you please look at the attachment? example.txt

brentp commented 2 years ago

can you show a single expression that doesn't work along with the family structure? the best is a VCF file with a single variant and header along with the family/ped and a single expression.

luceamso commented 2 years ago

cs_two.ped.txt sample.txt

Here's the files. Thank you so much! And I know I can use attributes of FORMAT when using trio. Can't it be applied to sample in family?

luceamso commented 2 years ago

Hi, Brent Have you checked the file? Did you find any errors?