tanlongzhi / dip-c

Tools to analyze Dip-C (or other 3C/Hi-C) data
61 stars 18 forks source link

Error when modelling unfertilized egg cell #28

Closed tarak77 closed 5 years ago

tarak77 commented 5 years ago

Hey @tanlongzhi , This might be similar to issue https://github.com/tanlongzhi/dip-c/issues/26#issue-407292326 but i was trying to model the data from an unfertilized egg cell. To do so, I use hickit for the initial preprocessing steps and then for 3D reconstruction and imputation I use this repo.

To use this repo I convert the obtained impute.pairs and contact.pairs files from hickit to .con files by using hickit_pairs_to_con.sh and hickit_impute_pairs_to_con.sh scripts.

During the first round of 3D reconstruction, I am seeing that the.3dg file has both (mat) and (pat) rows. I find this strange because the.ncc file only has one haplotype notation (pat). Also note here that even though the data is from an egg cell, my 0 is actually mat and 1 is pat. Because I messed up while defining the SNP file, so thats why i have (pat) in my .ncc file.

So thats why maybe when implementing the dip-c impute3 -3code, i get an error

Traceback (most recent call last):
  File "/home/tshisode/dip-c/dip-c", line 130, in <module>
    main()
  File "/home/tshisode/dip-c/dip-c", line 63, in main
    return_value = impute3.impute3(sys.argv[1:])
  File "/home/tshisode/dip-c/impute3.py", line 109, in impute3
    con_data.impute_from_g3d_data(g3d_data, max_impute3_distance, max_impute3_ratio, max_impute3_ratio * g3d_resolution, is_male, par_data, vio_file)
  File "/home/tshisode/dip-c/classes.py", line 907, in impute_from_g3d_data
    self.con_lists[ref_name_tuple].impute_from_g3d_data(g3d_data, max_impute3_distance, max_impute3_ratio, min_impute3_separation, is_male, par_data, vio_file)
  File "/home/tshisode/dip-c/classes.py", line 757, in impute_from_g3d_data
    con.impute_from_g3d_data(g3d_data, max_impute3_distance, max_impute3_ratio, min_impute3_separation, is_male, par_data, vio_file)
  File "/home/tshisode/dip-c/classes.py", line 544, in impute_from_g3d_data
    impute3_ratio = impute3_distance / con_distance_tuples[1][1]
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

Again, your help will be great!

Below i have attched the files i mentioned above.

U_1CSE-35.tar.gz

tanlongzhi commented 5 years ago

Hey Tarak,

First of all, I notice that the vast majority of your contacts' haplotypes are 0. This is not suitable for imputation because you're only getting contacts from one haplotype (0) of a diploid.

tarak77 commented 5 years ago

I see. Is there a way around this problem? The data I have is from an egg cell. Could I skip the impute steps?

tanlongzhi commented 5 years ago

I think it'll be very difficult to obtain a 3D structure for an egg cell, because a large fraction of its genomes are completely identical between the two copies.

tarak77 commented 5 years ago

Aren't egg cells haploid? Just wondering if either this repo or hickit could help model those?

tanlongzhi commented 5 years ago

At least in human, eggs are diploid. They only become haploid upon fertilization, by which time they're called "female pronuclei".

Btw if your experiments did not remove the polar body (the first polar body, in this case) from the egg, they'll be tetraploid.

tanlongzhi commented 5 years ago

As a result, this repo will only be able to model the part where the two copies are not identical (as a result of crossovers), but not the part where the two copies are identical.

tarak77 commented 5 years ago
screenshot 2019-02-09 at 6 00 00 pm

The way I am thinking is that before fertilisation, the unfertilised egg and sperm are haploid(with single copy of each chromosome be it mouse or human). In the zygote, you will have male and female pronuclei as two spheres, each with 23 chromosomes..

Am I still missing something?

tanlongzhi commented 5 years ago

This figure is not accurate. Please refer to appropriate textbooks on meiosis or reproductive biology.

tanlongzhi commented 5 years ago

I found some more accurate figures for you: 1, 2, 3. A mature egg is typically referred to as an "MII oocyte", which is a diploid.

tarak77 commented 5 years ago

Oh okay. Thanks!