Importing/formatting .wig file with strand information
1
0
Entering edit mode
3.7 years ago
k.smolyar • 0

I have a .wig file with three columns (Columns: Pos, Positive Strand, Negative Strand). I am trying to use import.wig into R, however I get the error "data length [1545] is not a sub-multiple or multiple of the number of rows [2]". When opening the wig in R, the columns are shifted and incorrectly filled. How can I import this strand information and maintain the integrity of the columns?

wig alignment R • 949 views
ADD COMMENT
0
Entering edit mode

How was the wig file generated?

ADD REPLY
0
Entering edit mode

The .wig file was generated using igvtools, exporting "counts" coverage information from a BAM file into the three columns.

ADD REPLY
0
Entering edit mode
3.7 years ago

Perhaps you could convert with BEDOPS wig2bed and import the resulting BED file into R via usual means:

$ wig2bed < in.wig > out.bed

If it is a correctly-formatted Wiggle file, then it should convert correctly. If it is not a correctly-formatted Wiggle file, then some awk swiss-knifing may be needed, as well as a bug report to IGV.

ADD COMMENT

Login before adding your answer.

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