def set_mapper_number(manifest_file):
accession_counts = 0
if manifest_file.startswith("s3://"):
s3_client = boto3.resource("s3")
bucket_name, key_prefix = manifest_file.strip().strip("/")[5:].split("/", 1)
with tempfile.TemporaryDirectory() as tmpdirname:
s3_client.Object(bucket_name, key_prefix).download_file(tmpdirname+"/manifest")
for line in open(tmpdirname+"/manifest"):
accession_counts += 1
else:
for line in open(manifest_file):
accession_counts += 1
return accession_counts
评论列表
文章目录