@@ -0,0 +1,1620 @@
+#!/usr/bin/env python%0A%0A# BBBC017-image.py %3Cmetadata.json%3E %3Cfeatures-mongo.json%3E %3Cscreen-info.json%3E%0A%0Aimport json%0Aimport os%0Afrom pymongo import MongoClient%0Aimport sys%0A%0Adef main(argv=None):%0A    metadata_file = argv%5B1%5D%0A    metadata = %5B%5D%0A    with open(metadata_file) as f:%0A        for line in f:%0A            metadata.append(json.loads(line))%0A            %0A    feature_file = argv%5B2%5D%0A    feature = %5B%5D%0A    with open(feature_file) as f:%0A        for line in f:%0A            feature.append(json.loads(line))%0A            %0A    info_file = argv%5B3%5D%0A    info = %5B%5D%0A    with open(info_file) as f:%0A            info = eval(f.read())%0A%0A    for document in metadata:%0A        col = document%5B'column'%5D%0A        _id = document%5B'_id'%5D%0A        document%5B'column'%5D = %22%7B0:02d%7D%22.format(col)%0A        document%5B'_id'%5D = 'BBBC017-' + _id%0A        document%5B'screen'%5D = 'BBBC017'%0A        document%5B'control_pos'%5D = False%0A%0A    for document in feature:%0A        _id = document%5B'_id'%5D%0A        document%5B'_id'%5D = 'BBBC017-' + _id%0A        %0A        if 'neighbours' in document:%0A            new_array = %5B%5D%0A            for item in document%5B'neighbours'%5D:%0A                new_array.append('BBBC017-' + item)%0A            document%5B'neighbours'%5D = new_array%0A%0A    client = MongoClient('localhost', 27017)%0A    db_micro = client%5B'microscopium'%5D%0A    micro_images = db_micro%5B'samples'%5D%0A    micro_screens = db_micro%5B'screens'%5D%0A%0A    foo = micro_images.insert(metadata)%0A%0A    for document in feature:%0A        current_id = document%5B'_id'%5D%0A        micro_images.update(%7B'_id': current_id%7D, %7B%22$set%22: document%7D)%0A%0A    micro_screens.insert(info)%0A%0Aif __name__ == '__main__':%0A    main(sys.argv)

Add script used to add BBB017 sample documents