Hello, I am running the 2.4 version of the pipelin...
# raredisease
f
Hello, I am running the 2.4 version of the pipeline and I was wondering if someone could help me with a parameter. I want to do ME calling and annotation but I am using grch38 and I am not sure where to get the appropriate files. The TSV listed in the example has 4 separate bed files for grch37 but it doesn't really give details on what I need for grch38 or where I could find those files.
b
If you look at the RetroSeq paper this is how (see bottom) they identified their mouse TE insertions. My guess is that the raredisease pipeline is using some kind of cleaned-up version of the repeat masker output. Your best bet would probably be to download it from UCSC and then clean it up yourself to match the test dataset. I took a look it doesn't match up very well but it's not terrible. Also I think they used RetroSeq because it was already available in nf-core but I think maybe a different tool would provide better performance (PMID: 27524380 + PMID: 3785310).
Reference Files
Reference genome: ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/phase2_reference_assembly_sequence/
The Alu and L1 BED files are derived directly from Repeatmasker. A copy of the BED files used in the analysis are here:ftp://ftp-mouse.sanger.ac.uk/other/tk2/RetroSeq/hg19/
Also, we used Alu and L1 sequence files to increase the sensitivity of the discover stage. These were derived directly from Repbase. A copy of the files used is here: ftp://ftp-mouse.sanger.ac.uk/other/tk2/RetroSeq/hg19/hg19_probes.tgz
🙌 1
just coming back to this. if you look at the test data: https://github.com/nf-core/test-datasets/blob/raredisease/reference/grch37_g1k_sva_21.bed you can try and compare it to the https://hgdownload.soe.ucsc.edu/goldenpath/hg19/database/rmsk.txt.gz there is a clear off by 1 difference so be careful (although in the grand scheme of things for this type of analysis it doesn't matter) - one is probably 0-based vs 1-based or I noticed l1/sva are identical for the test dataset too anyway if you remove chr and then subset for each type in the in column 11,12,13 for SVA/LA/Alu/ERV etc... (regex/grep) you can recreate your own bed files. I think probably they used a repeat masker from a different source maybe ENSMEBL or NCBI but it should suffice IMO anyway if you chop them up and season them well and make them into a good BED id imagine they do finely if you build a script that works for hg19 above you would just plug-and-play with https://hgdownload.soe.ucsc.edu/goldenpath/hg19/database/rmsk.txt.gz
for posterity : since a bunch of people helped me out today with configs - I added L2 to the L1 bed... not sure if its a big deal there were good # of them. maybe remove from the grep for the L1 if you don't want em. its ballpark similar I'd imagine, I ran it on hg19 and everything but the L1 counts are consistent. there's some pretty big changes between hg19 and hg38 but I think that's because they cleaned up the genome in the latter
Copy code
setwd('transposons')
library(data.table)

repeats <- fread('rmsk_hg38.txt.gz')

## BED writer (no 1-bp shift)
write.bed.direct <- function(dt, filename) {
  dt <- dt[chr %in% paste0('chr', c(1:22, 'X', 'Y'))]
  dt$chr <- gsub('chr', '', dt$chr)
  fwrite(dt, filename, sep='\t', col.names=FALSE)
}

## Alu elements
repeats.alu <- repeats[grepl('Alu', V11) | grepl('Alu', V13),.(chr = V6, start = V7, end = V8, name = 'SINE/Alu')]
write.bed.direct(repeats.alu,'grch38_UCSC_alu.bed')

## HERV elements
repeats.herv <- repeats[grepl('LTR|ERV', V11) | grepl('LTR|ERV', V13),.(chr = V6, start = V7, end = V8, V12, V13)]
repeats.herv$name <- paste0(repeats.herv$V12,'/',repeats.herv$V13)
repeats.herv <- repeats.herv[!grepl('Gypsy', name) & grepl('ERV', name)]
repeats.herv <- repeats.herv[, .(chr, start, end, name)]
write.bed.direct(repeats.herv,'grch38_UCSC_herv.bed')

## L1/L2 elements
repeats.l1 <- repeats[grepl('^L1|^L2', V11) | grepl('^L1|^L2', V13),.(chr = V6, start = V7, end = V8, V12, V13)]
repeats.l1$name <- paste0(repeats.l1$V12,'/',repeats.l1$V13)
repeats.l1 <- repeats.l1[, .(chr, start, end, name)]
write.bed.direct(repeats.l1,'grch38_UCSC_l1.bed')

## SVA elements
repeats.sva <- repeats[grepl('^SVA', V11) | grepl('^SVA', V12) | grepl('^SVA', V13),.(chr = V6, start = V7, end = V8, V12, V13)]
repeats.sva$name <- paste0(repeats.sva$V12,'/',repeats.sva$V13)
repeats.sva <- repeats.sva[, .(chr, start, end, name)]
write.bed.direct(repeats.sva,'grch38_UCSC_sva.bed')

file.paths <- data.table(
  type = c("L1", "SVA", "ALU", "HERV"),
  path = c(
    normalizePath("grch38_UCSC_l1.bed"),
    normalizePath("grch38_UCSC_sva.bed"), 
    normalizePath("grch38_UCSC_alu.bed"),
    normalizePath("grch38_UCSC_herv.bed")
  )
)
## output
fwrite(file.paths,"../mobile_element_references.tsv", sep="\t")