kfuku52 / amalgkit

RNA-seq data amalgamation for a large-scale evolutionary transcriptomics
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

AttributeError: 'NoneType' object has no attribute 'decode' #47

Closed kfuku52 closed 3 years ago

kfuku52 commented 3 years ago

I'll fix this.

[quant] fragment length distribution is truncated gaussian with mean = 200, sd = 20
[index] k-mer length: 31
[index] number of targets: 23,471
[index] number of k-mers: 18,099,550
[index] number of equivalence classes: 37,507
[quant] running in single-end mode
[quant] will process file 1: /lustre6/home/lustre1/kfuku/my_project/daniel_friedman/20210402_amalgkit/amalgkit_out/getfastq/SRR1036398/SRR1036398.amalgkit.fastq.gz
[quant] finding pseudoalignments for the reads ... done
[quant] processed 11,911,736 reads, 0 reads pseudoaligned
[~warn] no reads pseudoaligned.
[   em] quantifying the abundances ... done
[   em] the Expectation-Maximization algorithm ran for 52 rounds
[~warn] Warning, zero reads pseudoaligned check your input files and index

Traceback (most recent call last):
  File "/home/kfuku/.pyenv/versions/miniconda3-4.3.30/bin/amalgkit", line 326, in <module>
    args.handler(args)
  File "/home/kfuku/.pyenv/versions/miniconda3-4.3.30/bin/amalgkit", line 43, in command_quant
    quant_main(args)
  File "/home/kfuku/.pyenv/versions/miniconda3-4.3.30/lib/python3.8/site-packages/amalgkit/quant.py", line 106, in quant_main
    call_kallisto(args, in_files, metadata,sra_id,output_dir,index)
  File "/home/kfuku/.pyenv/versions/miniconda3-4.3.30/lib/python3.8/site-packages/amalgkit/quant.py", line 58, in call_kallisto
    assert (kallisto_out.returncode == 0), "kallisto did not finish safely: {}".format(kallisto_out.stdout.decode('utf8'))
AttributeError: 'NoneType' object has no attribute 'decode'
kfuku52 commented 3 years ago

Fixed in https://github.com/kfuku52/amalgkit/commit/92ba223b5b5ddc1b70c1e069d8491bd842aac0fe

kfuku52 commented 3 years ago

Currently, amalgkit quant fails with AssertionError: kallisto did not finish safely. when no reads are mapped to the reference genome. However, this behaviour prevents amalgkit quant from removing .fastq files of useless SRA data. So, rather than throwing an error there, an empty, placeholder output should be created.

kfuku52 commented 3 years ago

kallisto generates empty outputs already, so I just removed an assertion check, so that quant correctly finishes even with no mapped reads. https://github.com/kfuku52/amalgkit/commit/d7e6a23ed4afc4016b5b7b77dabbe17309a5a4b7