Last active
May 28, 2018 09:45
-
-
Save xiamaz/13bfe9d493903187256d533a0b67e628 to your computer and use it in GitHub Desktop.
Use $PnE data for flow cytometry data loaded with fcsparser to transform linearized log marker channels according to FCS3.1 specification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code snipplet to implement PnE based transformation of flow data in python | |
data = FCSLogTransform().transform(data) | |
def logTransform(data): | |
transCols = [c for c in data.columns if "LIN" not in c] | |
for col, f in channel_info.items(): | |
if f["f1"]: | |
data[col] = 10 ** (f["f1"] * data[col] / f["range"]) * f["f2"] | |
print(transCols) | |
print(data.min(axis=0), data.max(axis=0)) | |
data[transCols] = np.log10(data[transCols]) | |
return data | |
# data = logTransform(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment