Last active
August 29, 2015 14:13
-
-
Save nazarov-yuriy/94f08e5eabfa9c5d87a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
use Template; | |
my $vars = { | |
GENOME_BUILD_NAME => 'GENOME_BUILD_NAME_val', | |
CHROMOSOME => 'CHROMOSOME_val', | |
SAMPLE_HASH => { | |
pairs => { | |
123 => { | |
sample_name => 'name123', | |
bigwig_URL => 'url123', | |
}, | |
234 => { | |
sample_name => 'name234', | |
bigwig_URL => 'url234', | |
}, | |
}, | |
}, | |
}; | |
my $tt = Template->new(); | |
$tt->process(\*DATA, $vars); | |
=sample output | |
track db=GENOME_BUILD_NAME_val position=CHROMOSOME_val type=bigWig name=name123 visibility=full bigDataUrl=url123 | |
track db=GENOME_BUILD_NAME_val position=CHROMOSOME_val type=bigWig name=name234 visibility=full bigDataUrl=url234 | |
=cut | |
__DATA__ | |
[%- FOREACH library_pair IN SAMPLE_HASH.pairs %] | |
track db=[% GENOME_BUILD_NAME %] position=[% CHROMOSOME %] type=bigWig name=[% library_pair.value.sample_name %] visibility=full bigDataUrl=[% library_pair.value.bigwig_URL %] | |
[%- END %] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment