abyzovlab / CNVpytor

a python extension of CNVnator -- a tool for CNV analysis from depth-of-coverage by mapped reads
MIT License
179 stars 26 forks source link

Cannot export VCF #184

Closed philippesanio closed 1 year ago

philippesanio commented 1 year ago

Hello,

I tried to run CNVpytor. However, I cannot see an option to export the VCF file directly.

Additionally, I tried to use cnvnator2VCF.pl to convert the file.pytor to a VCF. Resulting in a lot of error messages: Skipping unrecognized event type and an empty VCF with just the metadata and header.

The root file, which is called in my case "HG002.pytor" has a size of 23 MB. Hence, I assume there are calls within the data structure.

Am I missing something? Is there an option for a direct variant export in CNVPytor which I can use?

Cheers ~ Philippe

arpanda commented 1 year ago

Hi, Yes, the calls are within the pytor file and CNVpytor's view mode can be utilized to get vcf output for the call. i.e,

cnvpytor -root file.pytor -view 1000
set print_filename output.vcf
print calls

Thanks Arijit

philippesanio commented 1 year ago

Hi @arpanda,

Thanks for the swift reply. I have tried your suggestion and it produced a VCF file. However, there are no variants in it, just the metadata and header section.

Any other suggestions on how to solve this issue?

Cheers, Philippe

arpanda commented 1 year ago

Did you run the call step? you will get the calls results If you run the above command without set print_filename output.vcf, i.e.,

cnvpytor -root file.pytor -view 1000
print calls
philippesanio commented 1 year ago

Could you please be so kind and elaborate what you mean by call step?

My command looks like this: cnvpytor -root file.pytor -rd $bamfile

after which Im trying to run

cnvpytor -root file.pytor -view 1000 set print_filename output.vcf print calls

resulting in an empty VCF

When I am using your last command

cnvpytor -root file.pytor -view 1000 print calls

I dont get any output

Am I missing or doing something wrong?

arpanda commented 1 year ago

You are only running the rd step, it will only read the alignment file. There are several steps that needs to be followed to get the cnv calls. Please visit this link for details and have a look at the workflow image.

To get results from Meanshift rd caller, you need to run the followings.

> cnvpytor -root file.pytor -rd file.bam
> cnvpytor -root file.pytor -his 1000 10000 100000
> cnvpytor -root file.pytor -partition 1000 10000 100000
> cnvpytor -root file.pytor -call 1000 10000 100000

-Arijit

philippesanio commented 1 year ago

Thank you, @arpanda, for the kind replies!