File tree 1 file changed +21
-0
lines changed 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -3918,6 +3918,26 @@ function trackDoubleClick() {
3918
3918
createTubeMap ( ) ;
3919
3919
}
3920
3920
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
+
3921
3941
function trackSingleClick ( ) {
3922
3942
/* jshint validthis: true */
3923
3943
// Get the track ID as a number
@@ -3940,6 +3960,7 @@ function trackSingleClick() {
3940
3960
track_attributes . push ( [ "Score" , current_track . score ] ) ;
3941
3961
track_attributes . push ( [ "CIGAR string" , current_track . cigar_string ] ) ;
3942
3962
track_attributes . push ( [ "Mapping Quality" , current_track . mapping_quality ] ) ;
3963
+ track_attributes . push ( [ "Path Info" , getPathInfo ( current_track ) ] ) ;
3943
3964
}
3944
3965
console . log ( "Single Click" ) ;
3945
3966
console . log ( "read path" ) ;
You can’t perform that action at this time.
0 commit comments