default=sys.stdout) args = parser.parse_args() # First get the lineage (and fail now if not found) lineage = get_lineage(args.species, args.email) if not lineage: raise RuntimeError( "Could not find lineage information on NCBI for species '%s'" % args.species) print('Found lineage: %s' % lineage) # Prepare the bibliographic reference ref = Reference() if args.ref_pubmed_id: ref.pubmed_id = args.ref_pubmed_id if args.ref_consortium: ref.consrtm = args.ref_consortium if args.ref_authors: ref.authors = args.ref_authors if args.ref_title: ref.title = args.ref_title if args.ref_journal: ref.journal = args.ref_journal else: now = datetime.datetime.now() ref_date = now.strftime("%m-%b-%Y").upper() # Temp switch to C to get english month abbr saved = locale.setlocale(locale.LC_TIME) try: locale.setlocale(locale.LC_TIME, "C")
print(gb, f) # sort features by start location, source always first gb.features.sort(key=lambda f: (-len(gb.seq)) * (f.type == "source") + f.location.start) # translate color from notes to ApEinfo for feature in gb.features: translate_color(feature) # Add an EcoFlex article reference ref = Reference() ref.authors = 'Moore SJ, Lai HE, Kelwick RJ, Chee SM, Bell DJ, Polizzi KM, Freemont PS.' ref.title = 'EcoFlex: A Multifunctional MoClo Kit for E. coli Synthetic Biology.' ref.journal = 'ACS Synth Biol 2016;5:1059-1069.' ref.pubmed_id = '27096716' gb.annotations['references'].append(ref) # Fix the direct submission reference ref = Reference() # ref = gb.annotations["references"][-1] ref.authors = "Larralde M" ref.title = "Direct Submission" ref.journal = "Distributed with the MoClo Python library\nhttps://github.com/althonos/moclo" gb.annotations['references'].append(ref) # write the final record dst_dir = os.path.abspath( os.path.join(__file__, "..", "..", "moclo-ecoflex", "registry", "ecoflex")) dst_file = os.path.join(dst_dir, "{}.gb").format(info["id"])