markrobinsonuzh / DAMEfinder

Finds DAMEs - Differential Allelicly MEthylated regions
MIT License
10 stars 3 forks source link

Reading reference file error in SNP-based mode #36

Closed kashiff007 closed 4 years ago

kashiff007 commented 4 years ago

Hi, thanks for creating this great package.

I was trying to use SNP-based (aka slow-mode) mode with my new custom genome. I successfully created my genome through BSgenomeForge

While running the following step:

snp.list <- extract_bams(bam_files, vcf_files, sample_names, reference_file,
                       coverage = 2)

an error is generating:

Reading reference file
Error in path.expand(path[idx]) : invalid 'path' argument

I also tried to play every possible way with chromosome names but still the error is same.

Can you suggest possible solution?

sorjuela commented 4 years ago

Hi @kashiff007 thank you for your message.

Can you post the output from sessionInfo()?

Also the values of bam_files, vcf_files, sample_names, reference_file?

Thanks, S

kashiff007 commented 4 years ago

Thanks for the reply @sorjuela,

I have solved this issue by renaming my scaffolds with simple numbers.

Since the DAMEfinder illustrate only to work with single chromosome/scaffolds, I am wondering can I run for whole genome (all chromosomes/scaffolds in genome) at once?

#Use another reference file for demonstration, and fix the seqnames
genome <- BSgenome.Hsapiens.UCSC.hg19
seqnames(genome) <- gsub("chr","",seqnames(genome))
reference_file <- DNAStringSet(genome[[19]], use.names = TRUE)
names(reference_file) <- 19

#Extract reads and extract methylation according to allele
snp.list <- extract_bams(bam_files, vcf_files, sample_names, reference_file,
                       coverage = 2)

Thanks in advance

sorjuela commented 4 years ago

Hi @kashiff007, In the example in the vignette it runs 1 chromosome, but in practice it will of course run on all the chromosomes you have in your VCF file. Depending on the number of chromosomes this might take some time.

If you have multiple samples, you can set cores to a higher number if your computing setup allows it.

sorjuela commented 4 years ago

I will close the issue, but feel free to open a new one if you have more problems.