Skip to content

Commit

Permalink
Merge pull request #78 from ksenia-krasheninnikova/ncbi_api_key
Browse files Browse the repository at this point in the history
Updated mito reference script to accept the ncbi api key
  • Loading branch information
marcelauliano authored Mar 12, 2024
2 parents e4f2197 + 108296a commit 05b49fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/findMitoReference.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,20 @@ def find_full_mito(group, outfolder, length_threshold, considered, org_type='mit
parser.add_argument('--email', nargs='?', default="")
parser.add_argument('--outfolder', nargs='?', default="")
parser.add_argument('--type', choices=['mitochondrion','chloroplast'], default='mitochondrion', \
help='specify the type of organelle')
help='Specify the type of organelle')
parser.add_argument('--min_length', nargs='?', type=int, default=0, \
help='minimal appropriate length')
help='Minimal appropriate length')
parser.add_argument('-n', nargs='?', type=int, default=1, \
help='Number of genomes to report. Reported in order of identification')
parser.add_argument('--ncbi-api-key', nargs='?', help='Set NCBI API key')
args = parser.parse_args()
n = args.n
if n < 1:
print('Number of genomes to report must be at least 1 (default)')
exit(1)
Entrez.email = args.email
if args.ncbi_api_key:
Entrez.api_key = args.ncbi_api_key
if not os.path.isdir(args.outfolder):
os.mkdir(args.outfolder)
print('Looking for ' + args.type +' for ' + args.species)
Expand Down

0 comments on commit 05b49fb

Please sign in to comment.