Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize flowCore_PnRmax handling between cytolib and flowCore FCS parsers #42

Merged
merged 6 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: cytolib
Type: Package
Title: C++ infrastructure for representing and interacting with the gated cytometry data
Version: 2.1.18
Version: 2.1.19
Date: 2017-08-07
Author: Mike Jiang
Maintainer: Mike Jiang <[email protected]>, Jake Wagner <[email protected]>
Expand Down
2 changes: 2 additions & 0 deletions inst/include/cytolib/MemCytoFrame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef INST_INCLUDE_CYTOLIB_MEMCYTOFRAME_HPP_
#define INST_INCLUDE_CYTOLIB_MEMCYTOFRAME_HPP_
#include "CytoFrame.hpp"
#include "trans_group.hpp"
#include "readFCSdata.hpp"

namespace cytolib
Expand Down Expand Up @@ -186,6 +187,7 @@ class MemCytoFrame: public CytoFrame{

void append_data_columns(const EVENT_DATA_VEC & new_cols);

void transform_data(const trans_local & trans);
};


Expand Down
2 changes: 1 addition & 1 deletion src/GatingHierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ namespace cytolib
curTrans->transforming(&param_range.second, 1);
}


cytoframe.set_keyword("transformation", "custom");
cytoframe.set_range(curChannel, ColType::channel, param_range);

}
Expand Down
42 changes: 42 additions & 0 deletions src/MemCytoFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,9 @@ namespace cytolib
else
params[i-1].max = boost::lexical_cast<EVENT_DATA_TYPE>(it->second);

if(range_str == "flowCore_$P" + pid + "Rmax")
params[i-1].max += 1;


params[i-1].PnB = stoi(keys_["$P" + pid + "B"]);

Expand Down Expand Up @@ -1061,6 +1064,45 @@ namespace cytolib
return data_.colptr(idx);
}

void MemCytoFrame::transform_data(const trans_local & trans) {
if(g_loglevel>=GATING_HIERARCHY_LEVEL)
PRINT("start transforming cytoframe data \n");
if(n_rows()==0)
throw(domain_error("data is not loaded yet!"));

vector<string> channels=get_channels();
int nEvents = n_rows();
/*
* transforming each marker
*/
for(vector<string>::iterator it1=channels.begin();it1!=channels.end();it1++)
{

string curChannel=*it1;
auto param_range = get_range(curChannel, ColType::channel, RangeType::instrument);
TransPtr curTrans=trans.getTran(curChannel);

if(curTrans)
{
if(curTrans->gateOnly())
continue;

EVENT_DATA_TYPE * x = get_data_memptr(curChannel, ColType::channel);
if(g_loglevel>=GATING_HIERARCHY_LEVEL)
{
string type;
curTrans->getType(type);
PRINT("transforming "+curChannel+" with func:"+type+"\n");
}
curTrans->transforming(x,nEvents);
curTrans->transforming(&param_range.first, 1);
curTrans->transforming(&param_range.second, 1);
}

set_keyword("transformation", "custom");
set_range(curChannel, ColType::channel, param_range);
}
}
};


Expand Down