@@ -275,10 +275,10 @@ def translate_gene(args,tmpdir):
275
275
276
276
def check_length (queryfile ):
277
277
from gmsc_mapper .fasta import fasta_iter
278
- logger .debug ('Start length checking ...' )
278
+ logger .debug ('Start length check ...' )
279
279
if all (len (seq ) < 303
280
280
for _ , seq in fasta_iter (queryfile )):
281
- logger .warning ('GMSC-mapper Warning: Input sequences are all more than 303nt. '
281
+ logger .warning ('GMSC-mapper Warning: Input sequences are all greater than 300bps. \n '
282
282
'Please check if your input consists of contigs, which should use -i not --nt-genes or --aa-genes as input. '
283
283
'However, we will regard your input sequences as nucleotide genes and continue to process.\n ' )
284
284
@@ -401,9 +401,9 @@ def main(args=None):
401
401
if args is None :
402
402
args = sys .argv
403
403
args = parse_args (args )
404
- if not args .cmd and ( not args .genome_fasta and not args .aa_input and not args .nt_input ) :
405
- sys .stderr .write ("GMSC-mapper Error: Please see gmsc-mapper -h. Assign the subcommand or input file.\n " )
406
- sys .exit (1 )
404
+ if not args .cmd and not args .genome_fasta and not args .aa_input and not args .nt_input :
405
+ sys .stderr .write ("GMSC-mapper Error: Please see gmsc-mapper -h. Choose a subcommand or input file.\n " )
406
+ sys .exit (1 )
407
407
has_diamond ,has_mmseqs = check_install ()
408
408
409
409
if args .cmd == 'createdb' :
@@ -475,15 +475,19 @@ def main(args=None):
475
475
476
476
if not args .notaxonomy :
477
477
summary .append (f'# Taxonomy' )
478
- annotated_number ,rank_number ,rank_percentage = taxonomy (args ,resultfile ,tmpdir )
479
- summary .append (str (annotated_number )+ ' (' + str (round ((1 - rank_percentage ['no rank' ])* 100 ,2 ))+ '%) aligned smORFs have taxonomy annotation.' )
480
- summary .append (str (rank_number ['kingdom' ])+ ' (' + str (round (rank_percentage ['kingdom' ]* 100 ,2 ))+ '%) aligned smORFs are annotated on kingdom.' )
481
- summary .append (str (rank_number ['phylum' ])+ ' (' + str (round (rank_percentage ['phylum' ]* 100 ,2 ))+ '%) aligned smORFs are annotated on phylum.' )
482
- summary .append (str (rank_number ['class' ])+ ' (' + str (round (rank_percentage ['class' ]* 100 ,2 ))+ '%) aligned smORFs are annotated on class.' )
483
- summary .append (str (rank_number ['order' ])+ ' (' + str (round (rank_percentage ['order' ]* 100 ,2 ))+ '%) aligned smORFs are annotated on order.' )
484
- summary .append (str (rank_number ['family' ])+ ' (' + str (round (rank_percentage ['family' ]* 100 ,2 ))+ '%) aligned smORFs are annotated on family.' )
485
- summary .append (str (rank_number ['genus' ])+ ' (' + str (round (rank_percentage ['genus' ]* 100 ,2 ))+ '%) aligned smORFs are annotated on genus.' )
486
- summary .append (str (rank_number ['species' ])+ ' (' + str (round (rank_percentage ['species' ]* 100 ,2 ))+ '%) aligned smORFs are annotated on species.' )
478
+ annotated_number ,rank_number ,rank_percentage = taxonomy (args ,resultfile ,tmpdir )
479
+ summary .append (
480
+ f'{ annotated_number } ({ 1 - rank_percentage ["no rank" ]:.2%} ) aligned smORFs have taxonomy annotation.' )
481
+ for rank in [
482
+ 'superkingdom' ,
483
+ 'phylum' ,
484
+ 'class' ,
485
+ 'order' ,
486
+ 'family' ,
487
+ 'genus' ,
488
+ 'species' ]:
489
+ summary .append (
490
+ f'{ rank_number [rank ]} ({ rank_percentage ["superkingdom" ]:.2%} ) aligned smORFs are annotated at level of { rank } .' )
487
491
488
492
with atomic_write (f'{ args .output } /summary.txt' , overwrite = True ) as ofile :
489
493
for s in summary :
0 commit comments