taxprofiler / taxpasta

TAXnomic Profile Aggregation and STAndardisation
https://taxpasta.readthedocs.io/
Apache License 2.0
31 stars 6 forks source link

[BUG] Adding taxon names to the output fails #137

Closed SannaAb closed 9 months ago

SannaAb commented 9 months ago

Is there an existing issue for this?

Problem description

Hi, thank you for a great tool!

I am getting: AttributeError: 'DataFrame' object has no attribute 'name' error when trying to merge reports from taxprofiler (kraken2, bracken, diamond). When i run without the add parameters it works. It have been testing on both the same reports from the older version of taxprofiler 1.0.1 and the new 1.1.0 but i get the same error. It might to be linked to the update of taxpasta as version 0.3.0 worked for me before i updated it.

Thank you for the help!

Code sample

Code run:

taxpasta merge -p diamond -o diamond_Diamond_230321.tsv --taxonomy /medstore/databases/taxprofiler/databases/taxpasta_taxonomy/taxdump --ignore-errors --add-id-lineage --add-lineage --add-name --add-rank --add-rank-lineage  KV23-5721-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond.tsv KV19-4396-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond.tsv KV19-4396-neg-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond.tsv KV19-4396-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond.tsv KV23-5721-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond.tsv KV20-1130-posEV-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond.tsv KV19-4396-neg-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond.tsv KV23-5721-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond.tsv KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond.tsv

Traceback:

[09:47:34] WARNING  The merged profiles contained different taxa. Additional zeroes were    sample_handling_application.py:142
                    introduced for missing taxa.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/xabras/.conda/envs/TaxPasta/lib/python3.11/site-packages/taxpasta/infrastructure/cli/merge │
│ .py:451 in merge                                                                                 │
│                                                                                                  │
│   448 │   result = handling_app.merge_samples(samples, wide_format)                              │
│   449 │                                                                                          │
│   450 │   if valid_output_format is not WideObservationTableFileFormat.BIOM:                     │
│ ❱ 451 │   │   result = command.execute(result)                                                   │
│   452 │                                                                                          │
│   453 │   logger.info("Write result to '%s'.", str(output))                                      │
│   454 │   if wide_format:                                                                        │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │        add_id_lineage = True                                                                 │ │
│ │           add_lineage = True                                                                 │ │
│ │              add_name = True                                                                 │ │
│ │              add_rank = True                                                                 │ │
│ │      add_rank_lineage = True                                                                 │ │
│ │               command = AddTaxInfoCommand(                                                   │ │
│ │                         │                                                                    │ │
│ │                         taxonomy_service=<taxpasta.infrastructure.domain.service.taxopy_tax… │ │
│ │                         object at 0x7f9e7a14a990>,                                           │ │
│ │                         │   summarise_at=None,                                               │ │
│ │                         │   add_name=True,                                                   │ │
│ │                         │   add_rank=True,                                                   │ │
│ │                         │   add_lineage=True,                                                │ │
│ │                         │   add_id_lineage=True,                                             │ │
│ │                         │   add_rank_lineage=True                                            │ │
│ │                         )                                                                    │ │
│ │                  data = [                                                                    │ │
│ │                         │   (                                                                │ │
│ │                         │   │                                                                │ │
│ │                         'KV23-5721-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.di… │ │
│ │                         │   │                                                                │ │
│ │                         PosixPath('KV23-5721-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond… │ │
│ │                         │   ),                                                               │ │
│ │                         │   (                                                                │ │
│ │                         │   │                                                                │ │
│ │                         'KV19-4396-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_23032… │ │
│ │                         │   │                                                                │ │
│ │                         PosixPath('KV19-4396-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │   ),                                                               │ │
│ │                         │   (                                                                │ │
│ │                         │   │                                                                │ │
│ │                         'KV19-4396-neg-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_23032… │ │
│ │                         │   │                                                                │ │
│ │                         PosixPath('KV19-4396-neg-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │   ),                                                               │ │
│ │                         │   (                                                                │ │
│ │                         │   │                                                                │ │
│ │                         'KV19-4396-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_23032… │ │
│ │                         │   │                                                                │ │
│ │                         PosixPath('KV19-4396-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │   ),                                                               │ │
│ │                         │   (                                                                │ │
│ │                         │   │                                                                │ │
│ │                         'KV23-5721-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_23032… │ │
│ │                         │   │                                                                │ │
│ │                         PosixPath('KV23-5721-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │   ),                                                               │ │
│ │                         │   (                                                                │ │
│ │                         │   │                                                                │ │
│ │                         'KV20-1130-posEV-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230… │ │
│ │                         │   │                                                                │ │
│ │                         PosixPath('KV20-1130-posEV-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_D… │ │
│ │                         │   ),                                                               │ │
│ │                         │   (                                                                │ │
│ │                         │   │                                                                │ │
│ │                         'KV19-4396-neg-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_23032… │ │
│ │                         │   │                                                                │ │
│ │                         PosixPath('KV19-4396-neg-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │   ),                                                               │ │
│ │                         │   (                                                                │ │
│ │                         │   │                                                                │ │
│ │                         'KV23-5721-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_23032… │ │
│ │                         │   │                                                                │ │
│ │                         PosixPath('KV23-5721-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │   ),                                                               │ │
│ │                         │   (                                                                │ │
│ │                         │   │                                                                │ │
│ │                         'KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.di… │ │
│ │                         │   │                                                                │ │
│ │                         PosixPath('KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond… │ │
│ │                         │   )                                                                │ │
│ │                         ]                                                                    │ │
│ │          handling_app = <taxpasta.application.sample_handling_application.SampleHandlingApp… │ │
│ │                         object at 0x7f9e7a123790>                                            │ │
│ │         ignore_errors = True                                                                 │ │
│ │                  name = 'KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.di… │ │
│ │                output = PosixPath('diamond_Diamond_230321.tsv')                              │ │
│ │         output_format = None                                                                 │ │
│ │               profile = PosixPath('KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond… │ │
│ │              profiler = <SupportedProfiler.diamond: 'diamond'>                               │ │
│ │              profiles = [                                                                    │ │
│ │                         │                                                                    │ │
│ │                         PosixPath('KV23-5721-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond… │ │
│ │                         │                                                                    │ │
│ │                         PosixPath('KV19-4396-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │                                                                    │ │
│ │                         PosixPath('KV19-4396-neg-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │                                                                    │ │
│ │                         PosixPath('KV19-4396-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │                                                                    │ │
│ │                         PosixPath('KV23-5721-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │                                                                    │ │
│ │                         PosixPath('KV20-1130-posEV-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_D… │ │
│ │                         │                                                                    │ │
│ │                         PosixPath('KV19-4396-neg-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │                                                                    │ │
│ │                         PosixPath('KV23-5721-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Dia… │ │
│ │                         │                                                                    │ │
│ │                         PosixPath('KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond… │ │
│ │                         ]                                                                    │ │
│ │                result = │    taxonomy_id  ...                                                │ │
│ │                         KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.dia… │ │
│ │                         0              0  ...                                                │ │
│ │                         247959                                                               │ │
│ │                         1              2  ...                                                │ │
│ │                         98062                                                                │ │
│ │                         2           1236  ...                                                │ │
│ │                         1290                                                                 │ │
│ │                         3        2987757  ...                                                │ │
│ │                         36                                                                   │ │
│ │                         4            562  ...                                                │ │
│ │                         1783                                                                 │ │
│ │                         ...          ...  ...                                                │ │
│ │                         ...                                                                  │ │
│ │                         2649     1079859  ...                                                │ │
│ │                         1                                                                    │ │
│ │                         2650      586132  ...                                                │ │
│ │                         1                                                                    │ │
│ │                         2651      717646  ...                                                │ │
│ │                         1                                                                    │ │
│ │                         2652     1462615  ...                                                │ │
│ │                         1                                                                    │ │
│ │                         2653      235443  ...                                                │ │
│ │                         1                                                                    │ │
│ │                                                                                              │ │
│ │                         [2654 rows x 10 columns]                                             │ │
│ │          sample_sheet = None                                                                 │ │
│ │               samples = [                                                                    │ │
│ │                         │   Sample(                                                          │ │
│ │                         │   │                                                                │ │
│ │                         name='KV23-5721-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_2303… │ │
│ │                         │   │   profile=    taxonomy_id   count                              │ │
│ │                         0             0  582432                                              │ │
│ │                         1             2  100111                                              │ │
│ │                         2          1236    9627                                              │ │
│ │                         3       2987757     311                                              │ │
│ │                         4           562    4961                                              │ │
│ │                         ..          ...     ...                                              │ │
│ │                         623         820       1                                              │ │
│ │                         624      106654       1                                              │ │
│ │                         625     2793816       1                                              │ │
│ │                         626      519051       1                                              │ │
│ │                         627       61645       2                                              │ │
│ │                                                                                              │ │
│ │                         [628 rows x 2 columns]                                               │ │
│ │                         │   ),                                                               │ │
│ │                         │   Sample(                                                          │ │
│ │                         │   │                                                                │ │
│ │                         name='KV19-4396-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_… │ │
│ │                         │   │   profile=    taxonomy_id    count                             │ │
│ │                         0             0  4930069                                             │ │
│ │                         1         91061   111846                                             │ │
│ │                         2          1318    66094                                             │ │
│ │                         3          1385    13141                                             │ │
│ │                         4        716545   273649                                             │ │
│ │                         ..          ...      ...                                             │ │
│ │                         506     2762612        2                                             │ │
│ │                         507     1314678        1                                             │ │
│ │                         508     1552123        2                                             │ │
│ │                         509        1282        1                                             │ │
│ │                         510     2817997        1                                             │ │
│ │                                                                                              │ │
│ │                         [511 rows x 2 columns]                                               │ │
│ │                         │   ),                                                               │ │
│ │                         │   Sample(                                                          │ │
│ │                         │   │                                                                │ │
│ │                         name='KV19-4396-neg-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_… │ │
│ │                         │   │   profile=    taxonomy_id   count                              │ │
│ │                         0          5204    9494                                              │ │
│ │                         1             0  295842                                              │ │
│ │                         2          1224    6402                                              │ │
│ │                         3        451864   16479                                              │ │
│ │                         4             2   19330                                              │ │
│ │                         ..          ...     ...                                              │ │
│ │                         929     2763074       1                                              │ │
│ │                         930      647910       2                                              │ │
│ │                         931     2722702       2                                              │ │
│ │                         932      238749       1                                              │ │
│ │                         933      461281       2                                              │ │
│ │                                                                                              │ │
│ │                         [934 rows x 2 columns]                                               │ │
│ │                         │   ),                                                               │ │
│ │                         │   Sample(                                                          │ │
│ │                         │   │                                                                │ │
│ │                         name='KV19-4396-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_… │ │
│ │                         │   │   profile=    taxonomy_id    count                             │ │
│ │                         0             0   835571                                             │ │
│ │                         1          1224   674880                                             │ │
│ │                         2           286  2829440                                             │ │
│ │                         3          1236  2481652                                             │ │
│ │                         4             2  1532407                                             │ │
│ │                         ..          ...      ...                                             │ │
│ │                         961     2480627        2                                             │ │
│ │                         962     2816356        2                                             │ │
│ │                         963     2494702        1                                             │ │
│ │                         964        1054        2                                             │ │
│ │                         965     1571224        2                                             │ │
│ │                                                                                              │ │
│ │                         [966 rows x 2 columns]                                               │ │
│ │                         │   ),                                                               │ │
│ │                         │   Sample(                                                          │ │
│ │                         │   │                                                                │ │
│ │                         name='KV23-5721-moc-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_… │ │
│ │                         │   │   profile=    taxonomy_id   count                              │ │
│ │                         0           196      60                                              │ │
│ │                         1             0  855172                                              │ │
│ │                         2             2  162737                                              │ │
│ │                         3           286   37487                                              │ │
│ │                         4          1236   46419                                              │ │
│ │                         ..          ...     ...                                              │ │
│ │                         845     1923970       1                                              │ │
│ │                         846     1581058       1                                              │ │
│ │                         847      990412       1                                              │ │
│ │                         848     2723299       2                                              │ │
│ │                         849       11788       2                                              │ │
│ │                                                                                              │ │
│ │                         [850 rows x 2 columns]                                               │ │
│ │                         │   ),                                                               │ │
│ │                         │   Sample(                                                          │ │
│ │                         │   │                                                                │ │
│ │                         name='KV20-1130-posEV-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamon… │ │
│ │                         │   │   profile=    taxonomy_id   count                              │ │
│ │                         0             0  689250                                              │ │
│ │                         1       2498453    3590                                              │ │
│ │                         2         33883    1979                                              │ │
│ │                         3       2883480     498                                              │ │
│ │                         4             2   34499                                              │ │
│ │                         ..          ...     ...                                              │ │
│ │                         778     2785789       1                                              │ │
│ │                         779     2795110       1                                              │ │
│ │                         780     2022783       2                                              │ │
│ │                         781      201174       1                                              │ │
│ │                         782     1535325       1                                              │ │
│ │                                                                                              │ │
│ │                         [783 rows x 2 columns]                                               │ │
│ │                         │   ),                                                               │ │
│ │                         │   Sample(                                                          │ │
│ │                         │   │                                                                │ │
│ │                         name='KV19-4396-neg-DNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_… │ │
│ │                         │   │   profile=    taxonomy_id  count                               │ │
│ │                         0             0   9301                                               │ │
│ │                         1             2   1126                                               │ │
│ │                         2        112252      1                                               │ │
│ │                         3          1286      4                                               │ │
│ │                         4        131567    176                                               │ │
│ │                         ..          ...    ...                                               │ │
│ │                         105        1308      1                                               │ │
│ │                         106      599839      1                                               │ │
│ │                         107     2841671      1                                               │ │
│ │                         108        1717      1                                               │ │
│ │                         109       29430      2                                               │ │
│ │                                                                                              │ │
│ │                         [110 rows x 2 columns]                                               │ │
│ │                         │   ),                                                               │ │
│ │                         │   Sample(                                                          │ │
│ │                         │   │                                                                │ │
│ │                         name='KV23-5721-moc-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_… │ │
│ │                         │   │   profile=    taxonomy_id   count                              │ │
│ │                         0        559292    2413                                              │ │
│ │                         1        683960     713                                              │ │
│ │                         2             0  415441                                              │ │
│ │                         3        131567    5971                                              │ │
│ │                         4             2   39427                                              │ │
│ │                         ..          ...     ...                                              │ │
│ │                         625     1544694       1                                              │ │
│ │                         626     2497436       2                                              │ │
│ │                         627     2726947       1                                              │ │
│ │                         628       12916       1                                              │ │
│ │                         629       80878       1                                              │ │
│ │                                                                                              │ │
│ │                         [630 rows x 2 columns]                                               │ │
│ │                         │   ),                                                               │ │
│ │                         │   Sample(                                                          │ │
│ │                         │   │                                                                │ │
│ │                         name='KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_2303… │ │
│ │                         │   │   profile=    taxonomy_id   count                              │ │
│ │                         0             2   98062                                              │ │
│ │                         1             0  247959                                              │ │
│ │                         2          4751   17173                                              │ │
│ │                         3           470    3506                                              │ │
│ │                         4        131567    6405                                              │ │
│ │                         ..          ...     ...                                              │ │
│ │                         875      717646       1                                              │ │
│ │                         876     1462615       1                                              │ │
│ │                         877       50290       1                                              │ │
│ │                         878      721885       1                                              │ │
│ │                         879      235443       1                                              │ │
│ │                                                                                              │ │
│ │                         [880 rows x 2 columns]                                               │ │
│ │                         │   )                                                                │ │
│ │                         ]                                                                    │ │
│ │    samplesheet_format = None                                                                 │ │
│ │          summarise_at = None                                                                 │ │
│ │              taxonomy = PosixPath('/medstore/databases/taxprofiler/databases/taxpasta_taxon… │ │
│ │      taxonomy_service = <taxpasta.infrastructure.domain.service.taxopy_taxonomy_service.Tax… │ │
│ │                         object at 0x7f9e7a14a990>                                            │ │
│ │ TaxopyTaxonomyService = <class                                                               │ │
│ │                         'taxpasta.infrastructure.domain.service.taxopy_taxonomy_service.Tax… │ │
│ │   valid_output_format = <WideObservationTableFileFormat.TSV: 'TSV'>                          │ │
│ │           wide_format = True                                                                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /home/xabras/.conda/envs/TaxPasta/lib/python3.11/site-packages/taxpasta/application/add_tax_info │
│ _command.py:50 in execute                                                                        │
│                                                                                                  │
│    47 │   │   result = sample                                                                    │
│    48 │   │   if self.add_rank_lineage:                                                          │
│    49 │   │   │   result = Sample(                                                               │
│ ❱  50 │   │   │   │   name=result.name,                                                          │
│    51 │   │   │   │   profile=self.taxonomy_service.add_rank_lineage(result.profile),            │
│    52 │   │   │   )                                                                              │
│    53 │   │   if self.add_id_lineage:                                                            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ result = │    taxonomy_id  ...                                                               │ │
│ │          KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond             │ │
│ │          0              0  ...                                             247959            │ │
│ │          1              2  ...                                              98062            │ │
│ │          2           1236  ...                                               1290            │ │
│ │          3        2987757  ...                                                 36            │ │
│ │          4            562  ...                                               1783            │ │
│ │          ...          ...  ...                                                ...            │ │
│ │          2649     1079859  ...                                                  1            │ │
│ │          2650      586132  ...                                                  1            │ │
│ │          2651      717646  ...                                                  1            │ │
│ │          2652     1462615  ...                                                  1            │ │
│ │          2653      235443  ...                                                  1            │ │
│ │                                                                                              │ │
│ │          [2654 rows x 10 columns]                                                            │ │
│ │ sample = │    taxonomy_id  ...                                                               │ │
│ │          KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond             │ │
│ │          0              0  ...                                             247959            │ │
│ │          1              2  ...                                              98062            │ │
│ │          2           1236  ...                                               1290            │ │
│ │          3        2987757  ...                                                 36            │ │
│ │          4            562  ...                                               1783            │ │
│ │          ...          ...  ...                                                ...            │ │
│ │          2649     1079859  ...                                                  1            │ │
│ │          2650      586132  ...                                                  1            │ │
│ │          2651      717646  ...                                                  1            │ │
│ │          2652     1462615  ...                                                  1            │ │
│ │          2653      235443  ...                                                  1            │ │
│ │                                                                                              │ │
│ │          [2654 rows x 10 columns]                                                            │ │
│ │   self = AddTaxInfoCommand(                                                                  │ │
│ │          │                                                                                   │ │
│ │          taxonomy_service=<taxpasta.infrastructure.domain.service.taxopy_taxonomy_service.T… │ │
│ │          object at 0x7f9e7a14a990>,                                                          │ │
│ │          │   summarise_at=None,                                                              │ │
│ │          │   add_name=True,                                                                  │ │
│ │          │   add_rank=True,                                                                  │ │
│ │          │   add_lineage=True,                                                               │ │
│ │          │   add_id_lineage=True,                                                            │ │
│ │          │   add_rank_lineage=True                                                           │ │
│ │          )                                                                                   │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /home/xabras/.conda/envs/TaxPasta/lib/python3.11/site-packages/pandas/core/generic.py:5902 in    │
│ __getattr__                                                                                      │
│                                                                                                  │
│    5899 │   │   │   and self._info_axis._can_hold_identifiers_and_holds_name(name)               │
│    5900 │   │   ):                                                                               │
│    5901 │   │   │   return self[name]                                                            │
│ ❱  5902 │   │   return object.__getattribute__(self, name)                                       │
│    5903 │                                                                                        │
│    5904 │   def __setattr__(self, name: str, value) -> None:                                     │
│    5905 │   │   """                                                                              │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ name = 'name'                                                                                │ │
│ │ self = │    taxonomy_id  ...                                                                 │ │
│ │        KV23-5721-RNA_pe_230627_NB501037_0884_AHK5LVAFX5_Diamond_230321.diamond               │ │
│ │        0              0  ...                                             247959              │ │
│ │        1              2  ...                                              98062              │ │
│ │        2           1236  ...                                               1290              │ │
│ │        3        2987757  ...                                                 36              │ │
│ │        4            562  ...                                               1783              │ │
│ │        ...          ...  ...                                                ...              │ │
│ │        2649     1079859  ...                                                  1              │ │
│ │        2650      586132  ...                                                  1              │ │
│ │        2651      717646  ...                                                  1              │ │
│ │        2652     1462615  ...                                                  1              │ │
│ │        2653      235443  ...                                                  1              │ │
│ │                                                                                              │ │
│ │        [2654 rows x 10 columns]                                                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'DataFrame' object has no attribute 'name'

Environment

### Package Information | Package | Version | |:---------|--------:| | taxpasta | 0.6.0 | ### Dependency Information | Package | Version | |:-----------------------------|------------:| | bash-kernel | **missing** | | biom-format | 2.1.14 | | depinfo~ | **missing** | | jupyter | **missing** | | mkdocs-awesome-pages-plugin~ | **missing** | | mkdocs-exclude~ | **missing** | | mkdocs-material~ | **missing** | | mkdocstrings[python]~ | **missing** | | numpy~ | **missing** | | odfpy | **missing** | | openpyxl | **missing** | | pandas~ | **missing** | | pandera~ | **missing** | | pre-commit | **missing** | | pyarrow | 11.0.0 | | rich | 12.6.0 | | tabulate~ | **missing** | | taxopy~ | **missing** | | tox~ | **missing** | | typer~ | **missing** | ### Build Tools Information | Package | Version | |:-----------|--------:| | pip | 23.1.2 | | setuptools | 67.7.2 | | wheel | 0.40.0 | ### Platform Information | | | |:--------|------------------------------------:| | Linux | 4.18.0-425.13.1.el8_7.x86_64-x86_64 | | CPython | 3.11.3 |

Anything else?

No response

Midnighter commented 9 months ago

Thanks for the report!

MRMHmdeleeuw commented 9 months ago

Hello @Midnighter and thank you for providing Taxpasta. I did a fresh install of Taxpasta 0.6.0 last week and came across this error as well, thinking my own custom Taxonkit taxdump was to blame. But actually, the How-to Add Taxa Names to Output tutorial produces the exact same error. I saw in the commits there has been refactoring of the sample ETL service, so I figured this could be a regression induced by the latest commits.

Workaround: git checkout 7f43707

I had to wind back this far because the commit just after, cd6fe48 still produced the error. Hope this helps and keep up the good work.

Midnighter commented 9 months ago

Awesome, thank you for the detective work 🕵🏼. I'll try to fix it soon.

MRMHmdeleeuw commented 9 months ago

Awesome, thank you for the detective work 🕵🏼. I'll try to fix it soon.

Great, because although that version supports merge to BIOM, it does not write the lineage to it.

Midnighter commented 9 months ago

Alright, I found the problem. I will try to release a fix tomorrow.

jfy133 commented 9 months ago

@LilyAnderssonLee @sofstam 👆