cyvcf2 icon indicating copy to clipboard operation
cyvcf2 copied to clipboard

Allow changing sample names

Open lbeltrame opened this issue 8 years ago • 4 comments

I'm filing this issue because despite the plethora of VCF reading/writing libraries for Python, no one of them implements this. (I filed a similar request for pysam).

lbeltrame avatar Feb 06 '17 15:02 lbeltrame

I can probably implement this like:

vcf.set_sample_name(int index, char *newname)

brentp avatar Feb 06 '17 16:02 brentp

Yes, that would work nicely.

lbeltrame avatar Feb 06 '17 16:02 lbeltrame

actually, I just looked into this. The reason no htslib wrapper does it (including cyvcf2) is because it's hard. It would involve splicing out characters from the header text, updating the sample dictionary, etc.

brentp avatar Feb 06 '17 16:02 brentp

I assume this is due how to htslib does things? (but in general this issue is not limited to htslib, no wrapper, including older stuff like PyVCF, does this, although for likely many different technical issues).

lbeltrame avatar Feb 06 '17 16:02 lbeltrame