Deepak: I haven't been able to replicate the error. Are you sure you used a valid BED file, i.e. my_targets.bed is a 4-column BED file that you've preprocessed with "cnvkit.py target"? The error message suggests you might have given a 1-column list of chromosome IDs instead.
Seqanswers Leaderboard Ad
Collapse
Announcement
Collapse
No announcement yet.
X
-
DrWorm: The SEG parser handles 5- or 6-column tables like the one you've posted. I wonder if the ValueError is due to the "WARNING" message from R getting fed to the SEG parser in CNVkit, just before the start of the usual table. If so, maybe you could disable that message from R and therefore prevent the CNVkit error by prefixing your command line to reset or unset R_HOME:
R_HOME="" cnvkit.py 19987_main.cnr
Comment
-
Dear Eric,
Thank you for sparing your time. I tried the target and it gives a 4 field bed. But I gues the problem is coming when I use the BAM files.
###################
cnvkit.py batch /home/deepak/MM02-N_MM02-020200/colossus_analysis/BAM/MM02-020200_MarkDup.bam --normal /home/deepak/MM02-N_MM02-020200/colossus_analysis/BAM/MM02-N_MarkDup.bam --targets Agilent_b37_exome_covered.bed --split --annotate refFlatMod.txt --fasta /home/deepak/Ref/human_g1k_v37_decoy.fasta --access /home/deepak/src/cnvkit/data/access-5k-mappable.hg19.bed --output-reference my_reference.cnn --output-dir results/ --diagram --scatter
Processing reads in MM02-N_MarkDup.bam
Traceback (most recent call last):
File "/usr/local/bin/cnvkit.py", line 4, in <module>
__import__('pkg_resources').run_script('CNVkit==0.7.9.dev0', 'cnvkit.py')
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 726, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1491, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/CNVkit-0.7.9.dev0-py2.7.egg/EGG-INFO/scripts/cnvkit.py", line 11, in <module>
File "build/bdist.linux-x86_64/egg/cnvlib/commands.py", line 97, in _cmd_batch
File "build/bdist.linux-x86_64/egg/cnvlib/commands.py", line 172, in batch_make_reference
File "build/bdist.linux-x86_64/egg/cnvlib/parallel.py", line 14, in apply_async
File "build/bdist.linux-x86_64/egg/cnvlib/commands.py", line 193, in batch_write_coverage
File "build/bdist.linux-x86_64/egg/cnvlib/commands.py", line 457, in do_coverage
File "build/bdist.linux-x86_64/egg/cnvlib/coverage.py", line 37, in interval_coverages
File "build/bdist.linux-x86_64/egg/cnvlib/coverage.py", line 110, in interval_coverages_pileup
File "build/bdist.linux-x86_64/egg/cnvlib/coverage.py", line 143, in bedcov
RuntimeError: Bad line from bedcov:
1
#######################
But it does create two bed files.
$ head results/Agilent_b37_exome_covered.*
==> results/Agilent_b37_exome_covered.antitarget.bed <==
chr1 10500 93708 Background
chr1 93708 176917 Background
chr1 227917 267219 Background
chr1 318219 394543 Background
chr1 394543 470868 Background
chr1 521868 563949 Background
chr1 570871 671469 Background
chr1 671469 772067 Background
chr1 772067 872665 Background
chr1 872665 973263 Background
==> results/Agilent_b37_exome_covered.target.bed <==
1 65509 65625 -
1 65831 65973 -
1 69481 69600 OR4F5
1 721381 721519 -
1 721530 721806 -
1 721851 721942 -
1 752916 753035 FAM87B
1 762095 762275 LINC00115
1 762280 762414 LINC00115
1 762420 762565 LINC00115
I have no idea where it is going wrong.
Sorry for a messy and long mail.
Thank you.
Best,
Deepak
Comment
-
Deepak, I notice your antitarget BED chromosomes names start with "chr" but your target BED chromosome names do not. Which names are in your BAM file? (I'm guessing "chr", like hg19, based on the generated antitarget BED file.) Either way, there will be a mismatch between chromosome names in the BAM and BED files at some point. I recommend checking (try "samtools view -H"), and if the "chr" prefix is used in the BAM, then add "chr" to the input target BED file.
Comment
-
Hi Eric,
Thanks for the reply. I cross checked chr notations in bam and reference bed file. It is all without chr. But when it creates antitarget files it adds chr to the file and vice versa if I use a reference bed file with chr. I don't know why.
Best,
Deepak
Comment
-
The antitarget BED file has "chr" because "access-5k-mappable.hg19.bed" has chr. You could build an access file for GRCh37 using "cnvkit.py access", but it would probably be quicker for you to just copy the hg19 one and delete the "chr" prefixes from each line.
Comment
-
Dear Eric,
I tried all possible removal of chr as my BAM file is with just chromosome numbers.But still ended up getting same error as I mentioned above. Now the target and the anti target files have chromosome numbers without chr. I get this error now.
Wrote results/Agilent_b37_exome_covered.antitarget.bed with 54084 regions
Building a copy number reference from normal samples...
Processing reads in MM02-N_final.bam
Traceback (most recent call last):
File "/usr/local/bin/cnvkit.py", line 4, in <module>
__import__('pkg_resources').run_script('CNVkit==0.7.9.dev0', 'cnvkit.py')
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 726, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1491, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/CNVkit-0.7.9.dev0-py2.7.egg/EGG-INFO/scripts/cnvkit.py", line 11, in <module>
File "build/bdist.linux-x86_64/egg/cnvlib/commands.py", line 97, in _cmd_batch
File "build/bdist.linux-x86_64/egg/cnvlib/commands.py", line 172, in batch_make_reference
File "build/bdist.linux-x86_64/egg/cnvlib/parallel.py", line 14, in apply_async
File "build/bdist.linux-x86_64/egg/cnvlib/commands.py", line 193, in batch_write_coverage
File "build/bdist.linux-x86_64/egg/cnvlib/commands.py", line 457, in do_coverage
File "build/bdist.linux-x86_64/egg/cnvlib/coverage.py", line 37, in interval_coverages
File "build/bdist.linux-x86_64/egg/cnvlib/coverage.py", line 110, in interval_coverages_pileup
File "build/bdist.linux-x86_64/egg/cnvlib/coverage.py", line 143, in bedcov
RuntimeError: Bad line from bedcov:
1
Sorry for the trouble. I really need to make this work.. .
Best,
Deepak
Comment
-
You can skip bedcov with the -c/--count-reads option; it uses a different method to calculate read depths but should give similar results.
Also, if you've successfully built the target and antitarget BED files, you can use those as inputs to the "batch" command and drop some of the command line options:
cnvkit.py batch ~/MM02-N_MM02-020200/colossus_analysis/BAM/MM02-020200_MarkDup.bam --normal ~/MM02-N_MM02-020200/colossus_analysis/BAM/MM02-N_MarkDup.bam --targets results/Agilent_b37_exome_covered.target.bed --antitargets results/Agilent_b37_exome_covered.antitarget.bed --fasta ~/Ref/human_g1k_v37_decoy.fasta --output-reference my_reference.cnn --output-dir results/ --diagram --scatter --count-reads
Comment
-
Deepak, another user reported this issue and found that it was due to a bug in Pysam 0.9:
When I run cnvkit batch with pysam 0.9, I get the following error. On 0.8.4 things seem to run fine. Building a copy number reference from normal samples... Processing reads in sample.bam Traceback...
Your original command should work for you if you are able to remove Pysam 0.9 and install Pysam 0.8.4 instead.
Comment
-
Dear Eric,
CNVkit worked when I used the older version of pysam. Now I have a doubt regarding running CNVkit. I have 20 samples with matched tumor and normal. Do I make reference from all normal samples and run each tumor sample or run individually? Sorry about naive question.
Thank you.
Best,
Deepak
Comment
-
Hi Eric,
Sorry to flood you with questions. one more thing, my files have same naming for normals across samples and it is giving me an error saying Dupicate ID. The problem is the files are write protected and huge files, so I don't want to rename or move them. Is there any way around it?
Thank you for your patience.
Best,
Deepak
Comment
Latest Articles
Collapse
-
by seqadmin
While isolating and preparing single cells for sequencing was historically the bottleneck, recent technological advancements have shifted the challenge to data analysis. This highlights the rapidly evolving nature of single-cell sequencing. The inherent complexity of single-cell analysis has intensified with the surge in data volume and the incorporation of diverse and more complex datasets. This article explores the challenges in analysis, examines common pitfalls, offers...-
Channel: Articles
06-06-2024, 07:15 AM -
-
by seqadmin
Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.
Somatic Genomics
“We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...-
Channel: Articles
05-24-2024, 01:16 PM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, Today, 06:54 AM
|
0 responses
10 views
0 likes
|
Last Post
by seqadmin
Today, 06:54 AM
|
||
Started by seqadmin, 06-14-2024, 07:24 AM
|
0 responses
16 views
0 likes
|
Last Post
by seqadmin
06-14-2024, 07:24 AM
|
||
Started by seqadmin, 06-13-2024, 08:58 AM
|
0 responses
15 views
0 likes
|
Last Post
by seqadmin
06-13-2024, 08:58 AM
|
||
Started by seqadmin, 06-12-2024, 02:20 PM
|
0 responses
17 views
0 likes
|
Last Post
by seqadmin
06-12-2024, 02:20 PM
|
Comment