Feature Request: +setGT plugin ability to set GT in a subset of samples in the VCF file

Open
#2,467 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start at the existing +setGT plugin and review how it processes sample genotypes in a VCF. The issue presents both sample-list filtering and a second VCF input as possible scopes, so confirm which behavior is wanted before implementation. Done should include the selected update behavior and coverage for conflicts and missing genotypes.

Written by the indexing model from the issue text.

Description

documentation enhancement

Use Case:

  1. multi sample vcf file from prior WGS
  2. New targeted seq data generated for a subset of the samples and determined to be higher quality (eg higher coverage) than prior genotyping.
    Eq a high coverage exome or targeted gene seq panel.
  3. We want to replace selected genotypes/samples in the original vcf file with genotypes from the second. This would be particularly useful for setting ./. in the original to called genotypes. If there are conflicting genotypes provide option to not update those or to allow file 2 to overwrite file GTs.

Easier Enhancement:

  • Modify existing +setGT to allow a -s / -S sample list options. If this is set, only apply GT updates to those samples in the list options. This requires processing VCF2 outside to subset to just the GTs you want to update.

More Flexible but probably more complex enhancement:

  • Extend +setGT to allow a second vcf.gz file to be input with the first original file. If a second vcf.gz is found, overwrite existing GTs with those GTs in the update file.

The current workaround for this is to convert to PLINK2 format and do with merge. This works well if you intend to use PLINK/PLINK2 and you can convert there but it feels that there should be a way to do this at the early VCF stage to permit use of VCF for other programs and analyses.

Dominant language
C
Stars
891
Forks
277
Avg merge
2d 23h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from samtools/bcftools

All issues in samtools/bcftools

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.