Closed BioComSoftware closed 6 years ago
Bump
You want: vcf.samples[name_or_index][‘GT’]
Sent from my tiny remote device.
On Nov 16, 2017, at 3:15 AM, BioComSoftware notifications@github.com wrote:
Bump
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Awesome! Thanks!
Kevin Jacobs mailto:notifications@github.com 16 November 2017 at 09:35 You want: vcf.samples[name_or_index][‘GT’]
Sent from my tiny remote device.
On Nov 16, 2017, at 3:15 AM, BioComSoftware notifications@github.com wrote:
Bump
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pysam-developers/pysam/issues/564#issuecomment-344851811, or mute the thread https://github.com/notifications/unsubscribe-auth/AGX53sJYooX36cOU5a-gzaOfMSrRLvcZks5s2_PVgaJpZM4QSKtT.
This is exactly what I was looking for that wasn't in the "Working with VCF/BCF formatted files" section. It would be super helpful to add a short example of this command there as well.
Perhaps I'm missing something obvious, but I've been all over the documentation and I can't find this.
I have BCF variant file, which is the amalgamated result of 70 samples. So, there's 70 GT:PL references.
I'm opening a BCF file as follows...
When I just print the rec (as above:
print(type(rec),rec)
) I get...Now, I can get nearly every peice of info out of the
rec
(includingrec.header, rec.id, rec.info, rec.pos, rec.qual, rec.ref, rec.rid, rec.rlen
, andrec.samples
) But the one thing I CANT get is the actual GT:PL data itself. (the1/1:255,69,0
part).Is there an attribute/method for extracting this? Or do I just need to convert
rec
to a string and split() it?P.s.
When I
print(rec.samples)
I get the sample header names...not the data :(