raphael-group / NAIBR

Novel Adjacency Identification with Barcoded Reads
MIT License
13 stars 4 forks source link

unsupported operand type(s) #4

Open xingwu2 opened 7 years ago

xingwu2 commented 7 years ago

Hi,

I am running the NAIBR to find structure variants.

Here is the error I get from the program.

Traceback (most recent call last): File "NAIBR.py", line 6, in from get_reads import File "src/get_reads.py", line 3, in from utils import File "src/utils.py", line 1, in from global_vars import * File "src/global_vars.py", line 94, in lmin,lmax = estimate_lmin_lmax() File "src/global_vars.py", line 82, in estimate_lmin_lmax dist = mate_pairs[read.query_name][0]-read.reference_end TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'

Here is the config file I used for the program:

minimum mapping quality (default=40)

min_mapq=40

input bam file

bam_file=../../scratch60/10X/longranger_alignment/10X2W82/possorted_bam.bam

output directory (default=.)

outdir=10X2W82

list of intervals not to be intcluded in analysis (default=None)

blacklist=None

list in BEDPE format of novel adjacencies to be scored by NAIBR (default=None)

candidates=None

maximum distance between read-pairs in a linked-read (default=10000)

d=10000

minimum size of structural variant (default=lmax)

min_sv=1000

number of cores (default=1)

cores=18

minimum number of barcode overlaps supporting a candidate NA (default = 3)

k=3

Thanks.

Xing

relyanow commented 7 years ago

I pushed a fix to handle this exception. If other errors occur, send a line from your bam file. There might be an issue with the bam file format.

xingwu2 commented 7 years ago

The problem still exists.

Traceback (most recent call last): File "NAIBR.py", line 6, in from get_reads import File "src/get_reads.py", line 3, in from utils import File "src/utils.py", line 1, in from global_vars import * File "src/global_vars.py", line 98, in lmin,lmax = estimate_lmin_lmax() File "src/global_vars.py", line 80, in estimate_lmin_lmax dist = read.reference_start-mate_pairs[read.query_name][1] TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'

How can I send a line from the bam file? It is a binary file. Is this alright?

?BCE?V?o?L>???N? B"?'T$bߝ?wg?4M??$n?C%?u?&jcǥ??++ ???y?F?B??8?-???N???z?i)Nê?b??a??b"873?!zF?s?q$$??:7?2ad넘\&h???u???P?q)????$P&?L2 "n2*?@p?aP???Q?\'L???(9?&?ј?^r???X&??Ą#s?0F?̠:?e"K?3??%?t*'GYr?????y?%g??H??ptWb,?.?????-W?M?-??{?F?8[?????????p#?vB??[Pq?y?b?Ԡ"??|Ŧm?l{?^kT?g??J?a??x?X???B????tS???qi ?$r?[??h??b?V./????eg?e??+??C????*jhf?j????M?&v???Avg'?+?/?ڇ??????Q?Y?/??˥?:?=????uE\??? ???a???ש????p.?PT?A???(x??d?1p{?y?q?????????9B????>????? ???????7"??@o?\<?Wp ???W׶?J?w?D?0/~???^?X< ?BC?F?} ?lyY߹wk@??q\?3w??Y?w9?G??????L+?bd!???I?Jyg?Ķ??V0)?<0??????bR?RX??U F??X&Vi? ?Xc???u?????ɸ==}ο?J???}?W]??Oػ???Q????߆Gv??&Q???q?f??k????oţ8??Q???(???>矃??y??Y.&??d?\̖????d2?۝???r?Y?????N?F8[???dw?xK?_?ѽ???? ?A????.?}B???Ao?z ???r????????????3?߽?^??_4?z4y???8???W=}<?{?yf????U???8????:&O??8.?a??Iv4??jT??O?n??Ir?#?Uˣ?ʒ??i}G??0{?{??ό???oxL???{??g?y:?????s???????i????{j??T??q?L=???JF??oy?????^?????x?????g?????o?{??{??]?E???b??cww?z??y???????ǯv?N:??"?iYU??{??[?&???????ά???/n-?}`???I3Y,?]?5?]f??0GM?{?0????????$!1 =?q?JrP?E.???'?~? ?^?,?LG??@???N?7?d?<??$?9???s?x?U??aZ?$>J&?Q|7ɏ ޸$E?O@yM?"??۳O?L?{}8{z?3(z?P?{=??\???U\A?}??????W?Cz=z??~~D???d.?yZ ????B???>?o?O???\N?nz???u??p?7"??0???3?.@?W?-ηQ?O??yy???ȯv?3 B??????+???,???p?私|???~4t???ǭnAFq??(-?'??V?Y??M??h?@????:???aZ|??w?xm???Z?????{'??{?????Y??z?_??b??A?S??? q\?!?c???Ҁ$?mP??P?;u?m??e2??/??6j\?(???f?4n???(y?{ K?~??ҷh^g???Z?ua??m?'?"?p??L???fU?1? l??g?$y?,E??53 ?W??????x ???????oin_???>$???:?N?I'?x嵢?a?Y1_??q ??/??b$?z:Tj???0?U?"?o4??g???3E???????w{|?4?z']K??e^i???z[%?}io ??9?zjVdIJ?V??:?7???ߵ#??Ho??p????u???2??K??F???=8?????e??'Mӟ5a??ۂܳjǻ^yٺj?k-?lI|_?9?rÕ???@?b???????2?[q4|,)?:I?!??qMn? ?-??,O?!\?{E????Ӧa???_h??>ס:??C???e???g???~?V&#T&o'fz<??S?ۭL??????؛7}b????~?0l?m8?[??}????g?????m1 s??o?;?L???m?U???^.?"IZUe???Ȓ?,>ʐ???؍???1?B???3?P???:?Mf?#?g.Lf?ێ??W?ݹn???NR??L?r??U?}?3.????@???h??=?Ӱ@???+??&??j)?A????;GD??|???2@???9?G??/?? &L ??????4??TR+?nrb??!?sJ~?????M?G8J+??????|???U???6?:o{?3J ??p?ߡ??f?NH?ӗz?E??????ܲ@Z&7/??i?L.|???QB??????X??s? ?z!??/?M??yx????!.???$x??g?щ?;?ؗ??s?:?#????r?A&B1?B? a????%?:P?T?? --???El???Z?o?r?30??3?J4???IOLr:|,˫2M???h?d?'0X?? qt ?n?? (Zl? ?q??:?EQ?6"??ɝ?C?h??V??????Q%U4J?:??H?~"??0#??PP?C???? ????????O?Q?p?n?\??fgg%3)3?3[C?H?XG;???w?r?,ל???+?qjSB???DG??`$?L?sIw??c%1?(ܜ?Iw;??pAî??5??7??A?J?Ww:?q:J??ļg?x?m?à ?H?? ?|.?P=??G??a?Kn.??q6O?y?$H?Έ?aeQ\????a??Q???0?<???+ Պ?8M??D?sfp?˲"??@??ʏ??x??e?Fe?7@=?q^U?#?ћ??a?9?Z"@???7??VU??K????Jְ؋??~????Xd??,2aÓ??b???7?????? 㝴?ӳ?? ?|'j׶C;?:?#?IJ????y??z?j? 1?Ċ?k??"?u̅???H|zcr?????????PZ?9????8r~???W???????ݖ$??^?$????X????Y??n???#3Ҝ.?׵?n?ꆢ1?f?Wn??@?v7(ӑ??9?\???3?@???9?C?1 J???|????3? C??w? ??N?b?:)kT'???CBO9}??Ԋ?u???{?2?}??[A??[???????E??WU?>v&?ڶ???1??Q?F?d? ¹??T[?????\?}?P?EiW0?DH%??x??}m???ڊ?m?R??e???{?_?K8'u?d??)?x?&֨?3?L?SJրg??;Jඋs&?k??L???n???ܰH?B????? ?_)8???????{W?

relyanow commented 7 years ago

send the output of: samtools view [.bam file] | head

thanks!

xingwu2 commented 7 years ago

OK, here it is.

D00553R:140:H5GK5BCXY:1:1107:3498:40118 163 Chr01 1 13 13S29M108S = 220 308 TTTTGGGATTTGGGGTTTGGGGTTTGGTTTTTAGGTTTTAGGGTATAGGGTATAGGGTTTAGGATTAAGGGTTTTAAGGTTTAGGGTTTAGGCTGTTGGGGATTGGGGTGTGGGGTCTAGTGTTTATGGTTTGAAATGTAGGGTTTATGG AGAGGGGGGGGGGII<.GGGIIGAGGG<GGGGIGIGAGGGGGGGGGGGIIGAGGIIG<.<GAG.<<<.GGG<.<GG.<.<<<.<A<.<<A.....<.<G.A......<GGAAGAGA.....<.<<..<.<.G....<<<.<AA<<...<G NM:i:2 MD:Z:7T6G14AS:i:19 XS:i:24 XA:Z:Chr12,-8933,108S34M8S,2;Chr12,-1178,126S24M,1;Chr07,-9785257,123S22M5S,0;Chr09,+50184283,5S39M106S,4; RX:Z:CTCAACCTCCCTGAGG QX:Z:GAGGGGIIIIIIIIII BX:Z:CTCAACCTCCCTGAGG-1 BC:Z:GTAATCTT QT:Z:GGGGGIII RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 D00553R:140:H5GK5BCXY:1:1103:8560:53788 161 Chr01 1 43 87S63M = 44614888 44614943 CCCCGGTTTCGTCAACTAACACGTAAAAACAATGCCTGAAAATTAAGGCATTTAGAGGTGTTTTAGGGTTTATGGTTTAGGGTTTGAGGTTTGGGGTTTGGGTTTTAGGTTTTAGGTTTTAGGTTTTACGGTTTAGGGTTTAGGGGTTAT GGGGGIGIIGIIAGIIIIIIIIIIIIIIGIIIIGGIIIGGGIIIIGGGGGGGIGGAGGGGGGGIIIIIIGGIIIIGGGIGIGGGGIGGA...<.AAGG<GGAGGG<GGGGGGGIGGG.<GGGAG..AAGGGGGGAGGG<<.<GGA.<<.G NM:i:3 MD:Z:7T47T2T4 AS:i:50 XS:i:34 SA:Z:Chr01,485,+,37M5D21M2D1M1I25M65S,27,10; RX:Z:GTTCCGTAGACCCTGC QX:Z:GGGGGIIIGIIIIIGI BX:Z:GTTCCGTAGACCCTGC-1 BC:Z:GTAATCTT QT:Z:GGGGGIIG RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 MI:i:129 D00553R:140:H5GK5BCXY:1:1103:15895:90743 99 Chr01 1 45 21S24M7I75M = 303 362 GGTTTAGGGTTTAGGGTTTAGGGTTTGGTGTTTGGGTTTTAGGTTTTAGGTGTTAGGTTTTAGGTTTTACGGTTTAGGGTTTATGGTTTAGGGTTTAGGGTTTAGGGTTAGGAAATAATTTGGGTCT AGG<<GGGGAGGIGIIAAGGGGGGA.GGAA..GAGGGGAAGGGGGAGGGI<G.<<GAAA...AG.AGAAG<G.<AGGGG<..GAAG.GGGGGG..GGAGG.<AAGGGGGAGGAAAAAAAA..<GGAA NM:i:8 MD:Z:62T36 AS:i:81 XS:i:59 RX:Z:CACTTTATCACGCGGT QX:Z:GGGGGGGIIIGIIIG< BX:Z:CACTTTATCACGCGGT-1 BC:Z:GTAATCTT QT:Z:GGGGGIIG TR:Z:GTTTTAG TQ:Z:AGGGGIG RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 MI:i:47 D00553R:140:H5GK5BCXY:1:1104:6625:17740 385 Chr01 1 60 80H70M = 565 565 GGTTTGGGGTTTGGGTTTTAGGTTTTAGGTTTTAGGTTTTACGGTTTAGGGTTTAGGGTTTATGGTTTAT IIIIGIIIIIGIIIIIGIIIIGGIIGIIIGGIGGIIGIIIIIIIIGGGGAGGAGGGGGGGGGGGAGGGII NM:i:3 MD:Z:7T47T13G0 AS:i:59 XS:i:33 SA:Z:Chr01,85,+,107M43S,60,7; RX:Z:TCCGTCAGTGACCCGT QX:Z:GGGGGGIIIIIGIIIG BX:Z:TCCGTCAGTGACCCGT-1 BC:Z:GTAATCTT QT:Z:GGGGGIII RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 MI:i:153 D00553R:140:H5GK5BCXY:1:1106:10266:36855 163 Chr01 1 40 19S29M102S = 218 290 GAGATGTTTTGGGATTTGGGGTTTGGGGTTTGGTTTTTAGGTTTTAGGGTATAGGGTTTAGGGTTTTTGGGTTAAGGGTGTAGGGTTTTAGGGTTTACAAAGAATTTTGGGTGTTTAACCTTTCAACACAAAATTAAGTCATTTGGAGGC GGGGAGGGGIGIIGGGIIIIIGGGIGIIGGGII.<GGGGGGAG.GGGIIG<GGGGGGAGGGGG.........<..<..<..<<<A..<<<AAA.GA..<G.<.<AAA.G.G.AAGG......<.<...<<A.A..<<A.<...<..<<.. NM:i:2 MD:Z:7T6G14 AS:i:19 XS:i:24 XA:Z:Chr12,-8933,102S34M14S,2;Chr12,-1178,120S23M7S,0;Chr07,-9785257,117S22M11S,0; RX:Z:ACACCAACAAGACACG QX:Z:GGGGGIGIIIIIIIII BX:Z:ACACCAACAAGACACG-1 BC:Z:GTAATCTT QT:Z:GGGGGIII RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 MI:i:5 D00553R:140:H5GK5BCXY:1:1109:15939:36595 163 Chr01 1 60 24S24M7I95M = 239 364 TAGGGTTTAGGGTTTAGGGTTTAGGGTTTGGTGTTTGGGTTTTAGGTTTTAGGTGTTAGGTTTTAGGTTTTACGGTTTAGGGTTTATGGTTTAGGGTTTAGGGTTTAGGGTTAGGAAATAATTTGGGTCTTTCATCTTTCAACAAAAAAT GGGAA<AAGGGGGIGIIIIGGGGGGIGGGAGGGGGAGGIIIGAGGGGGGG<GGGIIIGIGGAAGGGGAGAGGGIGGGGAGGIGGIIGGGGGGGGGIAGGAAGGGGGAGAGGIGIGGGGGGGIIGGGGGGGGIIGIIIGIGAGIIIIIIGG NM:i:8 MD:Z:62T56 AS:i:101 XS:i:62 SA:Z:Chr02,22644161,+,31M119S,0,0; RX:Z:AGTGGGAGTATGCCTA QX:Z:GGGGGGIIIGIIIIII BX:Z:AGTGGGAGTATGCCTA-1 BC:Z:GTAATCTT QT:Z:GGGGGIII RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 MI:i:29 D00553R:140:H5GK5BCXY:1:1109:14829:37009 163 Chr01 1 54 81S69M = 220 260 TTTCGTCAACTAACACGTAAAAACAATGCCTGAAAATTAAGGCATTTAGAGGTGTTTTAGGGTTTATGGTTTAGGGTTTGAGGTTTGGGGTTTGGGTTTTAGGTTTTAGGTTTTAGGTTTTACGGTTTAGGGTTTAGGGTTTATGGTTTA GGAAGGIIIIIIIGGIGIIGIIIIGIIIIIIIIGIIGIIGIIIIIIIIIGIGGGGGAGGGII..AGGGGGGGGGGG<GGGIGG<<GGGAG<AAGGA.<<GG<G<.GAGGGG..G<GGG.GGGAG<G.G.AGGGG<GGGGGG.G.GGGGGG NM:i:2 MD:Z:7T47T1AS:i:59 XS:i:39 SA:Z:Chr01,491,+,31M5D21M2D1M1I25M71S,20,10; RX:Z:GCTCTGTCATCTGTAG QX:Z:GGGGGIGIIIIIGGII BX:Z:GCTCTGTCATCTGTAG-1 BC:Z:GTAATCTT QT:Z:GGAGGIII RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 MI:i:107 D00553R:140:H5GK5BCXY:1:1109:7914:47012 99 Chr01 1 3 79S29M19S = 523 574 AGTCACTAACTCCCCTTAGTCACTTTCTCTTCCGATCTTAGAGAAAGTGACTAATATTTAGAGGCGTTTTGGGATTTGGGGTTTGGGGTTTGGTTTTTAGGTTTTAGGGTATAGGGTTTAGGGTTTT IIIIIIGIIIIIIIIIIIIGIIIIIIIIIIIIIIGIIIIIIGIIIIIIIIIIIIIIIIIIIGGIIIGGIIIGIGGIIGGGIAAGGGIIGGIGIGGGIIIIIGGIIIIIGGGGGGIIGGGIGIIGGGG NM:i:2 MD:Z:7T6G14 AS:i:19 XS:i:24 XA:Z:Chr12,-8933,19S34M74S,2;Chr12,-1178,37S23M67S,0;Chr07,-9785257,34S22M71S,0;Chr10,+2639237,65S19M43S,0;Chr02,-14844539,43S19M65S,0; RX:Z:TAGAGAAAGTGACTAA QX:Z:GGGGGGIIIIIIIIII BX:Z:TAGAGAAAGTGACTAA-1 BC:Z:GTAATCTT QT:Z:GGGGGIII TR:Z:ATGCATT TQ:Z:IIIIIII RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 D00553R:140:H5GK5BCXY:1:1109:10190:66151 97 Chr01 1 58 68S59M Chr12 25318664 0 CACGTAAAAACAATGCCTGAAAATTAAGGCATTTAGAGGTGTTTTAGGGTTTATGGTTTAGGGTTTGAGGTTTGGGGTTTGGGTTTTAGGTTTTAGGTTTTAGGTTTTACGGTTTAGGGTTTAGGGT IIIGGIIIIIIIIIIIIIGIIIIIIGGIGIIGGIIGGGGGGGGGIGGGIGGIIIIIGGIIIIIGGGIGGIGGIIIIIAGGIIIGGGIIGGAAGGIGGGGGGIGGAAGGGAGGGGGGGGGGGAGGGGG NM:i:2 MD:Z:7T47T3 AS:i:50 XS:i:30 SA:Z:Chr04,52388722,+,42S41M44S,2,2; RX:Z:TCAGGATGTTTCCATT QX:Z:AGGGGIIIIIIIIIII BX:Z:TCAGGATGTTTCCATT-1 BC:Z:GTAATCTT QT:Z:GGGGGIII TR:Z:CAACTAA TQ:Z:IIIIIII RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 MI:i:147 D00553R:140:H5GK5BCXY:1:1111:17287:5781 99 Chr01 1 37 11S24M7I30M55S = 16 81 TTAGGGTTTAGGGTTTGGTGTTTGGGTTTTAGGTTTTAGGTGTTAGGTTTTAGGTTTTACGGTTTAGGGTTTTCGGGTTTGGGGGTTTAGGGTTTAGGGTTTAGTGTTTGAGGTTGGGGGGTTTGGA GGIIIIGGGIIIGGGGGIGGGGGGIIAGGIGGIGGGGIIIGGGGGIGGGGGIIIGGGGIIIIGGGIIIGGGAGGGGGGGGGGIGIAGGGGIIGGGIGIGGAGGGAG<AGGGGGIGGGGGGI<G<GGG NM:i:7 MD:Z:54 AS:i:41 XS:i:26 RX:Z:CTACCTGGTCCAGTGC QX:Z:GGGGGGGGGGIIIIGI BX:Z:CTACCTGGTCCAGTGC-1 BC:Z:GTAATCTT QT:Z:GGGGGIII TR:Z:TTAGGGT TQ:Z:GIIGIIG RG:Z:10X2W82:LibraryNotSpecified:1:unknown_fc:0 MI:i:78

xingwu2 commented 7 years ago

Have you had a fix for this yet?

relyanow commented 7 years ago

Sorry for the late reply. The error appears to be that the program is either filtering your reads out due to unexpected formatting or that your reads don't have the 'reference_end' tag, unfortunately I haven't been able to replicate your error so I can't pin down exactly how to fix the issue. One thing I noticed is that it looks like your data isn't phased, which might be causing the problem. Can you check if any of your reads have the 'HP' tag (which will contains the phasing information). You can run "samtools view [.bam file] | grep 'HP'". If your data isn't phased, you can run longranger to add the phasing info.

xingwu2 commented 7 years ago

Not a problem. I wonder which longranger did you use? I used the latest version, would that be a problem?

relyanow commented 7 years ago

I don't think that would be an issue, I've tested it using the most recent version.