blobtoolkit / pipeline

[Archived] SnakeMake pipeline to run BlobTools on public assemblies
https://blobtoolkit.genomehubs.org
MIT License
10 stars 4 forks source link

cannot filter-AttributeError: 'bool' object has no attribute 'values' #22

Closed maysonlin closed 1 year ago

maysonlin commented 2 years ago

Hi, I have issue filtering based upon taxonomic contigs. Here is the error messages I received:

WARN: Skipping field 'bestsumorder_phylum', not present in dataset Traceback (most recent call last): File "/Users/maysonlin/Documents/blobtoolkit/blobtools2/lib/filter.py", line 381, in <module> main() File "/Users/maysonlin/Documents/blobtoolkit/blobtools2/lib/filter.py", line 250, in main indices = [index for index, value in enumerate(identifiers.values)] AttributeError: 'bool' object has no attribute 'values'

My script: /Users/maysonlin/Documents/blobtoolkit/blobtools2/blobtools filter --query-string "http://localhost:8001/view/dataset/ASSEMBLY_NAME/blob?bestsumorder_phylum--Keys=3#Filters" --fasta /Users/maysonlin/Documents/BTK_TUTORIAL/FILES/Pregina.p_ctg.purged.fa /Users/maysonlin/Documents/BTK_TUTORIAL/FILES/Pregina.p_ctg_filtered.purged.fa

I also tried using --param bestsumorder_phylum--Keys=Probacteria and --json /Users/maysonlin/Downloads/ASSEMBLY_NAME.current.json, still similar messages:

WARN: Skipping field 'bestsumorder_class', not present in dataset Traceback (most recent call last): File "/Users/maysonlin/Documents/blobtoolkit/blobtools2/lib/filter.py", line 381, in <module> main() File "/Users/maysonlin/Documents/blobtoolkit/blobtools2/lib/filter.py", line 250, in main indices = [index for index, value in enumerate(identifiers.values)] AttributeError: 'bool' object has no attribute 'values'

&

Traceback (most recent call last): File "/Users/maysonlin/Documents/blobtoolkit/blobtools2/lib/filter.py", line 381, in <module> main() File "/Users/maysonlin/Documents/blobtoolkit/blobtools2/lib/filter.py", line 250, in main indices = [index for index, value in enumerate(identifiers.values)] AttributeError: 'bool' object has no attribute 'values'

here is my "identifiers.json" looks like: {"id":"current","datasetId":"ASSEMBLY_NAME","search":"view","params":{"bestsumorder_class--Active":"true","bestsumorder_phylum--Keys":"1"},"identifiers":["ptg000001l_1","ptg000002l_1","ptg000004l_1","ptg000005l_1","ptg000006l_1","ptg000007l_1","ptg000008l_1","ptg000009l_1","ptg000010l_1","ptg000012l_1","ptg000013l_1","ptg000014l_1","ptg000015l_1","ptg000016l_1","ptg000017l_1","ptg000018l_1","ptg000019l_1","ptg000020l_1","ptg000021l_1","ptg000022l_1","ptg000023l_1","ptg000024l_1","ptg000025l_1","ptg000026l_1","ptg000027l_1","ptg000028l_1","ptg000029l_1","ptg000030l_1","ptg000031l_1","ptg000033l_1","ptg000034l_1","ptg000035l_1","ptg000036l_1","ptg000037l_1","ptg000038l_1","ptg000039l_1","ptg000040l_1","ptg000041l_1","ptg000042l_1","ptg000043l_1","ptg000044l_1","ptg000045l_1","ptg000046l_1","ptg000049l_1","ptg000050l_1","ptg000051l_1","ptg000052l_1","ptg000053l_1","ptg000054l_1","ptg000055l_1","ptg000057l_1","ptg000058l_1","ptg000059l_1","ptg000061l_1","ptg000062l_1","ptg000063l_1","ptg000064l_1","ptg000065l_1","ptg000066l_1","ptg000067l_1","ptg000068l_1","ptg000069l_1","ptg000070l_1","ptg000071l_1","ptg000072l_1","ptg000073l_1","ptg000074l_1","ptg000075l_1","ptg000076l_1","ptg000077l_1","ptg000078l_1","ptg000079l_1","ptg000080l_1","ptg000081l_1","ptg000082l_1","ptg000083l_1","ptg000085l_1","ptg000086l_1","ptg000087l_1","ptg000088l_1","ptg000089l_1","ptg000090l_1","ptg000091l_1","ptg000092l_1","ptg000093l_1","ptg000095l_1","ptg000097l_1","ptg000099l_1","ptg000100l_1","ptg000102l_1","ptg000104l_1","ptg000105l_1","ptg000106l_1","ptg000107l_1","ptg000108l_1","ptg000110l_1","ptg000112l_1","ptg000113l_1","ptg000114l_1","ptg000116l_1","ptg000117l_1","ptg000120l_1","ptg000121l_1","ptg000125l_1","ptg000126l_1","ptg000127l_1","ptg000128l_1","ptg000130l_1","ptg000131l_1","ptg000132l_1","ptg000133l_1","ptg000136l_1","ptg000137l_1","ptg000138l_1","ptg000139l_1","ptg000144l_1","ptg000145l_1","ptg000146l_1","ptg000147l_1","ptg000148l_1","ptg000150l_1","ptg000151l_1","ptg000161l_1","ptg000165l_1","ptg000175l_1","ptg000185l_1","ptg000187l_1","ptg000191l_1","ptg000236l_1","ptg000291l_1","ptg000326l_1"],"summaryStats":{"hits":{"total":{"span":534549832,"count":131,"n50":8201560,"l50":17,"n90":1945816,"l90":68},"Arthropoda":{"count":129,"span":534356185,"n50":8201560},"Proteobacteria":{"count":0,"span":0,"n50":0},"no-hit":{"count":2,"span":193647,"n50":154887}},"taxonomy":{"taxid":7380,"lineage":"Eukaryota; Metazoa; Arthropoda; Insecta; Diptera; Calliphoridae; Phormia; Phormia regina","target":"Arthropoda","targetRank":"phylum"},"baseComposition":{"at":0.731,"gc":0.269,"n":0},"busco":{"diptera_odb10":{"c":3263,"d":8,"m":11,"f":11,"t":3285,"s":3255,"string":"C:99.3%[S:99.1%,D:0.2%],F:0.3%,M:0.3%,n:3285"}},"stats":{"noHit":0.000362,"target":1,"spanOverN50":65.2},"readMapping":{}}}

& bestsumorder_phylum.json: { "values": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 2, 1, 0, 1, 1, 0 ], "keys": [ "Arthropoda", "Proteobacteria", "no-hit" ] }

Hope these info helps solve the problems, I also tried to adjust length--Min=, still same message with filter.py line problem. I updated blobtoolkit with git clone https://github.com/blobtoolkit/blobtools2;, still the same issues with them all. I doubt if it's filter.py problem, but any suggestion can help, thank you for your time!

rjchallis commented 2 years ago

I think the problem here is that you are missing the dataset name from the end of your blobtools filter command and blobtools2 is interpreting the second fasta filename as the BlobDir name. You should only need to specify the input fasta filename so with a BlobDir named ASSEMBLY_NAME, your command would look like:

/Users/maysonlin/Documents/blobtoolkit/blobtools2/blobtools filter --query-string "http://localhost:8001/view/dataset/ASSEMBLY_NAME/blob?bestsumorder_phylum--Keys=3#Filters" --fasta /Users/maysonlin/Documents/BTK_TUTORIAL/FILES/Pregina.p_ctg.purged.fa ASSEMBLY_NAME

Hope this helps

github-actions[bot] commented 1 year ago

This issue has being marked as dormant because pipeline is being archived. The code is now part of the main BlobToolKit repository.

If you feel the issue has not been resolved, please follow the updated BlobToolKit installation instructions to first confirm that you are using the latest version, and then open a new issue at the main BlobToolKit repository if necessary.

This issue will be automatically closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 7 days since being marked as dormant.