#!/usr/bin/perl ## LGPL copyright notice ## # # Copyright 2010 bed2UCSC # See the enclosed file COPYING for license information (LGPL). # If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. # # Stephan Struckmann # stephan.struckmann@uni-rostock.de # ## use LWP::UserAgent ; # This is needed for upload use strict ; use warnings ; # use Data::Dumper ; sub Dumper { # enbale the Dumper module for debug reasons. } ; use Clone qw/ clone / ; # needed in current version, but dependency may be removed in future versions my %args = @ARGV ; # to prevent from using command line argument interpreter module my @records = ( ) ; my $template = <<'TEMPLATE' ; # This template is used to generate the Wiki-entries. Do not make this too long, because wiki entries are created using a GET request. Probably this could be changed to POST to abandon this restriction. Wiki syntax may be used here -- and all record dependent variables: name, pmid(s), and all other. May be overriden using the -template argument (see below). Name: $name Pubmed-Ids: $pmid TEMPLATE # Options as properties: { my $db = $args{-db} || 'hg18' ; print "Using $db as default database for upload. Please be aware, that track lines having a db=... entry will be interpreted and may overwrite that default value!\n" ; warn 'When this script was written, only hg18, hg19 and mm9 were supported by WikiTracks.' unless { hg18 => 1, hg19 => 1, mm9 => 1, } -> {$db} ; my $user = $args{-user} ; die 'Please provide your user name using -user ...' unless $user ; my $bed = $args{-bed} ; die 'Please provide readable BED file with -bed ...' unless $bed && -r $bed ; if ($args{-template} && -r $args{-template}) { open TEMPLATE, '<' . $args{-template} ; $template = join '',