Skip to content

Commit

Permalink
Adding options for changing cell barcode and UMI length to minnow
Browse files Browse the repository at this point in the history
  • Loading branch information
hiraksarkar committed Aug 14, 2019
1 parent 2a8134c commit 6a031b5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
6 changes: 3 additions & 3 deletions include/MinnowUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ namespace util{
return static_cast<uint32_t>(std::exp(distr(eng)));
}

inline std::vector<std::string> generateUMIList(){
inline std::vector<std::string> generateUMIList(const uint32_t UMI_LENGTH, const uint32_t POOL_SIZE){
std::vector<std::string> whiteList ;
std::cerr << "PRINTING DEBUG: POOL_SIZE " << POOL_SIZE << "\n\n" ;
whiteList.resize(POOL_SIZE) ;
for(int i=0 ; i < POOL_SIZE; ++i){
for(size_t i=0 ; i < POOL_SIZE; ++i){
whiteList[i] = genRandomSeq(UMI_LENGTH) ;
}
return whiteList ;
}

inline std::vector<std::string> generateCBList(int numCells){
inline std::vector<std::string> generateCBList(int numCells, const uint32_t CB_LENGTH){
std::vector<std::string> CBList;
CBList.resize(numCells) ;
for(int i=0 ; i < numCells; ++i){
Expand Down
3 changes: 3 additions & 0 deletions include/ProgOpts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class SimulateOptions {
double mutationProb{0.01};
uint32_t numThreads{2};
uint32_t numOfDoublets{0};

uint32_t CBLength{16} ;
uint32_t UMILength{10} ;
};

class EstimateOptions {
Expand Down
9 changes: 4 additions & 5 deletions include/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
#define FRAGMENT_RANGE (FRAGMENT_END_DIST - FRAGMENT_START_DIST)


#define CB_LENGTH 16
#define UMI_LENGTH 10
#define POOL_SIZE std::pow(4, UMI_LENGTH)
//#define POOL_SIZE 1000
//#define CB_LENGTH 16
//#define UMI_LENGTH 10
//#define POOL_SIZE std::pow(4, UMI_LENGTH)
#define TENX_WHITELIST_LENGTH 737280

#endif // MACROS_HEADER
#endif // MACROS_HEADER
8 changes: 8 additions & 0 deletions src/Minnow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ int main(int argc, char* argv[]) {
(option("--numMolFile") &
value("num mol file", simulateOpt.numMolFile)) %
"Number of molecules generated from each cell",

(option("--CBLength") &
value("Cell barcode length", simulateOpt.CBLength)) %
"Cell barcode length by default is 16",

(option("--UMILength") &
value("Cell barcode length", simulateOpt.UMILength)) %
"Cell barcode length by default is 10",

(option("--alevin-mode").set(simulateOpt.alevinMode, true)) %
"The program would assume that the input matrix is obtained from Alevin",
Expand Down
11 changes: 9 additions & 2 deletions src/MinnowSimulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ using SpinLockT = std::mutex;
#define FRAGMENT_START_DIST 53 + READ_LEN // this is from the empirical limit e^4
#define FRAGMENT_RANGE (FRAGMENT_END_DIST - FRAGMENT_START_DIST)


uint32_t CB_LENGTH ;
uint32_t UMI_LENGTH ;
uint32_t POOL_SIZE ;

#define _verbose(fmt, args...) fprintf(stderr, fmt, ##args)

Expand Down Expand Up @@ -1819,6 +1821,11 @@ void minnowSimulate(SimulateOptions& simOpts){
auto& numOfCells = simOpts.numOfCells ;
auto& numOfGenes = simOpts.numOfTranscripts ;

CB_LENGTH = simOpts.CBLength ;
UMI_LENGTH = simOpts.UMILength ;
POOL_SIZE = std::pow(4, UMI_LENGTH) ;


//auto& numOfSampleCells = simOpts.sampleCells ;
//auto& numOfPCRCycles = simOpts.numOfPCRCycles ;
//auto& errorRate = simOpts.errorRate ;
Expand Down Expand Up @@ -2048,7 +2055,7 @@ void minnowSimulate(SimulateOptions& simOpts){


// generate UMI list
std::vector<std::string> UMIList = util::generateUMIList() ;
std::vector<std::string> UMIList = util::generateUMIList(UMI_LENGTH, POOL_SIZE) ;

// If we usedbg none of other stuff needed

Expand Down

0 comments on commit 6a031b5

Please sign in to comment.