This is a test version of Biostars. For the public version, visit https://www.biostars.org.
rename samples in a vcf or plink file

Hello dears all,

Actually I have a vcf file which it has been generated through samtools/bcftools pipeline. This file doesn't have just the sample names, indeed it has the samples' PATH in it. So what I want to do is removing the PATH and simply just keep the sample names. Moreover, if it is possible to remove these PATH from a.ped file I would be grateful if you can help me to solve my error. Here is a part of my vcf and as it can be seen there is PATH for each sample:

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  /home2/omid/alignment/BAM/F0-F06-10-markdup.bam /home2/omid/alignment/BAM/F0-F06-11-markdup.bam      /home2/omid/alignment/BAM/F0-F06-12-markdup.bam /home2/omid/alignment/BAM/F0-F06-13-markdup.bam /home2/omid/alignment/BAM/F0-F07-11-markdup.bam      /home2/omid/alignment/BAM/F0-F07-12-markdup.bam /home2/omid/alignment/BAM/F0-F07-13-markdup.bam /home2/omid/alignment/BAM/F0-F07-14-markdup.bam      /home2/omid/alignment/BAM/F0-F08-11-markdup.bam /home2/omid/alignment/BAM/F0-F08-12-markdup.bam /home2/omid/alignment/BAM/F0-F25-10-markdup.bam      /home2/omid/alignment/BAM/F0-F25-11-markdup.bam /home2/omid/alignment/BAM/F0-F25-12-markdup.bam /home2/omid/alignment/BAM/F0-F25-13-markdup.bam      /home2/omid/alignment/BAM/F0-F25-14-markdup.bam /home2/omid/alignment/BAM/F0-F25-15-markdup.bam /home2/omid/alignment/BAM/F0-F25-16-markdup.bam

Thank you very much in advance.

Regards,

Omid

snp vcf plink

Thank you so much, I will check it.

regards,

Omid

1 answer

Take a look at bcftools reheader, which should be able to solve your issue.

Thank you for your answer. I will give it a try and hope it work.

Cheers,

Omid

Thank you very much. It worked properly.

Regards,

Omid

A small educational note: if an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.

Upvote|Bookmark|Accept

Log in to answer this question.