Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify HiCExperiment object based on chromosome #6

Closed
wangmhan opened this issue Apr 4, 2024 · 2 comments
Closed

modify HiCExperiment object based on chromosome #6

wangmhan opened this issue Apr 4, 2024 · 2 comments

Comments

@wangmhan
Copy link

wangmhan commented Apr 4, 2024

Hi, Thank you for the nice package!

My data is saved in .mcool format, followed by distiller-sm pipeline. Then I imported in R.
cool1 = CoolFile(paste0(my.path,"/data/microc_mcool/rep1.mm10.mapq_30.1000.mcool"))
rep1 = import(cool1)

I followed the OHCA tutorial, and would like to calculate the correlation between replicated as mentioned in Workflow1 (https://bioconductor.org/books/devel/OHCA/pages/workflow-yeast.html#correlation-between-replicates-with-hicrep).
Then I met a problem, as my data is not split to chromosome as showed in the example: hics[['WT_G2M_rep1']]["IV"].
So I tried the subset method:
select.gr <- GRanges("chr1:1-10000000").
After that I tried to get the matrix:
mat1=subsetByOverlaps(hics$rep1, select.gr) |> as.matrix(sparse = TRUE, use.scores = 'count')
mat2=subsetByOverlaps(hics$rep2, select.gr) |> as.matrix(sparse = TRUE, use.scores = 'count')
scc <- get.scc(
mat1, mat2,
resol = my.res, h = 2
)
--> here I met an error, as the dimension of mat1 and mat2 is not the same.

In the end I managed by subset before import. But it is not convenient if I want to check for every chromosome. I wonder if there is a way to split the HiCExperiment object after import?

Also, I met other errors with functions from HiContacts if the HiCExperiment object all chromosomes, but works fine if I subset by chromosome before import. For examples,

  1. distanceLaw (Error in dplyr::mutate():),
  2. getCompartments: Error in h(simpleError(msg, call)) :
    error in evaluating the argument 'x' in selecting a method for function 'seqnames': Object '/resolutions/1e+05/chroms' does not exist in this HDF5 file.

Please let me know if there is any solutions. Thank you!

@js2264
Copy link
Owner

js2264 commented Jun 3, 2024

Hi @wangmhan,
The point you raised is a known limitation. So far there is no way around this bug. I'll let you know if I figure out a way to circumvent this problem.

regarding the other errors:

  1. I don't see any error for distanceLaw, do you know what was the error message in your case?
  2. I see, this error should be fixed here: js2264/HiContacts@7d20050. You'll need to install the github version if you want to immediately try it out. Please let me know if you still have problems.

@wangmhan
Copy link
Author

wangmhan commented Jun 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants