Routh-Lab / ViReMaMinimap2

Docker file for a version of ViReMa that can use minimap2
0 stars 0 forks source link

Error with Find CuttingSitesFromCigar #1

Open jayeung12 opened 2 years ago

jayeung12 commented 2 years ago

erro1

Throws an Index Error if variable i is allowed to increment.

If an if statement is added ("if i > np.size(cfg.RefsLib1_CuttingSites[Ref], 0)-1:"), the code will run to completion and produce an output.

I believe adding this if statement changes the CIGAR length for some of the mappings in the SAM, however. Consequently, PICARD cannot open the SAM files produced due to a mismatch between CIGAR length and the sequence length in the file.

jayeung12 commented 1 year ago

To clarify the above output, this is coming from "def FindCuttingSitesfromCIGAR(Cigar, Start, MinSegmentLength, Ref):" in Compiler_Module.py

The relevant bit of code that throws the error is below:

Sites = Sites * Mask
    for i in Sites:
        #*CHANGE*
        #If statement fixes the bug but not sure functional implications
        #print(i)
        #print('size:' + np.size(cfg.RefsLib1_CuttingSites[Ref], 0))
        #if i > np.size(cfg.RefsLib1_CuttingSites[Ref], 0)-1:
        #    pass
        #else:
        cfg.RefsLib1_CuttingSites[Ref][i] += 1