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

load_data_from_matrices: Attribute not found #11

Open
ArashDepp opened this issue Sep 9, 2018 · 2 comments
Open

load_data_from_matrices: Attribute not found #11

ArashDepp opened this issue Sep 9, 2018 · 2 comments

Comments

@ArashDepp
Copy link

I am facing to related (possibly) issues:

I am trying to load the hic matrices which I have binned at 20kb resolution (N*M matrix, with approraite row and column names as described in input format for TXT matrices)

hifive workded fine till the creation of fend object file from the chromosomes lengths file using the follwing commands:
import hifive
fend = hifive.Fend(fend.object, mode='w', binned=20000)
fend.load_bins(chrom_length_filename, genome_name='MM10', format='len')
fend.save()

But next when I run,
data = hifive.HiCData(out_filename, mode='w')
data.load_data_from_matrices(fend.object, ['chr1.matrix', 'chr2.matrix', 'chr1_by_chr2.matrix']), I get error:
AttributeError: 'HiCData' object has no attribute 'load_data_from_matrices'

I also tried to run in directly from linux shell, where I am able to generate the binned fend file using the chromosome lengths, But got an error when I tried to load the hic data from matrices to create the HiC-data object.

AttributeError: 'HiCData' object has no attribute 'fends'

This was generated from the following command

hifive hic-data -X /path/to/matrices.txt path/to/fend/ path/to/output.

Can you please help me regarding these issues. I am using the latest (1.5) version of hifive which I installed using pip with python 2.7.11

Thank you.

@ArashDepp
Copy link
Author

In my attempt to investigate the error, I opened the 'hic_data.py' file in the hifive folder at github
https://github.com/bxlab/hifive/blob/master/hifive/hic_data.py

I appear that the attribute name for loading the binned matrices is defined as load_binned_data_from_matrices, instead of load_data_from_matrices (As given on the documentation page: https://bxlab-hifive.readthedocs.io/en/latest/hic_tutorial.html).

Typing data.load_binned_data_from_matrices inside python appears to be something....So I used it as follows:
data = hifive.HiCData(out_filename, mode='w')
data.load_binned_data_from_matrices(fend.object, ['chr1.matrix', 'chr2.matrix', 'chr1_by_chr2.matrix'])

but this throws another error:
AttributeError: 'list' object has no attribute 'split''
which is probably originating from near 785 in script hic_data.py.

please look into this matter.

@msauria
Copy link
Contributor

msauria commented Sep 10, 2018

Regarding the missing fend file from your first post, you need to include the fend filename in the path given on the command line.

As for the other error, I appreciate you catching this error in the documentation. If you look at the specific requirement of the 'filename' argument of 'load_binned_data_from_matices', if text files at being passed, you need to use an expression with a wildcard matching all desired text matrix files, such as 'chr*.txt' The indication to use a comma-separated list in the function description is incorrect and will be updated.

Please let me know if this doesn't solve the issue for you.
Thanks!

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