diffHiC: Error when call preparePairs
1
0
Entering edit mode
tolemac • 0
@tolemac-11084
Last seen 8.5 years ago

I am having difficulties running the preparePairs function in diffHiC, for a bam file that I aligned using bwa mem. The bam file has been sorted by name. When I call the function

preparePairs("test1.bam", param=param, file="test1.h5", dedup=TRUE, minq=10)

I get the following message:

diagnostics=preparePairs("test_sort.bam", hs.param, file="test.h5", dedup=TRUE, minq=10)
Error in chromosomes[[chrs[x]]] : subscript out of bounds

 

 

I appreciate any suggestion.

Thank you

diffhic • 1.0k views
ADD COMMENT
0
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 17 minutes ago
The city by the bay

It seems like you're using one of the older versions of diffHic, as that particular error message should not appear in the latest version. Anyway, this is probably caused by the fact that your list of restriction fragments in hs.param contains more chromosomes than are in the BAM file. This triggers an error in the release version (even the latest one), though the devel version has been modified to be more relaxed. For the time being, you should update to the latest release and remove all restriction fragments that are not present in the BAM file:

keep <- seqnames(hs.param$fragments)) %in%
    names(scanBamHeader("test_sort.bam")[[1]]$targets)
new.fragments <- hs.param$fragments[keep,]
hs.param <- reform(hs.param, fragments=new.fragments)
ADD COMMENT

Login before adding your answer.

Traffic: 395 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