B-UMMI / chewBBACA

BSR-Based Allele Calling Algorithm
GNU General Public License v3.0
134 stars 28 forks source link

AttributeError: 'NoneType' object has no attribute 'seq' #164

Closed famiji closed 1 year ago

famiji commented 1 year ago
 Package                         Version  Build                Channel                                                                Size
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  Install:
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

  + _libgcc_mutex                     0.1  conda_forge          mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + _openmp_mutex                     4.5  2_gnu                mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + biopython                        1.81  py311h2582759_0      mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64        3MB
  + blast                          2.13.0  hf3cf87c_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + brotlipy                        0.7.0  py311hd4cff14_1005   mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64      354kB
  + bzip2                           1.0.8  h7f98852_4           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + c-ares                         1.18.1  h7f98852_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + ca-certificates             2022.12.7  ha878542_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + certifi                     2022.12.7  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + cffi                           1.15.1  py311h409f033_3      mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64      296kB
  + charset-normalizer              2.1.1  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + chewbbaca                       3.1.0  pyhdfd78af_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch             5MB
  + clustalw                          2.1  h9f5acd7_7           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + cryptography                   39.0.2  py311h9b4c7bb_0      mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64        2MB
  + curl                           7.88.1  hdc1c0ab_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64       88kB
  + entrez-direct                    16.2  he881be0_1           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + gettext                        0.21.1  h27087fc_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + html5lib                          1.1  pyh9f0ad1d_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch         91kB
  + idna                              3.4  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + importlib-metadata              6.0.0  pyha770c72_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch         25kB
  + isodate                         0.6.1  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch         29kB
  + keyutils                        1.6.1  h166bdaf_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + krb5                           1.20.1  h81ceb04_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64        1MB
  + ld_impl_linux-64                 2.40  h41732ed_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libblas                         3.9.0  16_linux64_openblas  mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libcblas                        3.9.0  16_linux64_openblas  mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libcurl                        7.88.1  hdc1c0ab_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64      358kB
  + libedit                  3.1.20191231  he28a2e2_2           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libev                            4.33  h516909a_1           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libffi                          3.4.2  h7f98852_5           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libgcc-ng                      12.2.0  h65d4601_19          mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libgfortran-ng                 12.2.0  h69a702a_19          mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libgfortran5                   12.2.0  h337968e_19          mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libgomp                        12.2.0  h65d4601_19          mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libidn2                         2.3.4  h166bdaf_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + liblapack                       3.9.0  16_linux64_openblas  mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libnghttp2                     1.52.0  h61bc06f_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64      622kB
  + libnsl                          2.0.0  h7f98852_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libopenblas                    0.3.21  pthreads_h78a6416_3  mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libsqlite                      3.40.0  h753d276_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libssh2                        1.10.0  hf14f497_3           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64      239kB
  + libstdcxx-ng                   12.2.0  h46fd767_19          mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libunistring                   0.9.10  h7f98852_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libuuid                        2.32.1  h7f98852_1000        mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + libzlib                        1.2.13  h166bdaf_4           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + mafft                           7.515  hec16e2b_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64           3MB
  + ncurses                           6.3  h27087fc_1           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + numpy                          1.24.2  py311h8e6699e_0      mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64        8MB
  + openssl                         3.0.8  h0b41bf4_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64        3MB
  + packaging                        23.0  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + pandas                          1.5.3  py311h2872171_0      mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64       14MB
  + pcre                             8.45  h9c3ff4c_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + perl                           5.32.1  2_h7f98852_perl5     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + perl-archive-tar                 2.40  pl5321hdfd78af_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + perl-carp                        1.38  pl5321hdfd78af_4     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + perl-common-sense                3.75  pl5321hdfd78af_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + perl-compress-raw-bzip2         2.201  pl5321h87f3376_1     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + perl-compress-raw-zlib          2.105  pl5321h87f3376_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + perl-encode                      3.19  pl5321hec16e2b_1     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + perl-exporter                    5.72  pl5321hdfd78af_2     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + perl-exporter-tiny           1.002002  pl5321hdfd78af_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + perl-extutils-makemaker          7.66  pl5321hd8ed1ab_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + perl-io-compress                2.201  pl5321h87f3376_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + perl-io-zlib                     1.14  pl5321hdfd78af_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + perl-json                        4.10  pl5321hdfd78af_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + perl-json-xs                     2.34  pl5321h9f5acd7_5     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + perl-list-moreutils             0.430  pl5321hdfd78af_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + perl-list-moreutils-xs          0.430  pl5321hec16e2b_1     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + perl-parent                     0.236  pl5321hdfd78af_2     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + perl-pathtools                   3.75  pl5321hec16e2b_3     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + perl-scalar-list-utils           1.62  pl5321hec16e2b_1     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64        Cached
  + perl-types-serialiser            1.01  pl5321hdfd78af_0     mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch          Cached
  + pip                            23.0.1  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + platformdirs                    3.1.0  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + plotly                         5.13.1  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch          6MB
  + pooch                           1.7.0  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + prodigal                        2.6.3  hec16e2b_4           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64         795kB
  + pycparser                        2.21  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + pyopenssl                      23.0.0  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + pyparsing                       3.0.9  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + pysocks                         1.7.1  pyha2e5f31_6         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + python                         3.11.0  he550d4f_1_cpython   mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64       31MB
  + python-dateutil                 2.8.2  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + python_abi                       3.11  3_cp311              mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64        6kB
  + pytz                         2022.7.1  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + rdflib                          6.2.0  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch          3MB
  + readline                        8.1.2  h0f457ee_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + requests                       2.28.2  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + scipy                          1.10.1  py311h8e6699e_0      mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64       26MB
  + setuptools                     67.6.0  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch        579kB
  + six                            1.16.0  pyh6c4a22f_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + sparqlwrapper                   2.0.0  pyha770c72_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch         29kB
  + tenacity                        8.2.2  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch         22kB
  + tk                             8.6.12  h27826a3_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + typing-extensions               4.4.0  hd8ed1ab_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + typing_extensions               4.4.0  pyha770c72_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + tzdata                          2022g  h191b570_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch        108kB
  + urllib3                       1.26.14  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + webencodings                    0.5.1  py_1                 mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch         12kB
  + wget                           1.20.3  ha35d2d1_1           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64      835kB
  + wheel                          0.38.4  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + xz                              5.2.6  h166bdaf_0           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     Cached
  + zipp                           3.15.0  pyhd8ed1ab_0         mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch       Cached
  + zlib                           1.2.13  h166bdaf_4           mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64     `Cached`
(chewie2) fmj@qood:~$ chewBBACA.py AlleleCall -i /mnt/c/users/26537/desktop/papercpmlst -g /mnt/c/users/26537/desktop/cpmlst/cpcgmlst -o /mnt/c/users/26537/desktop/cpmlst/result --ptf /mnt/c/users/26537/desktop/cpmlst/ATCC13124.trn --cpu 2 --force

chewBBACA version: 3.1.0
Authors: Mickael Silva, Pedro Cerqueira, Rafael Mamede
Github: https://github.com/B-UMMI/chewBBACA
Documentation: https://chewbbaca.readthedocs.io/en/latest/index.html
Contacts: imm-bioinfo@medicina.ulisboa.pt

==========================
  chewBBACA - AlleleCall
==========================
Started at: 2023-03-10T20:54:27

Output directory exists. Will store results in /mnt/c/users/26537/desktop/cpmlst/result/results_20230310T205427.
Minimum sequence length: 0
Size threshold: 0.2
Translation table: 11
BLAST Score Ratio: 0.6
Word size: 5
Window size: 5
Clustering similarity: 0.2
Prodigal training file: /mnt/c/users/26537/desktop/cpmlst/ATCC13124.trn
CPU cores: 2
BLAST path: /home/fmj/miniconda3/envs/chewie2/bin
CDS input: False
Prodigal mode: single
Mode: 4
Number of inputs: 158
Number of loci: 1431

== CDS prediction ==

Predicting CDS for 158 inputs...
 [====================] 100%

== CDS extraction ==

Extracting predicted CDS for 158 inputs...
 [====================] 100%
Extracted a total of 480070 CDS from 158 inputs.

== CDS deduplication ==

Identifying distinct CDS...identified 176116 distinct CDS.

== CDS exact matches ==

Searching for DNA exact matches...found 198392 exact matches (matching 53264 distinct alleles).
Unclassified CDS: 122852

== CDS translation ==

Translating 122852 CDS...
 [====================] 100%
Identified 581 CDS that could not be translated.
Information about untranslatable and small sequences stored in /mnt/c/users/26537/desktop/cpmlst/result/results_20230310T205427/temp/invalid_cds.txt
Unclassified CDS: 122271

== Protein deduplication ==

Identifying distinct proteins...identified 97191 distinct proteins.

== Protein exact matches ==

Searching for Protein exact matches...found 3915 exact matches (6068 distinct CDS, 7203 total CDS).
Unclassified proteins: 93276

== Clustering ==

Translating schema's representative alleles...done.
Creating minimizer index for representative alleles...done.
Created index with 120575 distinct minimizers for 1431 loci.
Clustering proteins...
 [====================] 100%
Clustered 93276 proteins into 1376 clusters.
Clusters to BLAST: 1376
 [====================] 100%
Classifying clustered proteins...
 [====================] 100%
Classified 8674 distinct proteins.
Unclassified proteins: 84602

== Representative determination ==

Iteration 1
===========
Loci: 1431
BLASTing loci representatives against unclassified proteins...done.
Traceback (most recent call last):
  File "/home/fmj/miniconda3/envs/chewie2/bin/chewBBACA.py", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/fmj/miniconda3/envs/chewie2/lib/python3.11/site-packages/CHEWBBACA/chewBBACA.py", line 1584, in main
    functions_info[process][1]()
  File "/home/fmj/miniconda3/envs/chewie2/lib/python3.11/site-packages/CHEWBBACA/utils/process_datetime.py", line 146, in wrapper
    func(*args, **kwargs)
  File "/home/fmj/miniconda3/envs/chewie2/lib/python3.11/site-packages/CHEWBBACA/chewBBACA.py", line 514, in allele_call
    AlleleCall.main(genome_list, loci_list, args.schema_directory,
  File "/home/fmj/miniconda3/envs/chewie2/lib/python3.11/site-packages/CHEWBBACA/AlleleCall/AlleleCall.py", line 2671, in main
    results = allele_calling(input_files, schema_directory, temp_directory,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fmj/miniconda3/envs/chewie2/lib/python3.11/site-packages/CHEWBBACA/AlleleCall/AlleleCall.py", line 2464, in allele_calling
    locus_results = expand_matches(match_info, prot_index, dna_index,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fmj/miniconda3/envs/chewie2/lib/python3.11/site-packages/CHEWBBACA/AlleleCall/AlleleCall.py", line 1388, in expand_matches
    target_protein = str(pfasta_index.get(target_id).seq)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'seq'
famiji commented 1 year ago

when i try to AlleleCall , there is a error.the information is listed above.

rfm-targa commented 1 year ago

Hello @famiji,

The error you're getting indicates that there is a sequence missing from a FASTA file. It's trying to get the sequence based on the sequence identifier. Strangely, it cannot retrieve a sequence already read in previous steps of the process. Please retry after downgrading BLAST to v2.9 and updating chewBBACA to v3.1.2. If the error persists after that, I suggest you recreate the schema and retry the allele calling. If that doesn't solve the issue, could you send us the schema and the input files to test and find the cause?

Best regards,

Rafael

famiji commented 1 year ago

I downgrade BLAST to v2.9 and successed. Thakns for your patient reply.

Nilad commented 1 year ago

Have same error with chewBBACA version: 3.1.2 and blast 2.12.0, build Mar 8 2022 16:19:08.

Error solved with downgrade of BLAST to v2.9.0

rfm-targa commented 1 year ago

Hello @Nilad,

Thank you for reporting that. We'll try to look into why BLAST 2.12 is leading to this issue and include a fix in one of the next releases.

Kind regards,

Rafael