#!/usr/local/bin/perl -w # A program that accept an input file: Scorpion database from Gen Bank # and will output the database in BioWare format my $file1="$ARGV[0]"; #var to save the input database my $result=">".$ARGV[1]; my $counter=1; my $no='D000001'; open(INFO1,$file1) or die "Can't open $file1.\n"; #open file1 open(OUT,$result) or die "Can't open $result.\n"; #foreach line in the files foreach() { if(/^DATE\s*(.*)-(.*)-(.*)/){ print OUT "DBACC\t $no\n"; print OUT "Date\t $1-$2-$3\n"; $no++; } elsif(/\s*\/exon="(\d*-\d*)*"\n/){ print OUT "Exon\t \{Translation\%$1\}\n"; } elsif(/\s*\/intron="(\d*-\d*)*"\n/){ print OUT "Intron\t \{Translation\%$1\}\n"; } else{ print OUT "line $counter\n"; } $counter++; } close(INFO1); close(OUT);