3
# This script will convert from SGD format to GFF format
4
# See http://db.yeastgenome.org/schema/Schema.html
8
# hard-coded length data that I couldn't get directly
9
my %CHROMOSOMES = (I => 230_203,
26
my @ROMAN = qw(I II III IV V VI VII VIII IX X
27
XI XII XIII XIV XV XVI Mit);
29
if ($ARGV[0] =~ /^--?h/) {
31
Usage: $0 <SGD features file>
33
This script massages the SGD sequence annotation flat files located at
34
ftp://genome-ftp.stanford.edu/pub/yeast/data_dump/feature/chromosomal_features.tab
35
into a version of the GFF format suitable for display by the generic
38
To use this script, get the SGD chromosomal_features.tab file from the
39
FTP site listed above, and run the following command:
41
% process_sgd.pl chromosomal_features.tab > yeast.gff
43
The yeast.gff file can then be loaded into a Bio::DB::GFF database
44
using the following command:
46
% bulk_load_gff.pl -d <databasename> yeast.gff
52
# first print out chromosomes
53
# We hard coded the lengths because they are not available in the features table.
54
for my $chrom (sort keys %CHROMOSOMES) {
55
print join("\t",$chrom,'chromosome','Component',1,$CHROMOSOMES{$chrom},'.','.','.',qq(Sequence "$chrom")),"\n";
58
# this is hard because the SGD idea of a feature doesn't really map onto the GFF idea.
61
my($id,$gene,$aliases,$type,$chromosome,$start,$stop,$strand,$sgdid,$sgdid2,$description,$date) = split "\t";
62
my $ref = $ROMAN[$chromosome-1];
63
$description =~ s/"/\\"/g;
64
$description =~ s/;/\\;/g;
66
$strand = $strand eq 'W' ? '+' : '-';
67
($start,$stop) = ($stop,$start) if $strand eq '-';
68
die "Strand logic is messed up" if $stop < $start;
71
my @aliases = split(/\|/,$aliases);
72
my $aliases = join " ; ",map {qq(Alias "$_")} @aliases;
73
my $group = qq(Gene "$gene" ; Note "$description");
74
$group .= " ; $aliases" if $aliases;
75
print join("\t",$ref,'sgd','gene',$start,$stop,'.',$strand,'.',$group),"\n";
76
$description .= "\\; AKA @aliases" if @aliases;
79
print join("\t",$ref,'sgd',$type,$start,$stop,'.',$strand,'.',qq($type "$id" ; Note "$description")),"\n";
86
process_sgd.pl - Massage SGD annotation flat files into a version suitable for the Generic Genome Browser
90
% process_sgd.pl chromosomal_features.tab > yeast.gff
94
This script massages the SGD sequence annotation flat files located at
95
ftp://genome-ftp.stanford.edu/pub/yeast/data_dump/feature/chromosomal_features.tab
96
into a version of the GFF format suitable for display by the generic
99
To use this script, get the SGD chromosomal_features.tab file from the
100
FTP site listed above, and run the following command:
102
% process_sgd.pl chromosomal_features.tab > yeast.gff
104
The yeast.gff file can then be loaded into a Bio::DB::GFF database
105
using the following command:
107
% bulk_load_gff.pl -d <databasename> yeast.gff
111
L<Bio::DB::GFF>, L<bulk_load_gff.pl>, L<load_gff.pl>
115
Lincoln Stein, lstein@cshl.org
117
Copyright (c) 2002 Cold Spring Harbor Laboratory
119
This library is free software; you can redistribute it and/or modify
120
it under the same terms as Perl itself. See DISCLAIMER.txt for
121
disclaimers of warranty.