File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -3918,6 +3918,26 @@ function trackDoubleClick() {
39183918 createTubeMap ( ) ;
39193919}
39203920
3921+ // Takes a track and returns a string describing the nodes it passes through
3922+ // In the format of >1>2<3>4, with the intergers being nodeIDs
3923+ function getPathInfo ( track ) {
3924+ let result = "" ;
3925+ if ( ! track . sequence ) {
3926+ return result ;
3927+ }
3928+
3929+ for ( const nodeID of track . sequence ) {
3930+ // Node is approached backwards if "-" is present
3931+ if ( Array . from ( nodeID ) [ 0 ] === "-" ) {
3932+ result = result . concat ( "<" , nodeID . substring ( 1 ) ) ;
3933+ } else {
3934+ result = result . concat ( ">" , nodeID ) ;
3935+ }
3936+ }
3937+
3938+ return result ;
3939+ }
3940+
39213941function trackSingleClick ( ) {
39223942 /* jshint validthis: true */
39233943 // Get the track ID as a number
@@ -3940,6 +3960,7 @@ function trackSingleClick() {
39403960 track_attributes . push ( [ "Score" , current_track . score ] ) ;
39413961 track_attributes . push ( [ "CIGAR string" , current_track . cigar_string ] ) ;
39423962 track_attributes . push ( [ "Mapping Quality" , current_track . mapping_quality ] ) ;
3963+ track_attributes . push ( [ "Path Info" , getPathInfo ( current_track ) ] ) ;
39433964 }
39443965 console . log ( "Single Click" ) ;
39453966 console . log ( "read path" ) ;
You can’t perform that action at this time.
0 commit comments