kauralasoo / wiggleplotr

A small R package to make sequencing read coverage plots in R.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plotCoverage can't open BW files

rbenel opened this issue · comments

Hi,
I am not able to execute this function due to this error.

Any ideas what could be the issue?

Error in seqinfo(con) : UCSC library operation failed
In addition: Warning message:
In seqinfo(con) :Couldn't open /Bigdata/Dropbox (Technion Dropbox)/Rina_Benel/Home/Rina/AS_linc/cardiac_diff/data/ChIPData/TrialCovData/EXP053380.bw

I have tried using the example bigwig file and wiggleplotr reads the file correctly, however it is unable to read my bigwig file.. I am happy to share the file trial bigwig files

Hi! Can you try moving it from Dropbox to some other folder (i.e. your home folder) and see if it fixes the issue?

Hi!
I tried and I am still receiving the same error :(

Error in seqinfo(con) : UCSC library operation failed
In addition: Warning message:
In seqinfo(con) : Couldn't open /home/yaellab/TrialCovData/EXP053380.bw

The plotTranscripts function works fine, also on ncRNA.
plotTranscripts

Hi @kauralasoo,

Any chance you had some time to look into this?
Thanks!!

The chromosome names in the Ensembl annotations are 1:22,X,Y while some bigwig files might use chr1:chr22,chrX,chrY. Can you check that the chromsome names in your BigWig file match those in the transcript annotations? Have you tried opening your bigwig file with IGV (https://software.broadinstitute.org/software/igv/) to see if it works there?

The bigwig files I shared above (link is fixed) uses Ensembl annotations.

I have also viewed the files using IGV and they work fine..

Hi,
Do you think you can download the file I sent and we can trouble shoot this together?
I would really appreciate it.

Thanks

Ok, the file looks fine, so I don't really know what is going on. Unfortunately I do not have much time to troubleshoot it right now. Have you tried using Gviz instead: http://www.bioconductor.org/packages/release/bioc/html/Gviz.html?

OK I will try Gviz

Dear @kauralasoo I am also experiencing a similar issue with the plotCoverage function. I cannot read my bigwig files, but plotTranscripts and the vignette examples of plotCoverage work fine.

Error: subscript contains out-of-bounds indices
In addition: Warning message:
In .local(con, format, text, ...) :
  'which' contains seqnames not known to BigWig file: 12

Seqnames means chromsome names in R bioconductor. The error message says that there is no chromosome with the name "12" in your file. Are you sure that chromosome 12 is named "12" in your BigWig file and not "chr12" or something similar?

Thank you for your propmt reply, @kauralasoo. This is the head of the bed files, of which my bigwig files are based. I am assuming that the chromosome column is the same between formats. Should I covert the chromosome column to an integer in the bed file and convert to a bigwig file?

chr1 136786 136787 AGGCAG_peak_1 7.61764
chr1 199825 199826 AGGCAG_peak_2 13.56443
chr1 267987 267988 AGGCAG_peak_3 6.68291
chr1 432802 432803 AGGCAG_peak_4 4.97155
chr1 598298 598299 AGGCAG_peak_5 5.95593
chr1 605539 605540 AGGCAG_peak_6 6.80806

Yes, you should changes the chromosome names to integers.

@kauralasoo I found that as long as the exon_chr, cdss_chr and track_data have the same seqname format, then it doesn't matter if they are integers or not. Since I found it more difficult to change the seqnames of the track_data, I opted to change the exon_chr and cdss_chr instead.

## seqlevelsStyle will change the seqnames in the Granges object to the UCSC format (e.g. "1" is converted to "chr1") 
seqlevelsStyle(exon_chr) <- "UCSC"
seqlevelsStyle(cdss_chr) <- "UCSC"

Perfect! Thanks for posting the solution.