Gff Convertion To Wig/Bigwig
2
3
Entering edit mode
13.5 years ago
Darked89 4.6k

I mapped 40 sets of ESTs from various species to a novel plant genome using GMAP. Importing everything as separate GFF files into GBrowse will give very cluttered view, impossible to make sense by looking at it. Instead of information about 100+ individual ESTs covering particular gene it would be nice to have plot of a frequency, how often a given small interval is covered by any EST, something that is being done for RNA-Seq data (starting with SAM files).

What is a possible route to get from GFF to BigWig?

BTW, It is easy to sort GFF files based on scaffold name (first column) then "start" and "end" of a match, but iterating over each base and checking how many times it is covered by intervals seems less obvious at this stage.

Edit: title change

gff wiggle • 6.3k views
ADD COMMENT
5
Entering edit mode
13.5 years ago

From http://gmod.org/wiki/Subtrack_HOWTO "An example of GFF2WIG"

#!/usr/bin/perl -w
use strict;

my $name = shift;
my $desc = shift;

@ARGV or die "I need three args: name, desc, filename";

print qq(track type=wiggle_0 name="$name" description="$desc"\n);
while (<>) {
  chomp;
  my ($ref,$start,$end,$score) = (split)[0,3,4,5];
  $ref =~ s/CHROMOSOME_|chr//;
  $start--; # zero-based, half-open
  $score = 255 if $score !~ /^[-.Ee0-9]$/;

  print join("\t",$ref,$start,$end,$score), "\n";
}

and then use wigToBigWig as described here.

ADD COMMENT
0
Entering edit mode

Wiggle format is not 0-based half-open: http://genome.ucsc.edu/goldenPath/help/wiggle.html

ADD REPLY
2
Entering edit mode
13.5 years ago

Here's an approach using BAM as an intermediate. You'll need:

along with the FASTA file of your organism of interest. Then it's a set of commandline steps using these tools:

% samtools faidx your_genome.fasta
% bedToBam -i in.gtf -g your_genome.fasta.fai >! out.bam
% samtools sort out.bam out-sort
% samtools index out-sort.bam
% bam_to_wiggle.py out-sort.bam
ADD COMMENT

Login before adding your answer.

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