@Dan Gaston:
I had a chance to revisit this problem. But, it's still not working.
I tried:
changed other way since there is no method called record
for records in record:
for sample in record.samples:
print(sample) # works
Call(sample=MA605, CallData(GT=0/0, AD=[4, 0], DP=4, GQ=12, PG=0/0, PL=[0, 12, 163], PW=0/0))
But as soon as I do:
call = record.genotype(sample)
print(call.gt_bases)
I get error message:
Traceback (most recent call last):
File "/home/everestial007/PycharmProjects/stitcher/pHASE-Stitcher-Markov/markov_final_test/for_loop_test_inVcf.py", line 74, in <module>
call = record.genotype(sample)
File "/home/everestial007/anaconda3/lib/python3.5/site-packages/vcf/model.py", line 277, in genotype
return self.samples[self._sample_indexes[name]]
TypeError: unhashable type: '_Call'
The problem is that the output of print(sample) is not a one-word string but a tuple/list.
Any suggestions.
Isn't this an odd loop? You loop over all samples, but never actually use that variable
samplein your loop.