Error in Calculating read depth

32 views
Skip to first unread message

Khushbu Patel

unread,
May 27, 2020, 2:19:54 PM5/27/20
to CODEX/CODEX2 for CNV detection
Hi, 

I am trying to run CODEX2 on a bunch of WES bamflies (without controls). I get the following error when I try to run the code 
Error in value[[3L]](cond) :
  failed to open BamFile: SAM/BAM header missing or empty
  file: '/users/KP/WESData/CL-TGT-10798-human_Aligned.sorted.bam.bai'
Calls: getcoverage ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
In addition: Warning messages:
1: In .Seqinfo.mergexy(x, y) :
  The 2 combined objects have no sequence levels in common. (Use
  suppressWarnings() to suppress this warning.)
2: In doTryCatch(return(expr), name, parentenv, handler) :
  [bam_header_read] EOF marker is absent. The input is probably truncated.
3: In doTryCatch(return(expr), name, parentenv, handler) :
  [bam_header_read] invalid BAM binary header (this is not a BAM file).
Execution halted

My bam files are sorted, and indexed, both bam and bai files are located in the same folder. 
I am unable to figure out the problem. I will really appreciate if you can point out what am I missing.

Thank you,
Khushbu

Yuchao Jiang

unread,
May 27, 2020, 2:23:04 PM5/27/20
to Khushbu Patel, CODEX/CODEX2 for CNV detection
Hi,

It seems that you don’t have this file /users/KP/WESData/CL-TGT-10798-human_Aligned.sorted.bam.bai

Yuchao

--
You received this message because you are subscribed to the Google Groups "CODEX/CODEX2 for CNV detection" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codex2+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codex2/35b91491-2b56-4c96-a33e-6a32ea5591e0%40googlegroups.com.

Yuchao Jiang

unread,
May 27, 2020, 2:25:35 PM5/27/20
to Khushbu Patel, CODEX/CODEX2 for CNV detection
Actually your header for your bam/sam file is missing. It’s due to how you handled the alignment and indexing. Samtools can add header.

Yuchao 

patelk...@gmail.com

unread,
Jun 4, 2020, 9:42:47 AM6/4/20
to CODEX/CODEX2 for CNV detection
Hi Yuchao,

Thank you for your prompt response. I added the headers and now it calculates the raw depth, however I get 0 as my read depth for regions of interest. 
Could you help me understand what could be going wrong?

Thanks so much for your help.


Regards,
Khushbu
Yuchao 

Hi,

To unsubscribe from this group and stop receiving emails from it, send an email to cod...@googlegroups.com.

Yuchao Jiang

unread,
Jun 4, 2020, 9:44:34 AM6/4/20
to Khushbu Patel, CODEX/CODEX2 for CNV detection
Hi,

Have you checked whether you correctly specified the target regions? One way to do so is to load you bam files to IGV and visualize the regions.
These parts of the code have been used very extensively by ourselves and our users and I don’t think it’s something wrong in the script.

Yuchao

To unsubscribe from this group and stop receiving emails from it, send an email to codex2+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codex2/4180c0fc-c55f-45d1-a993-2887c6917487%40googlegroups.com.

Yuchao Jiang

unread,
Jun 8, 2020, 9:39:43 AM6/8/20
to Khushbu Patel, cod...@googlegroups.com
If you can send the bam file corresponding to the regions that you showed in the pictures I can help take a look.

Sent from my iPhone

On Jun 8, 2020, at 8:21 AM, Khushbu Patel <patelk...@gmail.com> wrote:


Hi,

Thank you for these suggestions. My data is paired end.

Sorry, I don't mean to imply that your tool does not work. I am just asking for your help to figure out a way to get your tool working for my data.

I'll look into it more. 

Thanks for all your help.

Regards,
Khushbu

On Sun, Jun 7, 2020 at 8:20 PM Yuchao Jiang <yj...@cornell.edu> wrote:
Hi,

Unfortunately without more details I cannot tell you exact what went wrong. There are some QC filtering when calculating the coverage, and these reads may be removed because of low mappability etc? Also is your sequencing paired end or single end?

Again, this part of the code has been used very extensively so I don’t think it’s something wrong with the code…

Yuchao

On Jun 5, 2020, at 2:24 PM, Khushbu Patel <patelk...@gmail.com> wrote:

Hi,

Thank you for your suggestion. I did go back and look at my target regions in IGV, it looks like there is coverage for my target regions (find attached snapshots). I am still unable to figure out why script outputs 0 as raw depths for these regions.

Thanks,

Khushbu
<Screen Shot 2020-06-05 at 2.21.36 PM.png><Screen Shot 2020-06-05 at 2.21.15 PM.png>

Yuchao Jiang

unread,
Jun 9, 2020, 10:58:28 PM6/9/20
to Khushbu Patel, CODEX/CODEX2 for CNV detection
You need to make the chromosome of the same format in your bed and in you bam files.

On Jun 8, 2020, at 12:49 PM, Khushbu Patel <patelk...@gmail.com> wrote:

I have uploaded test bam file corresponding to regions of interest, as well as bed file in this folder - link to Box folder

Let me know if you have trouble accessing it. 
I appreciate you helping out.

Best,
Khushbu

You received this message because you are subscribed to a topic in the Google Groups "CODEX/CODEX2 for CNV detection" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codex2/YWBNnIJXPSI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codex2+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codex2/94D392A6-D953-4A42-8CBE-ADBEF325BB90%40cornell.edu.

Reply all
Reply to author
Forward
0 new messages