Error when use getSegmentReadCountsFromBAM
1
0
Entering edit mode
@jinxinhao1988-14864
Last seen 6.8 years ago

Dear all,

I use cn.mops to call CNV in tumor-only samples, My data is Targeted DNA sequencing data.

Preparations:

I have prepared sorted bam file, bam index file and target region bed file. My bed file contains four columns(chromosome,start,end and name).

Command lines are as follows:

>library(cn.mops)

>BAMFiles <- list.files(pattern=".bam$")

>segments <- read.table("targetRegions.bed",sep="\t",as.is=TRUE)

>gr <- GRanges(segments[,1],IRanges(segments[,2],segments[,3]))

> X <- getSegmentReadCountsFromBAM(BAMFiles,GR=gr,mode="unpaired",)

and ran into this error infomation:

Processing S10_align_sorted.bam
Error in value[[3L]](cond) : 'countBam' failed:
  record: 0
  error: 0
  file: S10_align_sorted.bam
  index: S10_align_sorted.bam
In addition: Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  space 'chr21' not in BAM header

 

what is the reason, is it because I don't have a chromosome ref seq alignment information or something else?

Thank you for your time.

 

targeted sequencing cn.mops • 1.8k views
ADD COMMENT
0
Entering edit mode
@gunter-klambauer-5426
Last seen 3.9 years ago
Austria

Hi,

Can you please run "scanBamHeader" (or similar command) from Rsamtools and check the sequence names in the resulting object? Please let me know the results.

Regards,

Günter

ADD COMMENT
0
Entering edit mode

Hi, Gunter,

Thank you for your reply. I use samtools to check the header of my bam files. It's like this.

@HD     VN:1.0  SO:coordinate
@SQ     SN:chr21_16510183_16510354_25   LN:172
@SQ     SN:chr19_42788849_42788989_CIC  LN:141
@SQ     SN:chr19_42790834_42790976_CIC  LN:143
@SQ     SN:chr19_42790921_42791078_CIC  LN:158
@SQ     SN:chr19_42791055_42791192_CIC  LN:138
@SQ     SN:chr19_42791130_42791304_CIC  LN:175
@SQ     SN:chr19_42791236_42791393_CIC  LN:158
@SQ     SN:chr19_42791375_42791514_CIC  LN:140
@SQ     SN:chr19_42791469_42791618_CIC  LN:150
@SQ     SN:chr19_42791548_42791705_CIC  LN:158
@SQ     SN:chr19_42791647_42791794_CIC  LN:148
@SQ     SN:chr19_42791726_42791896_CIC  LN:171
@SQ     SN:chr19_42791865_42792021_CIC  LN:157

 

and my bed file is like this:

chr21 16510183 16510354 25

chr19 42788849 42788989 CIC

chr19 42790834 42790976 CIC

chr19 42790921 42791078 CIC

chr19 42791055 42791192 CIC

chr19 42791130 42791304 CIC

chr19 42791236 42791393 CIC

chr19 42791375 42791514 CIC

chr19 42791469 42791618 CIC

chr19 42791548 42791705 CIC

chr19 42791647 42791794 CIC

chr19 42791726 42791896 CIC

chr19 42791865 42792021 CIC

chr19 42792991 42793143 CIC

chr19 42793078 42793251 CIC

chr19 42793206 42793330 CIC

chr19 42793338 42793511 CIC

chr19 42793381 42793541 CIC

 

I have arranged the sam file and bed file in the same order. If this is what you want to check.

Best.

 

ADD REPLY
0
Entering edit mode

Seems like the sequence names are "chr19_42791865_42792021_CIC" rather than "chr19", that's why the function does not find any reads. Please check why this happens in your BAM file.

ADD REPLY
0
Entering edit mode

Thank you. Gunter. Problem has been solved. I generated a new reference with banner only have chrXXX.

Best regards,

ADD REPLY
0
Entering edit mode

Great, thanks for the heads-up!!

ADD REPLY

Login before adding your answer.

Traffic: 530 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6