fill-tags issue for specific sample name

Open
#1,933 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start in plugins/fill-tags.c around the parsing code shown near lines 166-186, then reproduce the provided bcftools +fill-tags command with the group file containing sample names such as A1 and C1. Done means the filter-tags plugin accepts those sample names without the reported “Could not parse” error while processing HWE.

Written by the indexing model from the issue text.

Description

requires-test-case

hello,

I have a vcf file, which sample name is like “A1”,“C1”;

when I using the filter-tag plugins,it turns out error for group files,maybe you could rewrite the check code

/mnt/lustre/users/sanger-dev/app/bioinfo/dna/bcftools-1.17/bcftools +fill-tags --threads 8 -Oz -o pop.hwe.vcf.gz /mnt/lustre/sanger-dev_workspaceDnaEvolutionV2/20230530/Basic_FX2023022000012_16sample_yxy_2ezr/VcfPreprocess/output/vcf_filter/loci_filtered.vcf.gz -- -S /mnt/lustre/users/sanger-dev/sg-users/yexiaoya/task/FX2023022000012/16.group -t HWE

Could not parse the file2: C1	C

I have already change the code plugins/fill-tags.c like this

    166                 char  *back=str.s;
    167         char *smpl=strtok(str.s,"\t");
    168                 char *pop_names=strtok(NULL,"\t");
    169                 str.s=back;
    170                 //while(p)
    171                 //{
    172                 //      printf("%s\n",p);
    173                 //      p=strtok(NULL,"\t");
    174                 //}             
    175                 //char *pop_names = str.s + str.l - 1;
    176                 //while ( pop_names >= str.s && isspace(*pop_names) ) pop_names--;
    177                 //if ( pop_names <= str.s ) error("Could not parse the file: %s\n", str.s);
    178         //pop_names[1] = 0;   // trailing spaces
    179                 //while ( pop_names >= str.s && !isspace(*pop_names) ) pop_names--;
    180         //if ( pop_names <= str.s ) error("Could not parse the file1: %s\n", str.s);
    181 
    182         //char *smpl = pop_names++;
    183         //while ( smpl >= str.s && isspace(*smpl) ) smpl--;
    184                 //char *names= str.s++;
    185                 //if ( smpl <= str.s) error("Could not parse the file2: %s\n", str.s);
    186                 //smpl[1] = 0;
    187         //smpl = str.s;

the error is gone!

thank you!

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.