Open mgabriel01 opened 6 months ago
Hello,
This is my solution to disable reverse sequence and translation for genome (assembly) track. I wrote a function "mydefault_session()" that replace default_session by adding the showXX to the display section.
This new function is then used this way :
default_session <- mydefault_session( assembly, c(annotations_track) )
mydefault_session <- function(assembly, displayed_tracks, display_assembly = TRUE) { assembly_name <- JBrowseR:::get_assembly_name(assembly)
configuration <- stringr::str_c(assembly_name, "-ReferenceSequenceTrack")
if (display_assembly) { reference_track= as.character( stringr::str_glue( "{{ ", '"type": "ReferenceSequenceTrack", ', '"configuration": "{configuration}", ', '"displays": [ ', "{{ ", '"type": "LinearReferenceSequenceDisplay", ', '"configuration": "{stringr::str_c(configuration, "-LinearReferenceSequenceDisplay")}",', '"showForward": true,', '"showReverse": false,', '"showTranslation": false', "}}", "]", "}}" ) ) } else { reference_track = "" }
tracks <- JBrowseR:::get_tracks(assembly, displayed_tracks, display_assembly)
as.character( stringr::str_glue( "{{ ", '"name": "My Session", ', '"view": {{ ', '"id": "LinearGenomeView", ', '"type": "LinearGenomeView", ', '"tracks": [ ', "{reference_track} ", "{tracks} ", "] ", "}} ", "}}" ) ) }
Hello, Thank you for this nice tool.
Is there a way to change the display of the tracks by using the functions assembly(), track_feature(), track_alignments(), default_session(), or at least a config file? For example, by default we have the genome in forward and reverse, and the corresponding translation in 3 frames, is there an easy way to reduce this ?
Thank you in advance for your answer !
Best,
Marc G.