freejstone / CONGA

Implementation of the CONGA algorithm for a combined open and narrow search between experimental spectra and a peptide database.
MIT License
3 stars 1 forks source link

Error running CONGA on tutorial example data -- AttributeError: 'Series' object has no attribute 'flanking_aa' #7

Closed mriffle closed 1 year ago

mriffle commented 1 year ago

When running CONGA using this command on the tutorial example data:

python3 /usr/local/bin/CONGA.py --score e-value --dcy_prefix DECOY_ narrow_example1.comet.txt open_example1.comet.txt

I get the following error:

CPU: Linux-5.4.0-110-generic-x86_64-with-glibc2.31
2023-01-12 18:36:38.928625
Command used: /usr/local/bin/CONGA.py --score e-value --dcy_prefix DECOY_ narrow_example1.comet.txt open_example1.comet.txt
Successfully read in arguments.
Reading in search files.
Successfully read in search files.
e-value successfully found in search files.
Comet search files detected.
Concatenated search files detected.
Creating original_target_sequence column as in tide-search.
Rewriting peptide sequence in tide-search format.
Filtering for neighbours.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 27534/27534 [00:51<00:00, 536.31it/s]
Doing head to head competition.
Constructing groups adaptively.
                             decoys  targets     ratio
group names:
narrow                         3959     4930  0.803043
top 1 PSMs & top 1 mass bin     143      387  0.369509
top 1 PSMs & top 4 mass bin      99      182  0.543956
top 2 or more PSMs              135      122  1.106557
left over group                7384     7861  0.939321
Applying group walk.
Group walk complete.
719 peptides discovered at the 1% FDR level.
1058 peptides discovered at the 5% FDR level.
Scan multiplicities among the discovered peptides at 1% FDR level:
                    Count
Scan multiplicity:
1                     719
Scan multiplicities among the discovered peptides at 5% FDR level:
                    Count
Scan multiplicity:
1                    1058
Writing peptides at user-specified FDR level to directory.
Traceback (most recent call last):
  File "/usr/local/bin/CONGA.py", line 2250, in <module>
    main()
  File "/usr/local/bin/CONGA.py", line 2186, in main
    df['flag'] = df.apply(get_amino_acid_to_warn, axis = 1)
  File "/usr/local/lib/python3.10/site-packages/pandas/core/frame.py", line 9565, in apply
    return op.apply().__finalize__(self, method="apply")
  File "/usr/local/lib/python3.10/site-packages/pandas/core/apply.py", line 746, in apply
    return self.apply_standard()
  File "/usr/local/lib/python3.10/site-packages/pandas/core/apply.py", line 873, in apply_standard
    results, res_index = self.apply_series_generator()
  File "/usr/local/lib/python3.10/site-packages/pandas/core/apply.py", line 889, in apply_series_generator
    results[i] = self.f(v)
  File "/usr/local/bin/CONGA.py", line 1378, in get_amino_acid_to_warn
    flanking = df.flanking_aa
  File "/usr/local/lib/python3.10/site-packages/pandas/core/generic.py", line 5902, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'flanking_aa'
freejstone commented 1 year ago

Thanks Mike! Should be good to go now:

INFO: CPU: macOS-10.16-x86_64-i386-64bit INFO: 2023-01-13 10:38:41.770966 INFO: Command used: CONGA.py --dcyprefix DECOY --score e-value docs/pages/files/comet/narrow_example1.comet.txt docs/pages/files/comet/open_example1.comet.txt INFO: Successfully read in arguments INFO: Reading in search files. INFO: Successfully read in search files. INFO: e-value successfully found in search files.

INFO: Comet search files detected. INFO: Concatenated search files detected. INFO: Creating original_target_sequence column as in tide-search. INFO: Rewriting peptide sequence in tide-search format. INFO: Filtering for neighbours. INFO: Doing head to head competition. INFO: Constructing groups adaptively. INFO: decoys targets ratio group names:
narrow 3959 4930 0.803043 top 1 PSMs & top 1 mass bin 142 387 0.366925 top 1 PSMs & top 4 mass bin 99 184 0.538043 top 2 or more PSMs 135 122 1.106557 left over group 7385 7859 0.939687 INFO: Applying group walk. INFO: Group walk complete. INFO: 719 peptides discovered at the 1% FDR level. INFO: 1051 peptides discovered at the 5% FDR level. INFO: Scan multiplicities among the discovered peptides at 1% FDR level: INFO: Count Scan multiplicity:
1 719 INFO: Scan multiplicities among the discovered peptides at 5% FDR level: INFO: Count Scan multiplicity:
1 1051 INFO: Writing peptides at user-specified FDR level to directory. INFO: Elapsed time: 52.18 s