@@ -1546,6 +1546,38 @@ def compareAnnotations(old, new, output):
1546
1546
compareAnnotations (GBK , final_gbk , Changes )
1547
1547
1548
1548
lib .log .info ("Funannotate update is finished, output files are in the %s/update_results folder" % (args .out ))
1549
+ #check if there are error that need to be fixed
1550
+ ncbi_error = 0
1551
+ with open (final_error , 'rU' ) as errors :
1552
+ for line in errors :
1553
+ line = line .strip ()
1554
+ if 'ERROR' in line :
1555
+ num = line .split (' ' )[0 ]
1556
+ ncbi_error = ncbi_error + int (num )
1557
+
1558
+ if ncbi_error > 0 :
1559
+ #see if we can get the gene models that need to be fixed
1560
+ needFixing = {}
1561
+ with open (final_validation , 'rU' ) as validationFile :
1562
+ for line in validationFile :
1563
+ line = line .strip ()
1564
+ if line .startswith ('ERROR' ):
1565
+ ID = line .split ('gnl|ncbi|' )[- 1 ].replace ('-T1]' , '' )
1566
+ reason = line .split (' FEATURE:' )[0 ]
1567
+ reason = reason .split ('] ' )[- 1 ]
1568
+ if not ID in needFixing :
1569
+ needFixing [ID ] = reason
1570
+ lib .log .info ("There are %i gene models that need to be fixed." % ncbi_error )
1571
+ print ('-------------------------------------------------------' )
1572
+ with open (final_fixes , 'w' ) as fixout :
1573
+ fixout .write ('#GeneID\t Error Message\n ' )
1574
+ for k ,v in natsorted (needFixing .items ()):
1575
+ fixout .write ('%s\t %s\n ' % (k ,v ))
1576
+ print ('%s\t %s' % (k ,v ))
1577
+ print ('-------------------------------------------------------' )
1578
+ lib .log .info ("Manually edit the tbl file %s, then run:\n \n funannotate fix -i %s -t %s\n " % (final_tbl , final_gbk , final_tbl ))
1579
+ lib .log .info ("After the problematic gene models are fixed, you can proceed with functional annotation." )
1580
+
1549
1581
lib .log .info ("Your next step might be functional annotation, suggested commands:\n \
1550
1582
-------------------------------------------------------\n \
1551
1583
Run InterProScan (Docker required): \n {:} -i={:} -c={:}\n \n \
0 commit comments