BDI-pathogens / phyloscanner

Phylogenetics between and within hosts at once, all along the genome.
GNU General Public License v3.0
47 stars 14 forks source link

TypeError: object of type 'NoneType' has no len() #10

Closed damientully closed 7 years ago

damientully commented 7 years ago

Hi Chris,

I am having this problem running a few bam files and get the following error message:

Traceback (most recent call last):
  File "phyloscanner_make_trees.py", line 1302, in <module>
    ReadAsPseudoRead = pf.PseudoRead.InitFromRead(read)
  File "/Users/damientully/Downloads/phyloscanner-master/tools/phyloscanner_funcs.py", line 203, in InitFromRead
    len(read.query_qualities) > 0:
TypeError: object of type 'NoneType' has no len()

Any suggestions on what the source of this error could be?

Many thanks, Damien

ChrisHIV commented 7 years ago

Hi Damien, That's definitely my bad; it sounds like read quality information is missing for your read(s), I didn't know that was possible. Are you able to make a new bam or sam file containing just one read (or a few reads) to send to me for investigation? Running samtools view -h NameOfDamiensBam.bam | head > JustAFewReadsForChris.sam from the command line should do the trick. NB that will produce mapped reads in sam format (uncompressed bam), which you can open with a plain text editor (and e.g. change the bases in the sequence, if the sequence itself is sensitive information). You can copy-paste the contents of that sam file here, or email it to me... Cheers

damientully commented 7 years ago

Just emailed you a sample file! Thanks, D

ChrisHIV commented 7 years ago

Pull the code and try again :)

damientully commented 7 years ago

Seems to be working! Thanks.