Closed everestial closed 6 years ago
Please post a few entries from 'scaffold_13' in your vcf file.
Hi @kbchoi-jax This issue is fixed:
So, in the below code:
# loop through the results and dump to file
for c in results:
for ci, lr in c['chain_info'].iteritems():
outfile = open(lr.output_file, 'a')
write = outfile.write
if lr.number_vcf_lines > 0:
write(CHAIN_STRING.format(CHAIN_STRING,
from_chr=c['chrom'], from_length=lr.chromosome_length,
from_start=0, from_end=lr.chromosome_length,
to_chr=c['chrom'], to_length=lr.end_length,
to_start=0, to_end=lr.sums[0] + lr.last_fragment_size + lr.sums[2], id=c['chrom']))
write("\n")
for c in lr.chain_entries:
write("\t".join(map(str, c)))
write("\n")
write(str(lr.last_fragment_size))
write("\n\n")
outfile.close()
The line: for c in lr.chain_entries:
was returning the variable c
as list values. So, after the first line was parsed the second line couldn't be written because write(.... from_chr = c['chrom'] ...
couldn't find c as a dictionary
, hence TypeError
.
I bascially changed the code to: for k in lr.chain_entries:
and it worked, but not sure if that's a good fix. Took me whole day to find this out. But, this problem only showed up while running with --diploid
option.
I have another issue: When running vcf2chain with --diploid
there are chains created for unwanted chromosome. I have vcf with only data for chr2 but chains are created for other chr as well? any tips on this.
What does entries look like for the other chromosomes in your chain file?
What do you exactly mean by entries? Can you refer me to an example/problem, just to be clear on the issue?
I just want to see the chain file you have generated.
I used the following command to create chain file: g2gtools vcf2chain -f lyrata_genome.fa -i F1_2ms04h.imputed.InDel.haplotype.vcf.gz -s 2ms04h -o REF_to_2ms04h.chain --diploid
lyrata_genome.fa
has 8 major chromosome and several scaffolds. Imp Note: This problem is only showing up when I have lots of chormosome (scaffolds).
Attached are the vcf and chain files (with noDiploid run, as well as Diploid run - left and right):
REF_to_2ms04h.chain.txt REF_to_2ms04h.left.chain.txt REF_to_2ms04h.right.chain.txt F1_2ms04h.imputed.InDel.haplotype.vcf.gz
Thanks! Can you get me lyrata_genome.fa file too?
Here is the shared lyrata_genome in gzipped format. https://www.dropbox.com/sh/9n3niwubgkrtlm4/AABNuVzdhZjQr3nnIqLx4lzja?dl=0
Thanks,
@kbchoi-jax : any updates on this issue.
I was able to replicate the problem. We will work on it soon.
That's good to know. If you made any changes to g2gtools, let me know of the patch. So, I don't have to reinstall the whole thing.
Hi, @kbchoi-jax : Any fix on this issue.
Thanks,
Any fix on the issue yet, @kbchoi-jax, @kbchoi
@kbchoi-jax : I haven't received any update on this error fix.
I am seeing a similar error ... any updates? thanks in advance
I was using the wrong version of the tool :), sorted now
I am getting TypeError when running vcf2chain (--diploid type).
The error is coming from vcf2chain.py:
I tried to see the problem by adding a line:
Second issue: When I run in with no --diploid, I am able to get the chain file but the chain file is created for more than one chromosome, i.e I am supply vcf only with chr2 but its creating the chain for several other chr which are not in the vcf.