<jupyter_start><jupyter_text>Example usage of Millefy<jupyter_code>library(millefy)<jupyter_output>Warning message:
“replacing previous import ‘IRanges::shift’ by ‘data.table::shift’ when loading ‘millefy’”Registered S3 method overwritten by 'xts':
  method     from
  as.zoo.xts zoo 
Warning message:
“replacing previous import ‘IRanges::distance’ by ‘destiny::distance’ when loading ‘millefy’”Warning message:
“replacing previous import ‘IRanges::collapse’ by ‘dplyr::collapse’ when loading ‘millefy’”Warning message:
“replacing previous import ‘data.table::last’ by ‘dplyr::last’ when loading ‘millefy’”Warning message:
“replacing previous import ‘IRanges::union’ by ‘dplyr::union’ when loading ‘millefy’”Warning message:
“replacing previous import ‘IRanges::slice’ by ‘dplyr::slice’ when loading ‘millefy’”Warning message:
“replacing previous import ‘IRanges::intersect’ by ‘dplyr::intersect’ when loading ‘millefy’”Warning message:
“replacing previous import ‘IRanges::setdiff’ by ‘dplyr::setdiff’ when loading ‘millefy’”Warning message:
“replacing previous import ‘data.table::first’ by ‘dplyr[...]<jupyter_text>Input files  BigWig files (scRNA-seq samples)<jupyter_code># Path to bigWig files
bwfiles = Sys.glob(file.path(system.file("extdata", package="millefy"), "*.bw"))
print(bwfiles)
# Group labels for bigWig files (same length as bwfiles)
groups = c("00h", "00h", "00h", "12h", "12h", "12h")
# Color labels for bigWig files (A named vector with the same length as the number of kinds of \\code{groups})
color_labels <- colorRampPalette(c("yellow", "red"))(length(unique(groups))+1)[1:length(unique(groups))]
names(color_labels)  <- unique(groups)
print(color_labels)<jupyter_output>00h       12h 
"#FFFF00" "#FF7F00"<jupyter_text>GTF file (gene models)<jupyter_code># Load gene models (It takes a little time)
path_gtf = system.file("extdata", "example.gtf", package="millefy")
dt_gtf_exon <- gtfToDtExon(path_gtf)<jupyter_output><empty_output><jupyter_text>Set tracks<jupyter_code># Set tracks
## Single-cell track
max_value = 7000
scTrackBw <- list(path_bam_files = bwfiles, groups = groups, group_colors = color_labels, max_value = max_value, isBw=TRUE)

## Gene annotation track
geneTrack1 <- list(path_gtf = path_gtf, dt_gtf = dt_gtf_exon, label = "GENCODE")


# Prepare arguments for millefyPlot()
## List of tracks
tdlist <- list(scTrackBw, geneTrack1)

## List of track types
tt <- c("sc", "gene")

## List of track hights
heights = c(12, 2)<jupyter_output><empty_output><jupyter_text>Set a location<jupyter_code># Location to visualize
chr =  "chr19" # character
start = 5824708 # integer
end = 5845478 # integer

text_main = "mESC 00h, 12h (Neat1)"<jupyter_output><empty_output><jupyter_text>Plot  DefaultWhen we don't set the sc_sort_destiny parameter (default), the order of single cells is the order of bwfiles.<jupyter_code>l <- millefyPlot(track_data=tdlist, track_type=tt, heights=heights,
          sc_type = "heatmap",
          chr = chr, start = start, end = end,
          sc_avg = TRUE, sc_avg_height = 1,
          title = text_main)<jupyter_output>[1] "Begin millefyPlot: 2019-12-30 02:19:04"
[1] "title" "sc"    "avg"   "gene"  "axis" 
[1] "Importing BigWig: 2019-12-30 02:19:04"
[1] "Finished millefyPlot: 2019-12-30 02:19:05"<jupyter_text>Replot ('all-cell' mode)When we set sc_sort_destiny = 'all', all single cells are reordered by diffusion maps.<jupyter_code>millefy_adjust(sc_sort_destiny = 'all')<jupyter_output>[1] "Begin millefyPlot: 2019-12-30 02:19:05"
[1] "title" "sc"    "avg"   "gene"  "axis"<jupyter_text>Replot ('group-wise' mode)When we set sc_sort_destiny = 'group', all single cells in each group are reordered by diffusion maps.<jupyter_code>millefy_adjust(sc_sort_destiny = 'group')<jupyter_output>[1] "Begin millefyPlot: 2019-12-30 02:19:07"
[1] "title" "sc"    "avg"   "gene"  "axis"<jupyter_text>Replot (Change scale of averaged single-cell read coverage track)Using `sc_avg_scale`, you can change the scale of the averaged single-cell read coverage tracks<jupyter_code>millefy_adjust(sc_avg_scale = 7000)<jupyter_output>[1] "Begin millefyPlot: 2019-12-30 02:19:08"
[1] "title" "sc"    "avg"   "gene"  "axis" 
[1] "Finished millefyPlot: 2019-12-30 02:19:08"<jupyter_text>sessionInfo<jupyter_code>sessionInfo()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1326981175923774, 'fraction_numerical': 0.03904252846851034, 'mean_word_length': 6.459272097053726, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '559496', 'license': 'MIT', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1557, 'n_words': 391, 'path': 'examples/test_millefy.ipynb', 'repo_name': 'yuifu/datascience-notebook-millefy', 'size': '4303'}