my ( $sql );
- #LOAD DATA INFILE....(col1, @dummy) SET col2 = IF(@dummy = '.', NULL, @dummy)
-
$sql = qq(LOAD DATA LOCAL INFILE "$file" INTO TABLE $table);
print STDERR "$sql\n" if $verbose;
"BLOCK_COUNT TINYINT, INDEX BLOCK_COUNT_index (BLOCK_COUNT)",
"BLOCK_BEGS VARCHAR(1024)",
"BLOCK_LENS VARCHAR(1024)",
+ "BLOCK_TYPE VARCHAR(1024)",
);
$field_str = join( ", ", @fields );
sub svg_track_dna
{
+ # Martin A. Hansen, October 2009.
+
+ # Given a DNA sequence as a list add a string
+ # of chars to a SVG object.
+
+ my ( $width, # width
+ $svg, # SVG object
+ $dna,
+ ) = @_;
+
+ # Returns nothing.
+
+ my ( $track );
+ $dna = 'GAACGACGAGCATCAGCGGACACTACATCATATACTACATC';
+
+ $track = $svg->group(
+ id => 'TRACK_DNA',
+ style => {
+ # 'stroke-width' => 5,
+ # stroke => 'black', # TODO can this be removed?
+ 'font-family' => 'Courier New',
+ 'font-size' => '15px',
+ 'letter-spacing' => '15',
+ }
+ );
+
+ $track->text(
+ id => 'DNA',
+ x => 0,
+ y => 20,
+ -cdata => $dna,
+ );
}
BLOCK_COUNT => 8,
BLOCK_BEGS => 9,
BLOCK_LENS => 10,
+ BLOCK_TYPE => 11,
};
# 0 1 2
# BLOCK_COUNT => 2
# BLOCK_BEGS => 1,6
# BLOCK_LENS => 3,3
+# BLOCK_TYPE => 1,1
#
#
-# 'S.aur complete genome' 3 12 'TAG_000001' 1 + 31 2 1,6 3,3
+# 'S.aur complete genome' 3 12 'TAG_000001' 1 + 31 2 1,6 3,3 1,1
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@fields = split /\t/, $line;
- Maasha::Common::error( qq( BAD kiss entry: $line) ) if not @fields == 11;
+ Maasha::Common::error( qq( BAD kiss entry: $line) ) if not @fields == 12;
$entry{ 'S_ID' } = $fields[ S_ID ];
$entry{ 'S_BEG' } = $fields[ S_BEG ];
$entry{ 'BLOCK_COUNT' } = $fields[ BLOCK_COUNT ];
$entry{ 'BLOCK_BEGS' } = $fields[ BLOCK_BEGS ];
$entry{ 'BLOCK_LENS' } = $fields[ BLOCK_LENS ];
+ $entry{ 'BLOCK_TYPE' } = $fields[ BLOCK_TYPE ];
return wantarray ? %entry : \%entry;
}
$fh ||= \*STDOUT;
- $fields[ S_ID ] = $entry->{ 'S_ID' };
- $fields[ S_BEG ] = $entry->{ 'S_BEG' };
- $fields[ S_END ] = $entry->{ 'S_END' };
- $fields[ Q_ID ] = $entry->{ 'Q_ID' };
- $fields[ SCORE ] = $entry->{ 'SCORE' };
- $fields[ STRAND ] = $entry->{ 'STRAND' };
- $fields[ HITS ] = $entry->{ 'HITS' };
- $fields[ ALIGN ] = $entry->{ 'ALIGN' };
+ $fields[ S_ID ] = $entry->{ 'S_ID' };
+ $fields[ S_BEG ] = $entry->{ 'S_BEG' };
+ $fields[ S_END ] = $entry->{ 'S_END' };
+ $fields[ Q_ID ] = $entry->{ 'Q_ID' };
+ $fields[ SCORE ] = $entry->{ 'SCORE' };
+ $fields[ STRAND ] = $entry->{ 'STRAND' };
+ $fields[ HITS ] = $entry->{ 'HITS' };
+ $fields[ ALIGN ] = $entry->{ 'ALIGN' };
$fields[ BLOCK_COUNT ] = $entry->{ 'BLOCK_COUNT' };
$fields[ BLOCK_BEGS ] = $entry->{ 'BLOCK_BEGS' };
$fields[ BLOCK_LENS ] = $entry->{ 'BLOCK_LENS' };
+ $fields[ BLOCK_TYPE ] = $entry->{ 'BLOCK_TYPE' };
print $fh join( "\t", @fields ), "\n";
}
$record->{ 'BLOCK_COUNT' } ||= ".";
$record->{ 'BLOCK_BEGS' } ||= ".";
$record->{ 'BLOCK_LENS' } ||= ".";
+ $record->{ 'BLOCK_TYPE' } ||= ".";
$record->{ 'ALIGN' } ||= $record->{ 'DESCRIPTOR' } || ".";
return wantarray ? %{ $record } : $record;
$t0 = Time::HiRes::gettimeofday();
Maasha::KISS::Draw::svg_frame( 800, 1200, $svg );
+ Maasha::KISS::Draw::svg_track_dna( 1200, $svg, 'dna', 'ATCG' );
+
if ( @$entries > $MAX ) {
Maasha::KISS::Draw::svg_track_histogram( $svg, $features, 'track id', 'green' ) if $features;
} else {