Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Update GBSX digest script (input file location error fixed)
Browse files Browse the repository at this point in the history
Updated GBSX demultiplexer for Single Read demultiplexer, issue with Enzymes with variable site. (This problem did not occure in Paired-End demultiplexing)
  • Loading branch information
koen authored and koen committed Jan 11, 2016
1 parent ae53a65 commit 05a8f6d
Show file tree
Hide file tree
Showing 8 changed files with 820 additions and 7 deletions.
4 changes: 3 additions & 1 deletion releases/latest/GBSX_digest_v1.0.pl → GBSX_digest_v1.1.pl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@
my @ref_chr;
open (ref_files,$fasta_file_locations)||die "could not open file $fasta_file_locations\n";
while(<ref_files>){
chop;
#update 1.1: change chop to chomp
#chop;
chomp;
$_=~s/\n//;$_=~s/\r//;
if ($_ ne ""){
push(@ref_chr,$_);
Expand Down
382 changes: 382 additions & 0 deletions releases/GBSX_v1.1.5/GBSX_digest_v1.1.pl

Large diffs are not rendered by default.

Binary file not shown.
382 changes: 382 additions & 0 deletions releases/latest/GBSX_digest_v1.1.pl

Large diffs are not rendered by default.

Binary file added releases/latest/GBSX_v1.1.5.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/be/uzleuven/gc/logistics/GBSX/GBSX.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class GBSX {

public static final boolean DEBUG = false;
public final static String VERSION = "GBSX v1.1.4";
public final static String VERSION = "GBSX v1.1.5";
private final static String LICENCE = "GPLv3";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ private void processPairEndFastqFiles(){
mostMismatches = sample.getBarcodeMismatches();
}
}
//mostMismatches += this.parameters.getAllowedMismatchesEnzyme();
statsFile.saveStats(mostMismatches, this.parameters.getOutputDirectory());
this.correctionLog.writeToFile(this.parameters.getOutputDirectory());
} catch (IOException ex) {
Expand Down Expand Up @@ -478,9 +479,10 @@ private void processSingleReadFastqFiles(){
int mostMismatches = this.parameters.getAllowedMismatchesBarcode();
for (Sample sample : this.sampleList){
if (sample.getBarcodeMismatches() > mostMismatches){
mostMismatches = sample.getBarcodeMismatches();
mostMismatches = sample.getBarcodeMismatches();
}
}
//mostMismatches += this.parameters.getAllowedMismatchesEnzyme();
statsFile.saveStats(mostMismatches, this.parameters.getOutputDirectory());
} catch (IOException ex) {
this.writeToLog("ERROR in reading the fastq files: " + ex.getMessage());
Expand Down Expand Up @@ -1114,22 +1116,30 @@ private SampleBarcodeCombination findGBSBarcode(String sequence, int startDistan
}
if (barcodeLocationLength[0] != -1){
//try every enzyme site
boolean cutsiteFound = false;
String exactEnzymeCutSite = "";
int[] cutsiteLocationLength = new int[1];
cutsiteLocationLength[0] = 0;
for (String enzymeCutSite : sample.getEnzyme().getInitialCutSiteRemnant()){
int[] cutsiteLocationLength;
if ((cutsiteLocationLength = this.findingDistanceAlgorithm.calculateEquivalentDistance(sequence.substring(distance + barcodeLocationLength[1]), enzymeCutSite, this.parameters.getAllowedMismatchesEnzyme()))[0] != -1){
//check on adaptor ligase
if (this.parameters.getAdaptorLigaseMismatches() != -1){
String adaptor = this.parameters.getCommonAdaptor();
for (int l = cutsiteLocationLength[1]/2; l <= cutsiteLocationLength[1]; l++){
if (this.findingDistanceAlgorithm.calculateEquivalentDistance(sequence.substring(distance + barcodeLocationLength[1] + l), adaptor, this.parameters.getAdaptorLigaseMismatches())[0] != -1){
if (this.findingDistanceAlgorithm.calculateEquivalentDistance(sequence.substring(distance + barcodeLocationLength[1] + cutsiteLocationLength[1]), adaptor, this.parameters.getAdaptorLigaseMismatches())[0] != -1){
return null;
//adaptor ligase
}
}
}
foundSampleSet.add(new SampleBarcodeCombination(sample, enzymeCutSite, distance, barcodeLocationLength[0], barcodeLocationLength[1], cutsiteLocationLength[1]));
// return new SampleBarcodeCombination(sample, enzymeCutSite, distance, barcodeLocationLength[0], barcodeLocationLength[1], cutsiteLocationLength[1]);
exactEnzymeCutSite = enzymeCutSite;
cutsiteFound = true;
}
}
if (cutsiteFound){
foundSampleSet.add(new SampleBarcodeCombination(sample, exactEnzymeCutSite, distance, barcodeLocationLength[0], barcodeLocationLength[1], cutsiteLocationLength[1]));

}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,41 @@ public int getLengthFoundBarcode(){
return this.lengthFoundBarcode;
}

/**
*
* @param s SampleBarcodeCombination
* @return true if the same sample is used
*/
public boolean isSameSample(SampleBarcodeCombination s){
if (s.getSample().equals(this.getSample())){
return true;
}else{
return false;
}
}

/**
*
* @param s SampleBarcodeCombination
* @return true is this sampleBarcodeCombination is better then s:
* the location of this must be lower
* when equal location this mismatches must be lower or equal
*/
public boolean isThisBetter(SampleBarcodeCombination s){
if(isSameSample(s)){
if(s.getLocation() < this.getLocation()){
return false;
}else if(s.getLocation() > this.getLocation()){
return true;
}else{
if(s.getMismatches() >= this.getMismatches()){
return true;
}else{
return false;
}
}
}else{
return false;
}
}
}

0 comments on commit 05a8f6d

Please sign in to comment.