abyzovlab / CNVnator

a tool for CNV discovery and genotyping from depth-of-coverage by mapped reads
Other
207 stars 65 forks source link

About the plotbaf.py, plotrdbaf.py ... script #220

Closed u1200538 closed 3 years ago

u1200538 commented 4 years ago

Hello, I wonder how to solve the problem about plotbaf.py script. When I typed the command line like this, ".plotbaf.py -h -bs 100 -o SAVE_FILE -t plotbaf_result -nomask -useid sorted.bam.root 1:1-200000000"

I saw the error message, Traceback (most recent call last): File "plotrdbaf.py", line 5, in import ROOT ModuleNotFoundError: No module named 'ROOT'

I already set the PATH about ROOT along the manual, but I could not solve this problem. Could you give me some advise ??

oh, additionally, when I was tried to two ways for making CNV calling result, only including the generating his step make a CNV calling file.

Is it possible to get the CNV calling result, without using the Generating histogram step (-his option)?

Thank you,

suvakov commented 4 years ago

You can try to enter python from command line and type "import ROOT":

$ python
Python 2.7.16 (default, Jan 26 2020, 23:50:38) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT

If it reports the same error probably something went wrong during ROOT package compilation. Check pyROOT page: https://root.cern/manual/python/

Is it possible to get the CNV calling result, without using the Generating histogram step (-his option)?

No, to generate CNV calls you should run -tree, -his, -stat, and -partition before -call for the same bin size as parameter.

u1200538 commented 4 years ago

Hello, suvakov! Thank you for your feedback,

After setting all of the required program, I successfully completed CNV calling process from the bam file. (I assigned bin size option 100 to make root file)

And then I executed plotbaf.py script like this command, python /garnet/Tools/WGS_Analysis/Program/CNVnator/CNVnator_v0.4.1/src/plotbaf.py -bs 100 -res 100 -o plotbaf_result -t plotbaf_result -nomask -useid sorted.bam.root chr1:1-104900

I found the Segmentation fault message from the executing result (it didn't tell the extended message such as "core dumped" error). I tried to another number at the -bs, -res option like 100,000 etc,, it also gives same comments.

Would you please check if anything wrong here?

suvakov commented 4 years ago

Not sure. Did you import data from vcf file (-vcf step)?

Please try with default bs and res for entire chr1:

# python /garnet/Tools/WGS_Analysis/Program/CNVnator/CNVnator_v0.4.1/src/plotbaf.py -o plotbaf_result.png  sorted.bam.root chr1

Value for bs should be at least 10k becouse SNP-s are rare. Default is 100k. Res is resolution used in discretization of baf likelihood function. Default value 100 works fine. Region chr1:1-104900 is small and at the beginning of the chromosome. Maybe there are no SNP-s in this region.

u1200538 commented 4 years ago

Hello, suvakov! Thank you for your reply!

  1. Not sure. Did you import data from vcf file (-vcf step)? => I made a root format from the sorted bam file, I used the cnvnator function -his, -stat, -partition and -call step. => Should I make the root file by using the -vcf step??

  2. Please try with default bs and res for entire chr1: python /garnet/Tools/WGS_Analysis/Program/CNVnator/CNVnator_v0.4.1/src/plotbaf.py -o plotbaf_result.png 3-1.bam.root chr1 -> If i type only "chr1" not written the specific area, it automatically assigned the chr1 region from the 3-1.bam.root ? python /garnet/Tools/WGS_Analysis/Program/CNVnator/CNVnator_v0.4.1/src/plotbaf.py -o plotbaf_result.png 3-1.bam.root chr1:1-248956500 => According to your guidance you written, the command line also tell me the same error message "Segmentation fault".

  3. Value for bs should be at least 10k becouse SNP-s are rare. Default is 100k. Res is resolution used in discretization of baf likelihood function. Default value 100 works fine. Region chr1:1-104900 is small and at the beginning of the chromosome. Maybe there are no SNP-s in this region. => The reason why I assigned the region chr1:1-104900, I found the variant type from the CNV calling result. ( I upload the file ) CNV calling result_from_sorted bam root

I really want to solve those kinds of problems. Sincerely thank you for your feedback.

suvakov commented 4 years ago

Yes, you should run additional -vcf step if you want to plot BAF data. If you want to plot just RD plots, follow section "4.1 Visualizing specified regions" in README file.

u1200538 commented 4 years ago

Thank you for your comments,

I little bit a confuse about your advice. You mentioned "you should run additional -vcf step if you want to plot BAF data" to me, It means that if I want to plot BAF result, I must have a vcf file and need to make a root file from the vcf.gz file by running "3. Importing VCF data" step. Is it right?

suvakov commented 4 years ago

You already have root file. By running "3. Importing VCF data" step you will add data from VCF file (SNP counts) to the same root file and than you can use both RD and BAF plots. Without that step everything will work except plots listed in section 4.2 Plotting B-allele frequency (BAF).

u1200538 commented 4 years ago

Thank you kindly replying,

As shown in the figure below, VCF file data was added to the root file using the -vcf function. 캡처

I used plotbaf.py with the newly created root file, but I still see "Segmentation fault" errors. python ~/plotbaf.py -o plotbaf.png 03-2.bam.root chr1

I have tried many times, cannot find out the cause. Could you please let me know how to solve this problem??

Thank you,

suvakov commented 4 years ago

Not sure. Please, send me log file (error output with Segmentation fault) on email (suvakov at gmail).

u1200538 commented 3 years ago

Could you tell me your gmail address please?

Thank you,

suvakov commented 3 years ago

suvakov at gmail dot com