yezhengSTAT / FreeHiC

FreeHi-C pipeline for high fidelity Hi-C data simulation.
MIT License
8 stars 9 forks source link

miss sizeof(int), size number is wrong #2

Open remember-past opened 4 years ago

remember-past commented 4 years ago

Question1: In the freeHiC_cython.pyx, line 60, the code is as following, cdef int *mutIndex= <int *>malloc(mutationN)

But I think it should be, cdef int mutIndex= <int >malloc(mutationNsizeof(int)) `cdef int mutIndex= <int >malloc(mutationNsizeof(int)) Question2: In the freeHiC_cython.pyx, line 70, the code is as following, mutI = np.random.choice(seqN, size = 3, replace = False)`

But the size number should be mutationN as you doesn't constraint the mutation number must be 3 or less.Therefore the modified code is, mutI = np.random.choice(seqN, size = mutationN, replace = False)

Do you think so?

yezhengSTAT commented 4 years ago

Hello there, Yes to both questions. For the first one, I cannot recall why I didn't multiply by the size of int for this function but did so for other functions......For the second one, originally I did want to set the maximum to be 3 but now there seems to be no strong reason to limit that. Thanks for such careful reviewing of the codes and thanks for bringing it up! Appreciate it! I have updated the repository accordingly.

Thanks, Ye

remember-past commented 4 years ago

Thanks for your prompt reply. By the way, I have sent you a email for some general questions about simulating Hi-C data. Looking forward to your reply.