Skip to content
Commits on Source (6)
kallisto (0.46.0+dfsg-1) unstable; urgency=medium
* New upstream version
* debhelper-compat 12
* Standards-Version: 4.4.0
-- Andreas Tille <tille@debian.org> Wed, 07 Aug 2019 13:01:05 +0200
kallisto (0.45.1+dfsg-1) unstable; urgency=medium
* Initial release (Closes: #925417)
......
......@@ -3,11 +3,11 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.
Uploaders: Andreas Tille <tille@debian.org>
Section: science
Priority: optional
Build-Depends: debhelper (>= 12~),
Build-Depends: debhelper-compat (= 12),
cmake,
libhdf5-dev,
libhts-dev
Standards-Version: 4.3.0
Standards-Version: 4.4.0
Vcs-Browser: https://salsa.debian.org/med-team/kallisto
Vcs-Git: https://salsa.debian.org/med-team/kallisto.git
Homepage: https://pachterlab.github.io/kallisto
......
......@@ -18,6 +18,11 @@ struct BUSHeader {
std::string text;
std::vector<BUSTranscript> transcripts;
std::vector<std::vector<int32_t>> ecs;
uint32_t version;
uint32_t bclen;
uint32_t umilen;
BUSHeader() : version(0), bclen(0), umilen(0) {}
};
struct BUSData {
......@@ -26,8 +31,8 @@ struct BUSData {
int32_t ec;
uint32_t count;
uint32_t flags;
BUSData() : barcode(0), UMI(0), ec(-1), count(0), flags(0) {}
uint32_t pad;
BUSData() : barcode(0), UMI(0), ec(-1), count(0), flags(0), pad(0) {}
};
uint64_t stringToBinary(const std::string &s, uint32_t &flag);
......
#ifndef KALLISTO_COMMON_H
#define KALLISTO_COMMON_H
#define KALLISTO_VERSION "0.45.1"
#define KALLISTO_VERSION "0.46.0"
#include <string>
#include <vector>
......
......@@ -600,6 +600,106 @@ void ParseOptionsBus(int argc, char **argv, ProgramOptions& opt) {
}
bool ParseTechnology(const std::string &techstr, std::vector<BUSOptionSubstr> &values, std::vector<int> &files, std::vector<std::string> &errorList, std::vector<BUSOptionSubstr> &bcValues) {
int lastIndex = 0; //the last place in the string a colon and punctuation was found
int currValue = 1; //tells us the index of the three sequences needed barcode, umi, sequence
vector<int> numbers; //stores the numbers in a pairs
const char punctuationCompare = ',';
const char colonCompare = ':';
bool colon;
bool duplicate = false;
std::string stringVal;
int val;
for(int i = 1; i < techstr.length(); i++) {
colon = false;
if(techstr[i] == colonCompare) {
colon = true;
}
if(techstr[i] == punctuationCompare || colon) {
stringVal = techstr.substr(lastIndex, i-lastIndex);
try {
val = stoi(stringVal);
numbers.push_back(val);
if(numbers.size() == 1) {
if(!files.empty()) {
for(int j = 0; j < files.size(); j++) {
if(val == files[j]) {
duplicate = true;
break;
}
}
if(!duplicate) {
files.push_back(val);
} else {
duplicate = false;
}
} else {
files.push_back(val);
}
}
lastIndex = i + 1;
} catch(const std:: invalid_argument& ia) {
errorList.push_back("Error: Invalid argument");
return true;
}
if(colon) {
if(numbers.size() != 3) {
errorList.push_back("Error: Wrong number of pairs provided");
return true;
}
}
}
if(numbers.size() == 3) {
if(currValue == 1) {
bcValues.push_back(BUSOptionSubstr(numbers[0], numbers[1], numbers[2]));
} else {
values.push_back(BUSOptionSubstr(numbers[0], numbers[1], numbers[2]));
}
numbers.clear();
}
if(colon) {
currValue++;
}
}
if (files.empty()) {
errorList.push_back(std::string("Error: parsing technology string \"") + techstr + "\"");
return true;
}
std::sort(files.begin(), files.end());
for(int k = 0; k < files.size()-1; k++) {
if(files[k]+1 != files[k+1]) {
errorList.push_back("Error: files aren't correctly referenced");
return true;
}
}
stringVal = techstr.substr(lastIndex, techstr.length()-lastIndex);
if(numbers.size() == 2) {
try {
val = stoi(stringVal);
numbers.push_back(val);
values.push_back(BUSOptionSubstr(numbers[0], numbers[1], numbers[2]));
numbers.clear();
} catch(const std:: invalid_argument& ia) {
errorList.push_back("Error: Invalid argument");
return true;
}
} else {
errorList.push_back("Error: Wrong number of pairs provided");
return true;
}
if(currValue != 3) {
errorList.push_back("Error: Wrong number of substrings provided");
return true;
}
return false;
}
void ParseOptionsH5Dump(int argc, char **argv, ProgramOptions& opt) {
int peek_flag = 0;
......@@ -762,8 +862,25 @@ bool CheckOptionsBus(ProgramOptions& opt) {
busopt.umi = BUSOptionSubstr(0,6,16);
busopt.bc.push_back(BUSOptionSubstr(0,0,6));
} else {
cerr << "Unknown technology: " << opt.technology << endl;
ret = false;
vector<int> files;
vector<BUSOptionSubstr> values;
vector<BUSOptionSubstr> bcValues;
vector<std::string> errorList;
bool invalid = ParseTechnology(opt.technology, values, files, errorList, bcValues);
if(!invalid) {
busopt.nfiles = files.size();
for(int i = 0; i < bcValues.size(); i++) {
busopt.bc.push_back(bcValues[i]);
}
busopt.umi = values[0];
busopt.seq = values[1];
} else {
for(int j = 0; j < errorList.size(); j++) {
cerr << errorList[j] << endl;
}
cerr << "Unable to create technology: " << opt.technology << endl;
ret = false;
}
}
}
......