Fix handling of TAG->CA (spell as T>C, =A, delG).
[lightning.git] / vcf2fasta.go
index 7f8df2b5ae4850ffc6a9ff78a88ea67d81c04adb..e1a3a3944ebfbbf1d77fce5e6dd6f95b8fb9c323 100644 (file)
@@ -1,4 +1,8 @@
-package main
+// Copyright (C) The Lightning Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+package lightning
 
 import (
        "bufio"
@@ -282,8 +286,18 @@ func (cmd *vcf2fasta) vcf2fasta(infile string, phase int) error {
                if err = scanner.Err(); err != nil {
                        return fmt.Errorf("error scanning input file %q: %s", infile, err)
                }
+
                var regions bytes.Buffer
-               bedargs := []string{"python2", "-", "--gvcf_type", cmd.gvcfType, infile}
+               bedargs := []string{"python2", "-"}
+               if cmd.gvcfType == "complete_genomics_pass_all" {
+                       bedargs = append(bedargs,
+                               "--ignore_phrases", "CNV", "INS:ME",
+                               "--unreported_is_called",
+                       )
+               } else if cmd.gvcfType != "" {
+                       bedargs = append(bedargs, "--gvcf_type", cmd.gvcfType)
+               }
+               bedargs = append(bedargs, infile)
                bed := exec.CommandContext(ctx, bedargs[0], bedargs[1:]...)
                bed.Stdin = bytes.NewBuffer(cmd.gvcfRegionsPyData)
                bed.Stdout = &regions