MDU-PHL / bohra

A pipeline for bioinformatics analysis of bacterial genomes
GNU General Public License v3.0
18 stars 4 forks source link

Bug when reference is FASTA #39

Closed andersgs closed 4 years ago

andersgs commented 4 years ago
  File "/home/linuxbrew/.linuxbrew/bin/bohra", line 8, in <module>
    sys.exit(main())
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/bohra/bohra.py", line 136, in main
    args.func(args)
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/bohra/bohra.py", line 33, in run_pipeline
    return(R.run_pipeline())
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/bohra/SnpDetection.py", line 920, in run_pipeline
    self.index_reference()
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/bohra/SnpDetection.py", line 612, in index_reference
    if '.fa' not in self.ref:
TypeError: argument of type 'PosixPath' is not iterable```

The offending line should be:
if 'self.ref.match("*.fa*):
tseemann commented 4 years ago

We should not rely on file extensions to predict file types, especially with fasta.

Can you open it with biopython? It should be able to auto-detect. Then check if it has features or not, or sequence or not.