cytomining / cytominer-transport Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
The following is off-topic (not usage-related) and is getting into implementation, so feel free to ignore for now, or bump to another thread.
It currently takes ~3-5 hours to ingest a file. Our current choice of SQLite does not allow us to do parallel writes, so there's no way to parallelize this.
But we do now, because can store it as a Parquet Dataset which can have multiple files.
So for a 384-well dataset, we can save the output as a Parquet dataset with, say, 24 files (one for each column of the384-well plate). This will also make parallel reads faster, so e.g. aggregation can be faster.
Originally posted by @shntnu in #1 (comment)
Currently cytominer_transport/_generator.py
combines objects based on "ImageNumber" and "ObjectNumber".
Instead, we should consider combining objects by their appropriate "Parent_{compartment}" and "Child_{compartment}".
pandas.concat(axis=1)
cytominer-transport/src/cytominer_transport/_generator.py
Lines 64 to 66 in 056ced3
Image.csv
has two rows, my Cells.csv
has 137, but I only see two lines in the file.Area_Shape_Center_X
from the Cells.csv
is 291.457696827262
(and that value is NOT present at all in Cytoplasm.csv
, but when I search that value in my parquet file it is under AreaShape_Center_X_Cytoplasm_Image
.Code run:
from cytominer_transport import to_parquet
example_source = "/Users/bcimini/Desktop/test/transport/per_well/20585_A02/"
example_objects = ["Cells.csv", "Cytoplasm.csv", "Nuclei.csv"]
example_destination = "test_dir"
to_parquet(source=example_source, destination=example_destination, objects=example_objects)
Feature creep alert
Also optionally and by default output the mean aggregated profiles because it is so much faster to do it at this step at one shot than to do it downstream.
I am trying out the first pass of cytominer-transport. After installing with python setup.py install
, I tried the following:
from cytominer_transport import to_parquet
example_source = "s3://imaging-platform/projects/2015_07_01_Cell_Health_Vazquez_Cancer_Broad/workspace/analysis/CRISPR_PILOT_B1/SQ00014610/analysis/"
example_objects = ["cells.csv", "cytoplasm.csv", "nuclei.csv"]
example_destination = "test_dir"
to_parquet(source=example_source, destination=example_destination, objects=example_objects)
and received the error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-a195cc2e3a3b> in <module>
----> 1 to_parquet(source=example_source, destination=example_destination, objects=example_objects)
~/miniconda3/lib/python3.7/site-packages/cytominer_transport-0.1.0-py3.7.egg/cytominer_transport/_to_parquet.py in to_parquet(source, destination, experiment, image, objects, compression, **kwargs)
69 image.set_index("ImageNumber")
70 else:
---> 71 raise FileNotFoundError(filename=pathname)
72
73 # Open object CSVs (e.g. Cells.csv, Cytoplasm.csv, Nuclei.csv, etc.)
TypeError: FileNotFoundError() takes no keyword arguments
I then updated the following variables:
# Just one well now
example_source = "s3://imaging-platform/projects/2015_07_01_Cell_Health_Vazquez_Cancer_Broad/workspace/analysis/CRISPR_PILOT_B1/SQ00014610/analysis/A01-1/"
# Capitalize to match file system
example_objects = ["Cells.csv", "Cytoplasm.csv", "Nuclei.csv"]
And I received the same error
How shall users interact with the codebase? Let's track our thoughts and decide here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.