Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndentationError: unindent does not match any outer indentation level #17

Open
Frillian opened this issue Mar 19, 2023 · 4 comments
Open

Comments

@Frillian
Copy link

Hi, when I run this command 'python DBSCAN-SWA-master/bin/dbscan-swa.py --h' and then:
File "/home/lfb/Public/Lfb/pha/DBSCAN-SWA-master/bin/dbscan-swa.py", line 2761
global diamond_thread_num
^
IndentationError: unindent does not match any outer indentation level
How do I solve this problem? Thanks

@nahlgren
Copy link

I'm no python expert but looks like there's an error in the file dbscan-swa.py
Got to line 2761 in dbscan-swa.py with the text "global diamond_thread_num" and replace the spaces at the front of the line with a single tab.

Indentations in python need to be consistent, using spaces or tabs but not both.

It hits upon the classic spaces vs. tabs issue:
https://thenewstack.io/spaces-vs-tabs-a-20-year-debate-and-now-this-what-the-hell-is-wrong-with-go/
which has a great reference to the debate in the series Silicon Valley.

@Asylulan
Copy link

nahlgren's recommendation worked

@Dey497
Copy link

Dey497 commented Apr 4, 2023

Indeed, there is a small inaccuracy in the dbscan-swa.py script. The correction proposed by nahlgren worked great!

@neelam19051
Copy link

neelam19051 commented May 30, 2023

Hi i did try but it didn't work

python dbscan-swa.py
File "/home/bvsbic/neelam/DBSCAN-SWA/bin/DBSCAN-SWA/bin/dbscan-swa.py", line 2761
global diamond_thread_num
^
IndentationError: unindent does not match any outer indentation level

**- if not os.path.exists(outdir):

  •             mkdir(outdir)
    
  •     global prefix
    
  •     if args.prefix:
    
  •             prefix = args.prefix
    
  •     else:
    
  •             prefix = 'bac'
    
  •             print('Warning:The program will specify the prefix of the ouput files bac!If you want to use another prefix,please use the parameter:--prefix <prefix>!')
    
  •     if args.add_annotation:
    
  •             add_annotation = args.add_annotation
    
  •     else:
    
  •             print('Warning:The parameter add_annotation default:PGPD,If you want to run fast, please set add_annotation to none')
    
  •             add_annotation = 'PGPD'
    
  •     global blastp_evalue
    
  •     if args.evalue:
    
  •             blastp_evalue = args.evalue
    
  •             if float(blastp_evalue)>1e-7:
    
  •                     print('Warning:The evalue %s can not be larger than 1e-4!'%blastp_evalue)
    
  •                     blastp_evalue = 1e-7
    
  •                     print('The evalue of homology search for virus uniprot database has been set to 1e-4')
    
  •     else:
    
  •             blastp_evalue = 1e-7
    
  •     global per,idn,cov
    
  •     if args.per:
    
  •             per = args.per
    
  •     else:
    
  •             per = 30
    
  •     if args.idn:
    
  •             idn = args.idn
    
  •     else:
    
  •             idn = 70
    
  •     if args.cov:
    
  •             cov = args.cov
    
  •     else:
    
  •             cov = 30
    
  •     thread_num = 10
    
  •     if args.thread_num:
    
  •             thread_num = args.thread_num
    
  •     else:
    
  •             thread_num = 10
    
  •  **_global diamond_thread_num_**
    
  •     if args.diamond_thread_num:
    
  •             diamond_thread_num = args.diamond_thread_num
    
  •     else:
    
  •             diamond_thread_num = 20
    
  •     global att_pro_num
    
  •     if args.protein_number:
    
  •             att_pro_num = args.protein_number
    
  •             if int(att_pro_num)<1:
    

-**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants