Question: Extract a chromosome from a WIG file
0
gravatar for Grinch
6 weeks ago by
Grinch20
Germany
Grinch20 wrote:

I have a large WIG files which are difficult to run in IGV, due to the size. I am only interested in chromosome M so I would like to extract signal from that chromosome and thus have a smaller file size. I found one solution on Stackoverflow (https://stackoverflow.com/questions/17354962/pcregrep-a-wiggle-file-to-extract-chromosome-multiple-line-regex-search), but that doesn't work at all. Any other ideas? I check UCSC utils and extensively searched online. I am also open to suggestions on bedgraph or similar formats.

wig • 122 views
ADD COMMENTlink modified 28 days ago by EagleEye5.8k • written 6 weeks ago by Grinch20

but that doesn't work at all

Please specify what doesn't work.

The awksolution on stackoverflow looks fine to me.

fin swimmer

ADD REPLYlink written 6 weeks ago by finswimmer6.2k

It produces an empty file. I checked with grep and the chromosome exists in the original file.

ADD REPLYlink written 6 weeks ago by Grinch20
2
gravatar for Pierre Lindenbaum
6 weeks ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum113k wrote:

use one of the tools provided by the UCSC to extract a region of the chromosome : http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/

for example bigWigToWig :

   -chrom=chr1 - if set restrict output to given chromosome
   -start=N - if set, restrict output to only that over start
   -end=N - if set, restict output to only that under end
   -udcDir=/dir/to/cache - place to put cache for remote bigBed/bigWigs

and then convert back to bigwig with wigToBigWig

ADD COMMENTlink written 6 weeks ago by Pierre Lindenbaum113k

Thank you. I knew there had to be a simple solution like this available.

ADD REPLYlink written 6 weeks ago by Grinch20
0
gravatar for EagleEye
28 days ago by
EagleEye5.8k
Sweden
EagleEye5.8k wrote:

Try IGV 'toTDF' to convert your 'WIG' files into binary tiled data (TDF). This loads into IGV lot faster than 'WIG' files.

ADD COMMENTlink modified 28 days ago • written 28 days ago by EagleEye5.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1775 users visited in the last hour