Commit 963205b1 authored by Charles Girardot's avatar Charles Girardot

bug fix for release 2.0.2.RC

parent 9373e9bb
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>Je</groupId>
<artifactId>Je</artifactId>
<version>2.0.1.RC</version>
<version>2.0.2.RC</version>
<name>Je</name>
<description>Je provides command line utilities to deal with barcoded FASTQ files with or without Unique Molecular Index (UMI)</description>
......
......@@ -226,9 +226,9 @@ public class DemultiplexCLI extends CommandLineProgram {
//output layouts
@Option(shortName="OL", optional = true,
printOrder=30,
doc="Describes the output file layout(s) using the slots defined in read layouts (<UMIn>, <BARCODEn>, <SAMPLEn>) and are made of "+
doc="Describes the output file layout(s) using the slots defined in read layouts ('<UMIn>, <BARCODEn>, <SAMPLEn>') and are made of "+
"three distinct parts separated with ':'.\n"+
"In addition to <UMIn>, <BARCODEn>, <SAMPLEn>, <READBARn> is used as a synonym to <BARCODEn> to indicate that the real sequence "+
"In addition to '<UMIn>, <BARCODEn>, <SAMPLEn>', '<READBARn>' is used as a synonym to '<BARCODEn>' to indicate that the real sequence "+
" should be written (as opposed to writting the barcode when usign <BARCODEn>). \n"+
"An output layout looks like '1:<BARCODE1><UMI1><UMI2>:<SAMPLE1>' where the three mandatory parts (':'-separated) are :\n"+
"\t"+"- The number in the first part (i.e. from '1:' above) is the output file index and it must be unique across all 'OL' inputs. \n"+
......
......@@ -645,6 +645,7 @@ public class Demultiplexer {
concatenatedCodes.put("", 0); //init with empty string
Map<Integer, Map<String, BarcodeMatch>> barcodeMatches = new HashMap<Integer, Map<String, BarcodeMatch>>();
boolean hasNoSample = false;
for(Entry<Integer, List<BarcodeMatch>> e : barcodeMatchBySlotIdx.entrySet()){
/*
* for those slots with more than one BARCODE MATCH, we need to consider all possible concatenations
......@@ -675,18 +676,25 @@ public class Demultiplexer {
String sampleName = "";
//a note to add to the diagnostic
String diagNote = "";
if( false == hasNoSample){
if( false == hasNoSample){ //does not mean we have a sample yet
//do these string resolved to the same sample ?
Map<String, Integer> sampleNames = new HashMap<String, Integer>();
Map<String, String> sampleName2concatenatedCode = new HashMap<String, String>();
for (Entry<String, Integer> code : concatenatedCodes.entrySet()) {
String sname = barcodehash2sample.get(code.getKey().hashCode());
sampleNames.put( sname , code.getValue());
sampleName2concatenatedCode.put(sname, code.getKey());
log.debug("Potential sample for code '"+code+"' => "+sname);
if(sname !=null) {
sampleNames.put( sname , code.getValue());
sampleName2concatenatedCode.put(sname, code.getKey());
}
}
if(sampleNames.size() == 0) {
diagNote = "no sample name correspond to identified barcode(s)";
}
//if there is a unique sample assignment
if(sampleNames.size() == 1){
else if(sampleNames.size() == 1){
Entry<String, Integer> en = sampleNames.entrySet().iterator().next();
sampleName = en.getKey();
// pick a unique match per slot
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment