using bootstrapping and generalized linear mixed model
Author
Haowen He
Published
April 24, 2024
1 Data preprocessing
1.1 Load BgrB Seurat object
Code
# load in the genome annotation# replace "_" with "-" as Seurat cannot recognize "_"annotations_mz <-readGFFAsGRanges('/Users/haowenhe/Desktop/GCF_000238955.4_M_zebra_UMD2a_genomic.gtf')annotations_mz$gene_id <-str_replace_all(annotations_mz$gene_id, "_", "-")annotations_mz$gene_name <- annotations_mz$gene_idannotations_mz$gene <-str_replace_all(annotations_mz$gene, "_", "-")annotations_mz$transcript_id <-str_replace_all(annotations_mz$transcript_id, "_", "-")annotations_mz$tx_id <- annotations_mz$transcript_id# export(annotations_mz, 'annotations_mz.gtf')# load in the gene annotationmz_genome_file <-"/users/haowenhe/Desktop/GCF_000238955.4_M_zebra_UMD2a_genomic.fna"mz_genome <-read_genome(format ='fasta', file = mz_genome_file)# remove the long text description after the feature names in annotationmy_mz_genome <- mz_genomenames(my_mz_genome) <- reshape2::colsplit(names(my_mz_genome), " ", c("1", '2'))[,1]# load tel&ob datatel_final <-readRDS("/users/haowenhe/Downloads/tel.ob_integrated_atac.gex_FINAL_04.17.24_KL.rds")
1.2 Update file path for Fragment objects
Code
DefaultAssay(tel_final) <-"peaks"# get list of fragment objectsfrags <-Fragments(tel_final) # remove fragment information from assayFragments(tel_final) <-NULLGetFragmentData(object = frags[[1]], slot ="path")