Skip to content
Snippets Groups Projects
Commit 097d06d5 authored by Glenn Proctor's avatar Glenn Proctor
Browse files

Created; parses regulatory feature data from a cisRed database dump into a...

Created; parses regulatory feature data from a cisRed database dump into a file suitable for loading with load_regulatory.pl. Ideally load_regualatory.pl should be able to understand different file formats (with some command-line hint as to what it's looking it) and so remove the need for this intermediate step
parent 61183785
No related branches found
No related tags found
No related merge requests found
# Parse regulatory feature data from a CisRED file into a file
# in a format suitable for reading into an ensembl database using
# load_regulatory.pl
# Cisred data is available under http://www.cisred.org/files/Databases
# e.g. http://www.cisred.org/files/Databases/cisREDdb-Hsap-1.1b/SQL/data.zip
# File format of cisred features.txt file (tab separated)
# id batch_id seqname source feature start end score strand frame ensembl_gene_id
use strict;
use DBI;
use Getopt::Long;
my ($infile, $outfile);
GetOptions( "infile=s", \$infile,
"outfile=s", \$outfile,
"help", \&usage);
usage() if (!$infile || !$outfile);
print "Reading from $infile\n";
my $count = 0;
open (INFILE, "<$infile") || die "Can't open $infile";
open (OUTFILE, ">$outfile") || die "Can't open $outfile";
while (<INFILE>) {
my ($id,$batch_id,$seqname,$source,$feature,$start,$end,$score,$strand,$frame,$ensembl_gene_id) = split;
print OUTFILE join ("\t", "Similarity", $feature, $source, "transcription_factor", $seqname, $start, $end, $strand, $frame,$score,"gene","id","\"$ensembl_gene_id\"" ) . "\n";
# XXX transcription_factor?
$count++;
}
close INFILE;
close OUTFILE;
print "Wrote $count regulatory features to $outfile\n";
sub usage {
print <<EOF;
Usage: perl parse_cisred.pl
-infile : Cisred features.txt file
-outfile : File to be written for load_regulatory.pl
Data files available from e.g.
http://www.cisred.org/files/Databases/cisREDdb-Hsap-1.1b/SQL/data.zip
EOF
exit(0);
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment