Question: Gff Convertion To Wig/Bigwig
gravatar for Darked89
9.7 years ago by
Barcelona, Spain
Darked894.2k wrote:

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 • 4.4k views
ADD COMMENTlink modified 9.6 years ago by Brad Chapman9.5k • written 9.7 years ago by Darked894.2k
gravatar for Pierre Lindenbaum
9.7 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum129k wrote:

From "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 (<>) {
  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 COMMENTlink modified 11 months ago by RamRS28k • written 9.7 years ago by Pierre Lindenbaum129k

Wiggle format is not 0-based half-open:

ADD REPLYlink written 9.5 years ago by Chris Fields2.1k
gravatar for Brad Chapman
9.7 years ago by
Brad Chapman9.5k
Boston, MA
Brad Chapman9.5k wrote:

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
% out-sort.bam
ADD COMMENTlink modified 11 months ago by RamRS28k • written 9.7 years ago by Brad Chapman9.5k
Please log in to add an answer.


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