Skip to content

Commit f4768bd

Browse files
Merge pull request #13 from iainrb/devel
Bugfix to correctly record SNP normalization status
2 parents 4999031 + e965a5d commit f4768bd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Manifest.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ void Manifest::open(string filename, bool wide)
104104
{
105105
string s;
106106
ifstream file;
107-
snpClass *snp = new snpClass();
108107

109108
map<string, int> widecols; // Only used if opening a wide-format file.
110109
// Key = col. name; value = col. number (0 onwards).
@@ -185,6 +184,7 @@ void Manifest::open(string filename, bool wide)
185184

186185
//cout << "\nDEBUG: " << s << flush;
187186

187+
snpClass *snp = new snpClass();
188188

189189
if ( wide ) {
190190
size_t found = s.find("[Controls]");
@@ -319,6 +319,7 @@ void Manifest::open(string filename, bool wide)
319319
}
320320
else {
321321
convert (snp, a[SNP_COL]);
322+
322323
}
323324

324325
if ( -1 == BEADSETID_COL ) {
@@ -340,6 +341,8 @@ void Manifest::open(string filename, bool wide)
340341
normIdMap[snp->normId] = 1;
341342

342343
numsnps++; // If we got this far, must be OK to increment!
344+
345+
delete snp;
343346
}
344347

345348
file.close();

Manifest.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ class snpClass {
7373
long position;
7474
float score;
7575
char snp [2]; // 'GT' or 'AG' for example. Defined to be A/B for TOP strand.
76-
char iStrand; // Illumina Strand: B (Bottom) or T (Top)
77-
char cStrand; // Customer Strand: B (Bottom) or T (Top)
76+
char iStrand; // Original Illumina Strand: B (Bottom) or T (Top)
77+
char cStrand; // Original Customer Strand: B (Bottom) or T (Top)
7878
int normId; // index into normalisation table
7979
int BeadSetID; // Only available from "wide format" manifest files (.csv not .bpm.csv)
8080

8181
bool converted; // has SNP been converted from original to ILMN top strand?
82-
82+
// converted=true changes output of toString(), but not the iStrand and cStrand variables (which represent the original values)
8383
};
8484

8585

0 commit comments

Comments
 (0)