I have multiple bed-files which are basically 3 coordinate files. So right now Im doing as such
Read the files and turn them into GRange objects. I have different sets which are in same folder for Blast_NPM1
B19 <- read.table("HSC_CMP_GMP_MONO_ATAC/HSC_CMP_ATAC_bed/Blast_mutation/Blast_NPM1/Blast19.bed",header = FALSE)
B20 <- read.table("HSC_CMP_GMP_MONO_ATAC/HSC_CMP_ATAC_bed/Blast_mutation/Blast_NPM1/Blast20.bed",header = FALSE)
B21 <- read.table("HSC_CMP_GMP_MONO_ATAC/HSC_CMP_ATAC_bed/Blast_mutation/Blast_NPM1/Blast21.bed",header = FALSE)
B9 <- read.table("HSC_CMP_GMP_MONO_ATAC/HSC_CMP_ATAC_bed/Blast_mutation/Blast_NPM1/Blast9.bed",header = FALSE)
B19 <- GRanges(
B19$V1,IRanges(B19$V2,B19$V3),
strand="*"
)
B20 <- GRanges(
B20$V1,IRanges(B20$V2,B20$V3),
strand="*"
)
B21 <- GRanges( B21$V1,IRanges(B21$V2,B21$V3),strand="*" )
B9 <- GRanges( B9$V1,IRanges(B9$V2,B9$V3),strand="*" )
I have removed the plotting part it can be done later This i have to kind of repeat for different sets ..
How do I turn this into a function ? Any suggestion or help would be really appreciated.