js2264 / HiContacts

Analyzing Hi-C data in R with HiCExperiment objects
https://js2264.github.io/OHCA/
Other
10 stars 1 forks source link

Compartments phasing error #6

Open ABignaud opened 1 year ago

ABignaud commented 1 year ago

Hi,

Trying to do some compartments on a bacterial chromosome (fasta file with only one sequence), I got the following error message. If I am not doing the phasing, the function works.

library(HiCExperiment)
library(HiContacts)
library(Biostrings)
library(BSgenome)

# Import
cf <- "B_caecimuris_v2_MM81.mcool"
res <- 16000
hic <- HiCExperiment::import(CoolFile(cf), resolution = res)
phasing_track <- readDNAStringSet("B_caecimuris_v2.fa", format = "fasta")

# Comp
hic <- autocorrelate(hic)
compts <- getCompartments(hic, genome=phasing_track)
Going through preflight checklist...
Parsing intra-chromosomal contacts for each chromosome...
  |                                                                            |                                                                      |     |                                                                            |======================================================================| 100%

Computing eigenvectors for each chromosome...
Error: BiocParallel errors
  1 remote errors, element index: 1
  0 unevaluated and other errors
  first remote error:
Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'letterFrequency': error in evaluating the argument 'value' in selecting a method for function 'unsplit': error in evaluating the argument 'x' in selecting a method for function 'extractAt': subscript contains invalid names

Thanks for your help !!

ABignaud commented 1 year ago

I got the same error for multichromosomic reference.

js2264 commented 1 year ago

Can you check the names of your fasta files (names(genome))? The only instance in which I can replicate your results is when I use a fastq file with spaces in the chromosome names.

ABignaud commented 1 year ago

I just look, i don't have any space in that genome names, just one sequence called: >B_caecimuris

js2264 commented 1 year ago

Thanks for checking. I'll investigate more