virajbdeshpande / AmpliconArchitect

AmpliconArchitect (AA) is a tool to identify one or more connected genomic regions which have simultaneous copy number amplification and elucidates the architecture of the amplicon. In the current version, AA takes as input next generation sequencing reads (paired-end Illumina reads) mapped to the hg19/GRCh37 reference sequence and one or more regions of interest. Please "watch" this repository for improvements in runtime, accuracy and annotations for GRCh38 human reference genome coming up soon.
Other
135 stars 43 forks source link

an error: TypeError: 'NoneType' object is not iterable #34

Closed wisekh6 closed 5 years ago

wisekh6 commented 5 years ago

Hi Viraj,

I have been using your (probably) latest version that I downloaded on 11/06/2018, but I have the following error. Can you guide me about how to avoid it?

Thank you in advance,

Hoon

[root:INFO]     #TIME 614.197   Exploring interval: 4   55561066        55619978
/projects/anaconda/v4.2.0/lib/python2.7/site-packages/numpy/core/fromnumeric.py:3146: RuntimeWarning: Degrees of freedom <= 0 for slice
  **kwargs)
/projects/anaconda/v4.2.0/lib/python2.7/site-packages/numpy/core/_methods.py:127: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
[root:INFO]     #TIME 684.177   Exploring interval: 4   55893315        56621993
[root:INFO]     #TIME 1530.906  Exploring interval: 9   4714055 5161571
[root:INFO]     #TIME 1701.453  Exploring interval: 9   5349307 5861604
[root:INFO]     #TIME 2657.593  Exploring interval: 9   72658279        141011744
Traceback (most recent call last):
  File "/projects/kimh/AmpliconArchitect/src/src20181106/AmpliconArchitect/src/AmpliconArchitect.py", line 192, in <module>
    ilist = bamFileb2b.interval_hops(ird)
  File "/projects/kimh/AmpliconArchitect/src/src20181106/AmpliconArchitect/src/bam_to_breakpoint.py", line 1524, in interval_hops
    icn = self.interval_neighbors(ic, clist, gcc=gcc)
  File "/projects/kimh/AmpliconArchitect/src/src20181106/AmpliconArchitect/src/bam_to_breakpoint.py", line 1477, in interval_neighbors
    n = self.interval_extend(hg.interval(edges[ei][0].v2.chrom, edges[ei][0].v2.pos, min(hg.chrLen[hg.chrNum(edges[ei][0].v2.chrom)] - 1, edges[ei][0].v2.pos + self.max_insert)))
  File "/projects/kimh/AmpliconArchitect/src/src20181106/AmpliconArchitect/src/bam_to_breakpoint.py", line 1635, in interval_extend
    elif self.interval_amplified(hg.interval(ic.chrom, ic.start - left_size * ms_window_size, ic.start), filter_small=False):
  File "/projects/kimh/AmpliconArchitect/src/src20181106/AmpliconArchitect/src/bam_to_breakpoint.py", line 1579, in interval_amplified
    elif filter_small == False and i.size() < 2 * ms_window_size and len(self.interval_discordant_edges(i)) >= 2:
  File "/projects/kimh/AmpliconArchitect/src/src20181106/AmpliconArchitect/src/bam_to_breakpoint.py", line 1302, in interval_discordant_edges
    bre_refine = self.refine_discordant_edge(breakpoint_edge(bp1, bp2))
  File "/projects/kimh/AmpliconArchitect/src/src20181106/AmpliconArchitect/src/bam_to_breakpoint.py", line 853, in refine_discordant_edge
    for a1c in a1.cigartuples:
TypeError: 'NoneType' object is not iterable
virajbdeshpande commented 5 years ago

Hello Hoon, Thanks for reporting the error. It seems like AA failed to catch an unaligned read and tried to interpret the CIGAR string for the read. Such a read-pair is not normally expected in the bam file, but I will push a code change with an additional sanity check and we can see if that fixes the error.